how to add a custom memory section specifically for the NRF5340 in Zephyr project

Dear Nordic

Our primary configuration in pm_static.yml is as follows:

mcuboot: 0x0~0x10000
mcuboot_primary: 0x10000~0x40000
mcuboot_secondary: 0x40000~0x70000
extlib_section: 0x70000~0x100000

In the generated storage section configuration in the linker.cmd file under the build zephyr directory, we see:

MEMORY
{
    FLASH (rx) : ORIGIN = 0x18000, LENGTH = 0x28000
    RAM (wx) : ORIGIN = 0x20010000, LENGTH = 0x40000
   
    IDT_LIST (wx) : ORIGIN = 0xFFFF7FFF, LENGTH = 32K
}

I would like to define the extlib_section storage segment within the MEMORY block and allocate external libraries to this section in SECTIONS.

Using zephyr_linker_sources in CMakeLists.txt, I can add configuration to SECTIONS, but I haven't found a way to add custom storage segments to MEMORY. I tried using zephyr_linker_memory; it doesn't generate errors during compilation, but it also has no effect.

Do you have any suggestions?

Parents Reply
  • My SDK version is 2.6.1

    Yesterday, I discovered that by setting CONFIG_HAVE_CUSTOM_LINKER_SCRIPT=y and CONFIG_CUSTOM_LINKER_SCRIPT="ext_lib_memory.ld," I could use my own linker script for Zephyr. However, I found that all the automatically generated components were missing. I would like to add my own content while retaining the existing automatically generated content.

Children
No Data
Related