Hi.
I have the following memory map file:
<!DOCTYPE Board_Memory_Definition_File>
<Root name="nrf52840">
<MemorySegment name="FLASH" start="0x0" size="0x100000" access="ReadOnly" />
<MemorySegment name="RAM" start="0x20000000" size="0x40000" access="Read/Write" />
<MemorySegment name="uicr_bootloader_start_address" start="0x00000FF8" size="0x4" access="ReadOnly" />
<MemorySegment name="bootloader_settings_page" start="0x000FF000" size="0x1000" access="ReadOnly" />
<MemorySegment name="uicr_mbr_params_page" start="0x00000FFC" size="0x4" access="ReadOnly" />
<MemorySegment name="mbr_params_page" start="0x000FE000" size="0x1000" access="ReadOnly" />
</Root>
when it's processed to generate an ld script for gcc this is the header of the ld script:
MEMORY
{
UNPLACED_SECTIONS (wx) : ORIGIN = 0x100000000, LENGTH = 0
uicr_mbr_params_page (wx) : ORIGIN = 0x00000ffc, LENGTH = 0x00000004
uicr_bootloader_start_address (wx) : ORIGIN = 0x00000ff8, LENGTH = 0x00000004
mbr_params_page (wx) : ORIGIN = 0x000fe000, LENGTH = 0x00001000
bootloader_settings_page (wx) : ORIGIN = 0x000ff000, LENGTH = 0x00001000
RAM (wx) : ORIGIN = 0x20000000, LENGTH = 0x00040000
FLASH (wx) : ORIGIN = 0x00000000, LENGTH = 0x00100000
}
I verified using all kind of parameters and trying to use options->build->memory segment playing with various RWX permissions, i always get (RW) eventually in the ld script.
i tried to look in the generated ld script to see if i see somewhere lese restrictions for read only sections but i cannot find any.
i'm using segger studio for nordic nrf52840, the flash memory is not writable in any case, but memory map should also define peripherals and registers which are also read only, what's the point defining it right if eventually the ld script does not enforce it ?
I have verified the same behavior with various nrf sdk 15.2 examples, changing the permissions in the memory map results in the same ld script permissions. is that a bug or done on purpose ?