Hi,
I am nrf52dk/nRF52832 (512kB flash) nordic peripheral_lbs sample as a test environment for establishing OTA updates. In my product firmware, I am facing a situation where I need to reduce the size of mcuboot partition to 0x9000 (36kB). I would like to reallocate the freed up space to the primary and secondary partitions.
I have viewed many of the tickets on this forum for help - which have helped me reach the stage that I am so far.
Adjusting the slots sizes with MCU Boot
MCUBoot, Zephyr, and static partition manager
The following command gives me this output.
west build -b nrf52dk/nrf52832 --sysbuild -d build . -t partition_manager
I have checked that the size of the peripheral_lbs firmware should fit inside the image partitions. However, when I try to build the full application with
west build -b nrf52dk/nrf52832 --sysbuild -d build .
I get the following error
←[0mninja: error: '_sysbuild/mcuboot_primary_app_hex', needed by 'mcuboot_primary.hex', missing and no known rule to make it
-- Configuring done -- Generating done -- Build files have been written to: C:/Users/Ryan/Downloads/peripheral-lbs-sysbuild-main/build_app/peripheral-lbs-sysbuild-main -- Found partition manager static configuration : C:/Users/Ryan/Downloads/peripheral-lbs-sysbuild-main/pm_static.yml Partition 'mcuboot' is not included in the dynamic resolving since it is statically defined. Partition 'mcuboot_pad' is not included in the dynamic resolving since it is statically defined. Partition 'mcuboot_primary' is not included in the dynamic resolving since it is statically defined. Partition 'mcuboot_primary_app' is not included in the dynamic resolving since it is statically defined. Partition 'mcuboot_secondary' is not included in the dynamic resolving since it is statically defined. Partition 'settings_storage' is not included in the dynamic resolving since it is statically defined. -- Configuring done -- Generating done -- Build files have been written to: C:/Users/Ryan/Downloads/peripheral-lbs-sysbuild-main/build_app/peripheral-lbs-sysbuild-main -- Found partition manager static configuration : C:/Users/Ryan/Downloads/peripheral-lbs-sysbuild-main/pm_static.yml Partition 'mcuboot' is not included in the dynamic resolving since it is statically defined. Partition 'mcuboot_pad' is not included in the dynamic resolving since it is statically defined. Partition 'mcuboot_primary' is not included in the dynamic resolving since it is statically defined. Partition 'mcuboot_primary_app' is not included in the dynamic resolving since it is statically defined. Partition 'mcuboot_secondary' is not included in the dynamic resolving since it is statically defined. Partition 'settings_storage' is not included in the dynamic resolving since it is statically defined. -- Configuring done -- Generating done Partition 'mcuboot_primary' is not included in the dynamic resolving since it is statically defined. Partition 'mcuboot_primary_app' is not included in the dynamic resolving since it is statically defined. Partition 'mcuboot_secondary' is not included in the dynamic resolving since it is statically defined. Partition 'settings_storage' is not included in the dynamic resolving since it is statically defined. -- Configuring done -- Generating done Partition 'mcuboot_secondary' is not included in the dynamic resolving since it is statically defined. Partition 'settings_storage' is not included in the dynamic resolving since it is statically defined. -- Configuring done -- Generating done -- Generating done -- Build files have been written to: C:/Users/Ryan/Downloads/peripheral-lbs-sysbuild-main/build_app ←[92m-- west build: building application ←[0mninja: error: '_sysbuild/mcuboot_primary_app_hex', needed by 'mcuboot_primary.hex', missing and no known rule to make it FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\ce3b5ff664\opt\bin\cmake.EXE' --build C:/Users/Ryan/Downloads/peripheral-lbs-sysbuild-main/build_app
Here is the .yml file I used to define the partitioning
app: address: 0x9200 end_address: 0x43800 region: flash_primary size: 0x3A600 # -200?? mcuboot: address: 0x0 end_address: 0x9000 placement: before: - mcuboot_primary region: flash_primary size: 0x9000 mcuboot_pad: address: 0x9000 end_address: 0x9200 placement: before: - mcuboot_primary_app region: flash_primary size: 0x200 mcuboot_primary: address: 0x9000 end_address: 0x43800 orig_span: &id001 - mcuboot_pad - mcuboot_primary_app # originally just app region: flash_primary sharers: 0x1 size: 0x3A800 span: *id001 mcuboot_primary_app: address: 0x9200 end_address: 0x43800 orig_span: &id002 - app region: flash_primary size: 0x3A600 # 200 less due to padding span: *id002 mcuboot_secondary: address: 0x43800 end_address: 0x7E000 region: flash_primary size: 0x3A800 settings_storage: address: 0x7E000 end_address: 0x80000 placement: after: mcuboot_secondary region: flash_primary size: 0x2000 sram_primary: address: 0x20000000 end_address: 0x20010000 region: sram_primary size: 0x1000 # previously 10000
Previously, I was getting some issues about too many or too little gaps in the partition table. However that seems to have resolved itself. If anyone could also explain what that means in relation to dynamic and static partitioning - that would be divine. Here is the error I got for context
-- Configuring done -- Generating done -- Build files have been written to: C:/Users/Ryan/Downloads/peripheral-lbs-sysbuild-main/build/peripheral-lbs-s -- Found partition manager static configuration : C:/Users/Ryan/Downloads/peripheral-lbs-sysbuild-main/pm_static Partition 'mcuboot' is not included in the dynamic resolving since it is statically defined. Partition 'mcuboot_pad' is not included in the dynamic resolving since it is statically defined. Partition 'mcuboot_primary' is not included in the dynamic resolving since it is statically defined. Partition 'mcuboot_primary_app' is not included in the dynamic resolving since it is statically defined. Partition 'mcuboot_secondary' is not included in the dynamic resolving since it is statically defined. Partition 'settings_storage' is not included in the dynamic resolving since it is statically defined. Partition manager failed: Incorrect amount of gaps found in static configuration. There must be exactly one gap namic partitions (such as 'app'). Gaps found (0): The most common solution to this problem is to fill the smalle until there is only one gap left. Alternatively re-order the already defined static partitions so that only one Failed to partition region flash_primary, size of region: 524288 Partition Configuration: app: size: 239104 mcuboot: size: 36864 mcuboot_pad: size: 512 mcuboot_primary: size: 239616 mcuboot_primary_app: size: 239104 mcuboot_secondary: size: 239616 settings_storage: placement: after: mcuboot_secondary size: 8192