Hello @Tom77854 ,
I think the issue comes from an incorrect definition location of __DATA_ROM. The linker does not automatically reserve space in FLASH just because AT() is specified.
To verify this, you can check the generated .map file to see whether any section actually occupies address 0x00010000. Alternatively, you can directly inspect the Flash contents in the debugger—for example, by checking whether there is valid data at 0x00010000 in the debugger’s Memory View.
My recommended approach is to define a dedicated ROM region and assign a section to it, for example:
MEMORY
{
FLASH (RX) : ORIGIN = 0x00000000, LENGTH = 128K
DATA_ROM (RX) : ORIGIN = 0x00010000, LENGTH = 8K
SRAM (RW) : ORIGIN = 0x1FFFF000, LENGTH = 16K
}
.data_rom :
{
__DATA_ROM = .;
KEEP(*(.data_init))
} > DATA_ROM
.data : AT(__DATA_ROM)
{
__data_start__ = .;
*(.data)
*(.data*)
__data_end__ = .;
} > SRAM
Hope it helps.
BR
Celeste