MSP430F5529: Reserve flash for data - Keeps erasing flash during

Part Number: MSP430F5529

Tool/software:

I have updated my linker file to reserve some space out of flash for data only.  I'm using large code model, which looks to start putting code at 0x10000 in FLASH2 region first, thus is why I carved out the memory from the FLASH section.  I can see my application write to the memory and when I read it back via display in the memory window it appears correct.  However, when then perform another debug session the memory gets overwritten.

I have tried updating settings in the (.json) and selecting only a range for it to erase, but that doesn't seem to work.

    FLASH                   : origin = 0x4400, length = 0xB780  /* Used to end at 0xFB7F */
    DATAFLASH               : origin = 0xFB80, length = 0x0400  /* Reserved 1024 bytes */
    FLASH2                  : origin = 0x10000,length = 0x143F8 /* Boundaries changed to fix CPU47 */
  • In "Project->Properties->Debug->MSP430 Flash Settings->Erase Options", select "Erase and Download necessary segments only".

    Unsolicited: I think Flash segments are 512 bytes on the F5529. You should probably align DATAFLASH (origin and length) on a 0x200 boundary so you can erase it later.

**Attention** This is a public forum