cancel
Showing results for 
Search instead for 
Did you mean: 

RAM Size config

taipei
Associate
Posted on January 12, 2015 at 11:39

Hi STM8 master,

One quick question about the STM8 RAM size change

I checked the xxx.map file and used 86 Byte on stack.

I did change the RAM size through in Project settings->Linker->Input

but lkf file does not change with setting than show .text size overflow .

 --------------lkf file----------------

# Segment Ram:

+seg .data -b 0x100 -m 0x271 -n .data

+seg .bss -a .data -n .bss

+def __stack=0x3ff 

 --------------lkf file----------------

 why?

Is any document talk about  this?

Thank you

David Lee
2 REPLIES 2
luca239955_stm1_st
Senior II
Posted on January 12, 2015 at 13:27

Hello,

I'm not sure what your question is and what you are actually trying to achieve, but in the linker file part that you have reported you are telling the linker that your variables will start at 0x100 and will not have to exceed 625 bytes (0x271).

According to this, the linker will report an error only if your variables use more than 625 bytes (in page1, but no need to go into these details at this point..), regardless of the stack.

The stack itself will start at 0x3FFF and grow backward: if it grows too much (note that the stack size prediction by the compiler is pretty accurate, but can be wrong is special cases, and thus is not guaranteed) it will overwrite some global variables, resulting in all kinds of strange behaviours (most likely an application crash) at run time (that's not something that you can check at compile/link time)

Hope it helps.

Luca

taipei
Associate
Posted on January 13, 2015 at 02:48

Hi Luca,

I changed end value of the RAM to 0x300 but the lkf file  always show 0x271

Do you know how STM8 extend RAM to 0x300

Many Thanks

David Lee