noinit section at a specific address

We're using a noinit section of ram to store a "reboot reason" if/when we need to do a SW reset (i.e. in a watchdog handler).

This works as expected, we set the reboot reason before calling sys_reboot(), and then read it out after the reboot.

However, we would like to allocate a specific memory address to this noinit-section, this to make it fixed across e.g. a FOTA.
As we see it now, the noinit section is laid out in between the static memory address range, and is prune to be moved when changing the the code (between FW versions).
This might cause erroneous values to be read at first boot after FOTA.

Obviously we should change the linker config file, but this is generated by CMake/west, how should we "give input" here?

BR

Alf

Related