Custom board with Static partitions, MCUboot and Sysbuild

Hello!

I am using an nRF Connect SDK V2.9.0 with a nrf54l15. I want to set up a project with a custom board. I want to add DFU in the future, so there must be MCUboot bootloader and static partitions defined.

I took the zephyr/samples/sysbuild/with_mcuboot sample. Then I compiled it for the nrf54l15dk. From the build directory, I took the partitions.yml file and copied it as pm_static.yml to the root folder of my project. I enabled the partition manager in the sysbuild.conf file, compiled the project again and flashed it - everything works fine and the board prints some logs, as described in the sample readme.

Then, using the VScode extension, I have created a custom board. And I slightly adjusted it:

1) Enabled UART, so I would be able to get some logs, when I run the code on a nrf54l15dk

2) Added missing zephyr,flash-controller chosen node

3) Reduced the boot_partition size to 48K, so it matches the pm_static.yml

The code compiles for the custom board, but when I flash it and reset the board - nothing happens.
Using a debugger, I found out that the bootloader starts, but is unable to find an image. Also, for some reason, logs are disabled in the bootloader.
With a help of the nrfjprog, I have dumped the MCU's memory and inspected the dump. In the dump, I can see the image at the expected address.

So the problem is that I cannot properly set up the project for a custom board, while it works fine for a board from the SDK.
Here is a repository with my code, that exposes the issue I am facing: link

Parents
  • It looks like I was able to resolve the issue. The problem was with the CONFIG_BOOT_MAX_IMG_SECTORS. For my custom board, the value of this property was 128. And for the devkit the value was 256 - it is defined in the <sdk_root>/bootloader/mcuboot/boot/zephyr/boards/nrf54l15dk_nrf54l15_cpuapp.conf file - that's why I was not able to find it, I was only looking in the nrf54l15dk board definition folder.
    I have changed the value to 256 and now my application boots.

  • Hi,

    Thats a good find! FYI in case you would ever need to add an external flash, you will have to increase it to 512. The reason is because the image sector size varies depending on where your secondary mcuboot partition resides. If it is present on the internal flash you will have IMG_SECTOR_SIZE = 256, whereas if you have the secondary partition on the external flash IMG_SECTOR_SIZE  will be 512 since the primary application is now 2x the size of the case when you had the secondary partition on the internal flash.

    I'll mark the case as verified for now, and please feel free to open new cases for new questions

    Kind regards,
    Andreas

Reply
  • Hi,

    Thats a good find! FYI in case you would ever need to add an external flash, you will have to increase it to 512. The reason is because the image sector size varies depending on where your secondary mcuboot partition resides. If it is present on the internal flash you will have IMG_SECTOR_SIZE = 256, whereas if you have the secondary partition on the external flash IMG_SECTOR_SIZE  will be 512 since the primary application is now 2x the size of the case when you had the secondary partition on the internal flash.

    I'll mark the case as verified for now, and please feel free to open new cases for new questions

    Kind regards,
    Andreas

Children
No Data
Related