cancel
Showing results for 
Search instead for 
Did you mean: 

need some help with cosmic compiler

egesuita
Associate II
Posted on January 13, 2005 at 10:36

need some help with cosmic compiler

4 REPLIES 4
egesuita
Associate II
Posted on January 06, 2005 at 16:15

Hi everybody,

I'm a beginner with the cosmic environment and I need some help for using cosmic C compiler.

I'm working with STlite09 and I'm not able to edit the right .lkf file for the linker.

In fact when I try to put some local variables inside functions in my source code this is

the error the linker reports:

C:\ENZO\ST7\C\triac>clnk -o triac.st7 triac.lkf

#error clnk triac.lkf:1 can't locate shared segment

triac.st7 is the file I obtained from the compiler after compiling my project sources.

this is the ''incriminated'' portion of the source code:

void main(void)

{

unsigned int t;

t = 14;

.........

the linker error vanished when I remove the declaration of the variable t inside the main() function.

for reference I report my .lkf and .bat files I used (some comments are in italian):

see attachments

please could you tell me how to fix this bug?

(a new .bat a .lkf would be fine too...)

I would like also to test the new ST7MC1 8kflash mcu for motor control.

I would like to write some C source code for testing the brushless motor control peripheral.

please can someone send me a valid .bat and .lkf files for the Cosmic C compiler compatibles

with the memory map of the STMC1 ?

I read both manuals of the cosmic complier and linker but I was unable to write down a functioning .lkf file for the stlite I think I would have the same mistakes with the ST7MC1 so finally.....your help would be very appreciated! thank you so much!

Thank you very much for the time you spent on reading this post and of course thank you very much for your precious help.

regards

Enzo

________________

Attachments :

triac.lkf : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hztr&d=%2Fa%2F0X0000000bVV%2FxSlQeQ3uxWEoKxTt87_VMAACeYQFRUgva_6HGqM3t4g&asPdf=false

triac_bat.txt : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0D2&d=%2Fa%2F0X0000000bVO%2FHCWUxaMqerNBW3HS9VnQCe3wGKU0VxNvaKOw9UG6b7Q&asPdf=false
luca239955_st
Associate III
Posted on January 07, 2005 at 05:10

Enzo,

with the memory model you are using local variables will be in the shared area, so you need to define this area in the linker file with a line such as

+seg .share -a iram -is # shared segment

Don't hesitate to give me a call if you need more info (my number is

http://www.cosmicsoftware.com/contact.php

, under ''Italy'')

Regards,

Luca (Cosmic)

egesuita
Associate II
Posted on January 13, 2005 at 09:22

dear Luca,

thanks for your suggestion. now everything is working with my st7lite09.

as i told you i would like to write some C code with comic compiler for the ST7MC1 8kflash mcu for motor control.

may I write down my .bat and .lkf files for such device starting form the ones I have for the STLite09?

In other words, may I simply change addresses defining the segments conforming to the ST7MC1 memory map?

thanks again for your precious help

regards

Enzo

luca239955_st
Associate III
Posted on January 13, 2005 at 10:36

Quote:

may I write down my .bat and .lkf files for such device starting form the ones I have for the STLite09?

In other words, may I simply change addresses defining the segments conforming to the ST7MC1 memory map?

yes, you can.

But you can also use the latest rev of STVD7 that will generate those 2 file automatically for you (at least for the ''basic'' options)

Quote:

... ST7MC1 8kflash mcu ...

you need a license for that. If you don't have one already you can contact me.

Ciao,

Luca