AnsweredAssumed Answered

Cannot write to EEPROM by using DATA_SEG definition

Question asked by Philippe Allemann on Mar 5, 2012
Latest reply on Mar 5, 2012 by Philippe Allemann


I m trying to write a value in the EEPROM at the address 0xFC0800. It functions with the following code:

/* Definition */
uint16 u16_bootloaderFlag @ 0xFC0800;

/* changing the value */
u16_bootloaderFlag = 0xABCD;

But the following code won't work:

/* prm file */
EEPROM_FC_BOOT = READ_ONLY DATA_FAR IBCC_FAR 0xFC0800 TO 0xFC081F; /* 32 Bytes used for the bootloader variables */

/* Definition in .c the file*/
uint16 u16_bootloaderFlag; /* Located in the banked EEEPROM see .prm file */

/* changing the value */
u16_bootloaderFlag = 0xABCD;

After this line, the bootloaderFlag is equal to 0. By the way, the map file confirms me that the u16_bootloaderFlag variable is located at 0xFC0800.

Am I missing something in the declaration of the prm file to get write access?

Thanks for your help!

PS: uC = HCS12X