2004-05-11 08:56 PM
memory model and link command file settings of ST72F521
2004-05-09 09:25 PM
Hi @all!
I have a ST72F521 and my own designed board. Now I start programming. First problem: I don't know the right memory model. Who can me say or give me a tip, what is the best memory model for my microcontroller? By what kind of circumstances should I use what kind of memory model? Second problem: I don't know the right settings of the link command file (*.lkf). I need one area in the microcontroller as EEPROM and the rest of area is standard. who can me say what segments I should define? I use the C compiler from Cosmic. Thank You for the answers! Regards, Chris2004-05-10 04:11 AM
Hi Chris,
Just install the latest release of STVD7 (release 3.0) which now helps you in this process of configuring your project fo the micro you have selected. STVD7 r3.0 name means now ST Visual Develop and no longuer ST Visual Debug beacause now it helps you not only debug your application but also build your project with all existing ST7 tool set. Let m eknow if you had any difficulties using it. Regards2004-05-10 07:52 PM
Thank you for your answer.
I use some hard- and software from softec microsystems: inDart ST7F. The software is: ST7 Visual Debug inDart-ST7 v1.16 based on STVD2.5.4 and the DataBlaze. I programmed my microcontroller over IPC-connector. Can I use still the STVD7 (release 3.0)? regards, Chris2004-05-10 08:38 PM
sir Ampel. Hello~.
The devices you have are perfectly same with mine. I use a Indart (softec), Cosmic C and Indart - STX 2.00 (based on STVD 2.5.1) , too. I was really pleased at your comments, as if meeting a friends. But I can't give any advice because I'm so poor at this part. So sorry for that. [ This message was edited by: musu on 11-05-2004 09:09 ]2004-05-10 08:44 PM
@ musu
I'm not an expert, too. Can you plaese tell me how do you make the settings of the microcontroller? Special the settings of the option byte and the *lkf-file. What memory model do you use? Chris2004-05-10 10:08 PM
Hi all,
here is an example project in C for the LITE0. It has been developed with Cosmic and it is full commented. I hope this could be of help. You can find more help, reading the cxst7_Eval.pdf in the ...\EVALST7\Docs folder on your PC. Regards, Nicola P.S. I'm sorry Chris, but we don't support STVD7 v.3.0 yet. ________________ Attachments : Adc.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I03T&d=%2Fa%2F0X0000000bVb%2FH.QVPn3weF2AMbWzk8IthjDNNO9xjtY5awGHy4ivs.M&asPdf=false2004-05-10 10:19 PM
Personally for that type of device I use mods (stack short) but this is very dependent on your application.
Regarding the linker file something like the following would work: +seg .text -b 0x1000 -n .text # program start address +seg .const -a .text # constants follow code +seg .ubsct -b 0x80 -m 0x80 # zero page ram +seg .bss -b 0x3B8 -m 0x680 # near ram startup.o # startup routine main.o # application files c:/cosmic/cxst7/lib/libis.st7 # integer lib for stack short c:/cosmic/cxst7/lib/libm.st7 # machine lib +seg .const -k -b 0xffe0 # vectors start address vector.o # interrupt vectors Have a look in cosmic user guide for all details on options. If you require initialised data the following will need to be added to the lkf file and a bsct and data section will need to be defined. +def __endzp=@.ubsct # end of uninitialized zpage +def __memory=@.bss # end of bss segment Newer versions of cosmic can also use bit variables, a bit section will need to be defined, eg. +seg .bit -a .ubsct The __stack option you see in some lkf file is not used by cosmic anymore. I usually compile with the following options: -l -v +split +debug +mods -pp and use my own startup file, its just a copy of the cosmic startup but does a jump to main rather than a call - this saves a stack location. This part does not have eeprom so I am confused by your last comment - do you wish to perform IAP ? Hope this helps Regards sjo2004-05-10 10:49 PM
Hi sjo!
yes, I use IAP (in application programming). That means, I have designed my own board, in the middle the ST72F521. I use the pins ICCDATA, ICCClock, ICCSEL,.... and connect them to another board of softecmicro (inDart ST7F). This board is connect over USB with my PC. So I can program my microcontroller. My link command file looks like: _______________________________________________ +seg .firma -b 0x1000 -n .firma # special const section fuer Firma +seg .text -a .firma -n.text # program start address bei 1000hex +seg .const -a .text # constants follow code direkt nach .text +seg .bsct -b 0x80 -n.bsct -m 0x80 # zero page start address bei 80hex # mit einer Groesse von 128bytes (80hex). +seg .ubsct -a .bsct -n.ubsct # uninitialized zero page +seg .data -a .ubsct -n .data +seg .bit -a .data -n.bit # ??? ist das richtig ??? +seg .bss -a .bit -n .bss +seg .eeprom -b 0xEF00 -c -m 256 # eeprom-Bereich startet bei EF00hex crts.o # startup routine with automatic # data initialisation in zero page only hauptprogramm.o # application program ''C:\COSMIC\CXST7\Lib\libfsl.st7'' ''C:\COSMIC\CXST7\Lib\libm.st7'' +seg .const -b 0xffe0 # vectors start address vector_521.o # interrupt vectors _______________________________________________ By what kind of conditions should I take what kind of memory model? regards, Chris2004-05-11 12:45 AM
If you are performing iap then sector zero (iap bootcode) would need to be from 0xF000 so a segment such as
+seg .iap -b 0xF000 -n .iap would need to be in your lkf. Sector 0 is not adjustable on this device, unlike smaller st7's. There is no easy guide to selection of memory model, I find stack models are better for larger applications (>16K), functions are reentrant by default aswell. But it all depends on ram useage, speed requirements, etc. Have a look at AN1575 for details on IAP. Regards sjo