Hi,
I am developing on a nRF52832 with S132 softdevice using Segger and SDK15.2.0. I am doing some tests with the Flash memory, and my goal is to have some const variables that point to a specific flash section, so they can be changed afterwards using nrfjprog.
I created a section called .cfg_data, by adding the corresponding line in the flash_placement.xml file:
<ProgramSection load="no" name=".cfg_data" start="$(CONFIG_FLASH_START)" size="$(CONFIG_FLASH_SIZE)" />
Also, I configured the Placement Macros in the Linker section of the project configuration, like this (just modified the flash_size and added CONFIG_FLASH):
FLASH_PH_START=0x0
FLASH_PH_SIZE=0x80000
RAM_PH_START=0x20000000
RAM_PH_SIZE=0x10000
FLASH_START=0x26000
FLASH_SIZE=0x59000
CONFIG_FLASH_START=0x7f000
CONFIG_FLASH_SIZE=0x1000
RAM_START=0x200022b8
RAM_SIZE=0xdd48
And finally, I declared a test variable in main.c to test if it worked:
static const uint32_t test_var __attribute__((section(".cfg_data"))) = 0x55;
Then, to check if it has been initialized, I check with nrfjprog:
nrfjprog --memrd 0x7F000 --n 1024
But I see the whole page uninitialized.
What am I missing?
Thanks in advance!