"const" initialization in program memory at absolute address doesn't work as expected
Good afternoon, im working with a PIC32MZ and i am trying to place a checksum word at a specific location in program memory. As far as i can tell from the XC32 documentation, and the past threads i've found this should be simple with the following attribute directives:
unsigned int checksum __attribute__((space(prog),address(0x9D000000)))=0xABCDABCD;
however when i program this, then inspect the program memory through the execution memory window 0xABCDABCD isn't anywhere in flash, and its certainly not at the PHY address 0x9D000000&0x1FFFFFFF=0x1D000000.
If i remove the absolute address from the attribute and instead compile and download this:
unsigned int low_flash_id __attribute__((space(prog)))=0xABCDABCD;
I can see the word 0xABCDABCD correctly located in program flash, at an address assigned by the linker.
I'm using the default linker script, so there shouldnt be any surprises there. Can anyone suggest what i've done incorrectly in the first absolute addressed definition?