Dear all
I'm using CC2541 connected to an external MCU, everything works fine.
I would like to store 8 bytes at a known address into flash memory code.
I tried the following using IAR:
in my .c file:
#pragma location = "MY_CONST_FLASH_SEGMENT" __root const uint8 myConsts[8] = { 0,1,2,3,4,5,6,7 };
and in the linker file ti_51ew_cc2540b.xcl
after the checksum definition
-Z(CODE)CHECKSUM#_CODE_END
I added
-P(CODE)MY_CONST_FLASH_SEGMENT#0x3FFF0-0x3FFFF
I can see the bytes correctly stored when generating a bin output, anyway this seems to conflict with lock bits that seems to be stored also at the end of the 256K flash.
I tried other addresses without success.
My questions are :
1) Is there a better way to place 8 bytes in flash ?
2) What addresses in the flash could be safe to store those 8 bytes (without conflicting with flash locks bits, and without penalizing the compiler to compile properly) ?
thanks to all !