cancel
Showing results for 
Search instead for 
Did you mean: 

Cosmic Linker - absolute memory address problem

bogusz
Associate II
Posted on May 29, 2014 at 12:17

Hello,

I'm using

Cosmic STM8 32K Special Edition Free license

v. 4.3.11 under STVD IDE.

MCU: STM8L151

I'm trying to place 4 bytes with specific values into absolute memory address. I found in manual and even on cosmic web FAQ this help:

http://www.cosmic-software.com/faq/faq3.php

So I did exactly same, but in flash there are only zeros, so it seems it doesn't work. Compiler and Linker doesn't produce any warning or error.

Here is part in my code:

&sharppragma section const {chanid}

 

                const unsigned char variable1 = 0x56;

 

                const unsigned char variable2 = 0x57;

 

                const unsigned char variable3 = 0x58;

 

                const unsigned char variable4 = 0x59;

 

&sharppragma section const {}

And here is part in LKF (I'm using custom mode in linker options):

+seg .chanid -b 0xfd00

Am I something missing?

#cosmic-linker
2 REPLIES 2
luca239955_stm1_st
Senior II
Posted on June 02, 2014 at 14:22

what do you get in the map file?

bogusz
Associate II
Posted on June 03, 2014 at 14:14

Oh yes, there was a problem:

_variable1                                          ********   *** removed from Debug\driving.o ***

_variable2                                          ********   *** removed from Debug\driving.o ***

_variable3                                          ********   *** removed from Debug\driving.o ***

_variable4                                          ********   *** removed from Debug\driving.o ***

I had to add argument -k to lkf because in Compiler options I have +split argument:

+seg .chanid -b 0xfd00 -k

So now it works and I see that values in flash.

Thanks for kick in 🙂