Place constant data into flash at specific address

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Place constant data into flash at specific address

954 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by salmandosersa on Thu Jun 09 07:49:53 MST 2016
Hi

I'm trying to place at the top of the flash a number of version software.
i already tried

const char test[]="HELLO";
and search the string into the .bin file and i couldn't find it.
I know this method don't put the string into a specific address.

I modify the Memory layout to
Flash   Location 0x0000 size 0x3000
Flash2 Location 0x3000 size 0x1000
then...
__attribute__ ((section (".rodata.Flash2"))) const char test[]="HELLO";
didn't work.

I'm using LPC1115 LPCXpresso Board with LPCXpresso 8.1.4

thanks
Labels (1)
0 Kudos
3 Replies

638 Views
lpcware
NXP Employee
NXP Employee
bump
0 Kudos

638 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by salmandosersa on Thu Jun 09 10:24:48 MST 2016
the attribute "used" didn't work, but using it in my code did.

__attribute__ ((used,section (".rodata.$Flash2"))) const char version[] = "V01";
__attribute__ ((used,section (".rodata.$Flash2"))) static const char version[] = "V01";

is that ok?

Thanks
0 Kudos

638 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by vtw.433e on Thu Jun 09 08:44:39 MST 2016
Do you use (reference) the variable in your code? If not, the linker will discard it as it is unused. Either use it, or use the "used" attribute.
0 Kudos