Change flash offset of NET core application

 

Background

For reasons that I do not want to dispute here, I am building a custom bootloader for the APP + NET cores on the nRF5340. This custom bootloader is not a Zephyr application and has its own build system separate from NCS + Zephyr. I need to instruct the NCS/Zephyr build system (NCS v2.8.0) to compile the APP and NET core images to be based at an offset from the start of their respective flash e.g., 0xC000.

Progress

Based on Sigurd’s response to https://devzone.nordicsemi.com/f/nordic-q-a/117283/config_flash_load_offset-not-respected-in-v2-8-0?focus=true I’ve added a placeholder partition to my pm_static.yml for the APP core bootloader, and it works as expected.

(NOTE: the CONFIG_FLASH_LOAD_OFFSET param doesn’t seem to do anything for either core)

Problem

I cannot relocate the NET core image to a different flash offset

Steps Taken

Using the following pm.yml file (same as for app core, except the flash base address is 0x1000000 for net core)

bootloader:

  address: 0x1000000

  size: 0xC000

-- Build files have been written to: C:/Users/tg/project/build/ipc_radio
-- Found partition manager static configuration : C:/Users/tg/project/pm_static.yml
Partition 'rpmsg_nrf53_sram' is not included in the dynamic resolving since it is statically defined.
-- Found partition manager static configuration CPUNET: C:/Users/tg/project/sysbuild/ipc_radio/pm_static.yml
CMake Warning at C:/ncs/v2.8.0/nrf/cmake/sysbuild/partition_manager.cmake:85 (message):
  Static partition manager file has changed since this project was last
  configured, this may cause images to use the original static partition
  manager file configuration data, which is incorrect.  It is recommended
  that a pristine build be performed when a static partition manager file is
  updated.
Call Stack (most recent call first):
  C:/ncs/v2.8.0/nrf/cmake/sysbuild/partition_manager.cmake:633 (partition_manager)
  C:/ncs/v2.8.0/nrf/sysbuild/CMakeLists.txt:661 (include)
  cmake/modules/sysbuild_extensions.cmake:583 (nrf_POST_CMAKE)
  cmake/modules/sysbuild_extensions.cmake:583 (cmake_language)
  cmake/modules/sysbuild_images.cmake:23 (sysbuild_module_call)
  cmake/modules/sysbuild_default.cmake:20 (include)
  C:/ncs/v2.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
  C:/ncs/v2.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
  C:/ncs/v2.8.0/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)
  template/CMakeLists.txt:10 (find_package)

  • Hello,

    To ensure your static partitioning file is correctly applied to the network core build, please try the following:

    1. If it doesn't already exist, create a new file named sysbuild.cmake in the root directory of your project.

    2. In the file, add the following lines to set the PM_STATIC_YML_FILE for the ipc_radio build:

    if(SB_CONFIG_PARTITION_MANAGER AND DEFINED  SB_CONFIG_SOC_SERIES_NRF53X)
      set(ipc_radio_PM_STATIC_YML_FILE ${CMAKE_CURRENT_LIST_DIR}/<insert name of your netcore partition file>.yml CACHE INTERNAL "")
    endif()

    Best regards,

    Vidar

    EDITI tested with SDK v3.0.0 by placing a placeholder "bootloader" partition at address 0 and confirmed that it worked.

Related