cancel
Showing results for 
Search instead for 
Did you mean: 

ST7 memory mapping

jmpavageau
Associate II
Posted on March 25, 2005 at 11:13

ST7 memory mapping

3 REPLIES 3
jmpavageau
Associate II
Posted on March 23, 2005 at 06:46

Hello!

Need help for linker script with stdv7.

I'm using the ST7LITE29 with shot memory model. The linker script I use is attached. At linking time I got this error :

Running ST7 linker

clnk -o Debug\tutorial.st7 -l''C:\Program Files\Cosmic\LIB'' -mDebug\tutorial.map Debug\tutorial.lkf

#error clnk Debug\tutorial.lkf:1 segment .text size overflow (96)

#error clnk Debug\tutorial.lkf:1 segment .const size overflow (332)

#error clnk Debug\tutorial.lkf:1 segment .init size overflow (15)

#error clnk Debug\tutorial.lkf:1 segments .text (0xf000-0x1005f) and .const (0xffe0-0x10000) overlap

The command: ''clnk -o Debug\tutorial.st7 -l''C:\Program Files\Cosmic\LIB'' -mDebug\tutorial.map Debug\tutorial.lkf '' has failed, the returned value is: 1

exit code=1.

Why sections overlap ?

What is the max size for each section ?

What kind of memory model is better than another one ?

What kind of data is stored into .shared and others sections?

Any solution ???

thank you.

Jm

________________

Attachments :

tutorial.lkf : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I08s&d=%2Fa%2F0X0000000bUV%2FWgIIkzWzeqxsYotnRhJj0EoIAy7hJB0fZSZ3z3k61.U&asPdf=false
luca239955_st
Associate III
Posted on March 24, 2005 at 04:53

Hi,

looks like your application is too big for the derivative chosen.

The .text section (the code) is bigger that the available space (specified in the linker file with the -m 0xfff directive) and thefore it gets out of its limits and overlaps with the interrupt vectors (whose address is fixed by the hardware).

Quote:

What is the max size for each section ?

defined in the linker file, usually to reflect some hardware limitations (like memory size) of the micro used.

Quote:

What kind of memory model is better than another one ?

What kind of data is stored into .shared and others sections?

For these questions you need to read the manual (cosmic/cxST7/doc/), but basically, the best memory model is the smallest that will allow you to compile, and the share segment is a part of RAM that is used by the compiler to simulate the stack for local variables and parameter passing.

Quote:

Any solution ???

try to reduce the code size (comment out some functions, try to avoid floating point) and you should be able to compile.

Reading the manual is strongly recommended to have an overview of how the toolchain works.

Regards,

Luca (Cosmic)

jmpavageau
Associate II
Posted on March 25, 2005 at 11:13

ok thank you!

I'm working with the eval version of the cosmic compiler limited to 4k. This is because I got this error, because my code is bigger than 4k.

I try to reduce size code, avoiding floatting point usage. But it still to big....

Now I'm thinking to buy the commercial version of this compiler.

Thank you.

Jm