I'm trying to run a custom image on the net core. I've successfully done so using the following exercise in the intermediate course:
lesson 8 exercise 2
however when trying to add the B0n secure bootloader to the netcore, I'm running into some issues. When trying to build i get the following error:
-- Found partition manager static configuration : /home/Jonas/projects/fw_update/fw_update_firmware/pm_static.yml
Partition 'mcuboot' is not included in the dynamic resolving since it is statically defined.
Traceback (most recent call last):
File "/home/Jonas/projects/fw_update/nrf/scripts/partition_manager.py", line 1054, in <module>
main()
File "/home/Jonas/projects/fw_update/nrf/scripts/partition_manager.py", line 1022, in main
args, ranges_configuration = parse_args()
^^^^^^^^^^^^
File "/home/Jonas/projects/fw_update/nrf/scripts/partition_manager.py", line 928, in parse_args
parser.add_argument(f'--{x}-size', required=True, type=lambda z: int(z, 0))
File "/usr/lib/python3.12/argparse.py", line 1507, in add_argument
return self._add_action(action)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/argparse.py", line 1889, in _add_action
self._optionals._add_action(action)
File "/usr/lib/python3.12/argparse.py", line 1709, in _add_action
action = super(_ArgumentGroup, self)._add_action(action)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/argparse.py", line 1521, in _add_action
self._check_conflict(action)
File "/usr/lib/python3.12/argparse.py", line 1658, in _check_conflict
conflict_handler(action, confl_optionals)
File "/usr/lib/python3.12/argparse.py", line 1667, in _handle_conflict_error
raise ArgumentError(action, message % conflict_string)
argparse.ArgumentError: argument --sram_primary-size: conflicting option string: --sram_primary-size
CMake Error at /home/Jonas/projects/fw_update/nrf/cmake/sysbuild/partition_manager.cmake:179 (message):
Partition Manager failed, aborting. Command:
/home/Jonas/projects/.venv/bin/python3;/home/Jonas/projects/fw_update/nrf/scripts/partition_manager.py;--input-files;/home/Jonas/projects/fw_update/fw_update_firmware/build/b0n/zephyr/include/generated/pm.yml;/home/Jonas/projects/fw_update/fw_update_firmware/build/b0n/modules/nrf/subsys/partition_manager/pm.yml.secure_boot_storage;/home/Jonas/projects/fw_update/fw_update_firmware/build/zephyr/include/generated/pm.yml;/home/Jonas/projects/fw_update/fw_update_firmware/build/b0n/zephyr/include/generated/pm.yml;/home/Jonas/projects/fw_update/fw_update_firmware/build/b0n/modules/nrf/subsys/partition_manager/pm.yml.secure_boot_storage;/home/Jonas/projects/fw_update/fw_update_firmware/build/zephyr/include/generated/pm.yml;--regions;sram_primary;flash_primary;sram_primary;flash_primary;--output-partitions;/home/Jonas/projects/fw_update/fw_update_firmware/build/partitions_CPUNET.yml;--output-regions;/home/Jonas/projects/fw_update/fw_update_firmware/build/regions_CPUNET.yml;--flash_primary-dynamic-partition;custom_net_image;--sram_primary-size;0x10000;--sram_primary-base-address;0x21000000;--sram_primary-placement-strategy;complex;--sram_primary-dynamic-partition;sram_primary;--flash_primary-size;0x40000;--flash_primary-base-address;0x1000000;--flash_primary-placement-strategy;complex;--flash_primary-device;flash_controller;--flash_primary-default-driver-kconfig;CONFIG_SOC_FLASH_NRF;--sram_primary-size;0x10000;--sram_primary-base-address;0x21000000;--sram_primary-placement-strategy;complex;--sram_primary-dynamic-partition;sram_primary;--flash_primary-size;0x40000;--flash_primary-base-address;0x1000000;--flash_primary-placement-strategy;complex;--flash_primary-device;flash_controller;--flash_primary-default-driver-kconfig;CONFIG_SOC_FLASH_NRF
Call Stack (most recent call first):
/home/Jonas/projects/fw_update/nrf/cmake/sysbuild/partition_manager.cmake:639 (partition_manager)
/home/Jonas/projects/fw_update/nrf/sysbuild/CMakeLists.txt:826 (include)
cmake/modules/sysbuild_extensions.cmake:598 (nrf_POST_CMAKE)
cmake/modules/sysbuild_extensions.cmake:598 (cmake_language)
cmake/modules/sysbuild_images.cmake:46 (sysbuild_module_call)
cmake/modules/sysbuild_default.cmake:21 (include)
/home/Jonas/projects/fw_update/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
/home/Jonas/projects/fw_update/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
/home/Jonas/projects/fw_update/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)
template/CMakeLists.txt:10 (find_package)
-- Configuring incomplete, errors occurred!
FATAL ERROR: command exited with status 1: /usr/bin/cmake -DWEST_PYTHON=/home/Jonas/projects/.venv/bin/python3 -B/home/Jonas/projects/fw_update/fw_update_firmware/build -GNinja -DBOARD=nrf7002dk/nrf5340/cpuapp -S/home/Jonas/projects/fw_update/zephyr/share/sysbuild -DAPP_DIR:PATH=/home/Jonas/projects/fw_update/fw_update_firmwareI'm using NCS version 3.1.0 and build for the nrf7002dk/nrf5340/cpuapp
with the following configurations:
prj.conf
CONFIG_GPIO=y ## partition manager ## CONFIG_BOOTLOADER_MCUBOOT=y CONFIG_FLASH=y CONFIG_STREAM_FLASH=y CONFIG_FLASH_MAP=y CONFIG_IMG_MANAGER=y CONFIG_MCUBOOT_IMG_MANAGER=y # Enable Network Core on application core startup CONFIG_SOC_NRF53_CPUNET_ENABLE=y ## logging ## # Enable logging CONFIG_LOG=y # Enable UART console CONFIG_UART_CONSOLE=y # Disable RTT console (if previously enabled) CONFIG_RTT_CONSOLE=n # Set the logging backend to UART CONFIG_LOG_BACKEND_UART=y CONFIG_USE_SEGGER_RTT=n CONFIG_LOG_BACKEND_RTT=n
sysbuild.cmake:
ExternalZephyrProject_Add(
APPLICATION custom_net_image
SOURCE_DIR ${APP_DIR}/../custom_net_image
BOARD nrf5340dk/nrf5340/cpunet
)
set_property(GLOBAL APPEND PROPERTY PM_DOMAINS CPUNET)
set_property(GLOBAL APPEND PROPERTY PM_CPUNET_IMAGES custom_net_image)
set_property(GLOBAL PROPERTY DOMAIN_APP_CPUNET custom_net_image)
set(CPUNET_PM_DOMAIN_DYNAMIC_PARTITION custom_net_image CACHE INTERNAL "")
add_dependencies(${DEFAULT_IMAGE} custom_net_image)
sysbuild_add_dependencies(FLASH ${DEFAULT_IMAGE} custom_net_image)
sysbuild.conf:
## bootloader mcuboot ## SB_CONFIG_BOOTLOADER_MCUBOOT=y ## secure boot network core ## SB_CONFIG_SECURE_BOOT_NETCORE=y
pm_static.yml:
mcuboot: address: 0x0 size: 0x10000 # 64 KB (increase as needed, default is often 48 KB, try 56 KB: 0xe000) region: flash_primary
What could be causing this error? And how could i resolve it?
Thanks in advance for the support.