Hi everyone!
I have a custom board with the Adarfuit UF2 Bootloader (https://github.com/adafruit/Adafruit_nRF52_Bootloader) and a SoftDevice. With the old SDK v2.5.1 I created my own boards and defined fixed partition in the dts of my board files to account for the bootloader and SoftDevice, so that they are not overwritten. I found this approach nice and clean because I didn't have to specify static partitions in my applications, they were just working out of the box. I configured my board-defconfig file to output uf2 files and I simply could pre-flash the bootloader and afterwards use the uf2 images to load my applications. As simple as that.
Now I wanted to migrate to the SDK v2.8.0 and sysbuild. However, I'm a bit lost now, because my initial approach does not seem to work anymore. Specifically, the fixed partition in my dts files are ignored. Which seems to be intended according to this post (Defining static partitions in NC2.7 (sysbuild vs partition manger)).
What I tried so far and what was working is the following:
- I can use a pm_static.yml in my applications to tell the Partition Manager to put my application after the SoftDevice and MBR. BUT: I don't like to add it to all my applications.
- I disabled the Partition Manager in sysbuild.conf using
SB_CONFIG_PARTITION_MANAGER=n
. But somehow I don't think it is a nice solution to simply disable the partition manager.
I also tried it similar to the nrf52840dongle board files. Which simply define a flash load offset if CONFIG_BOARD_HAS_NRF5_BOOTLOADER=y.
File Kconfig
if BOARD_NRF52840DONGLE config BOARD_HAS_NRF5_BOOTLOADER bool "Board has nRF5 bootloader" default y help If selected, applications are linked so that they can be loaded by Nordic nRF5 bootloader. endif # BOARD_NRF52840DONGLE
File Kconfig.defconfig
if BOARD_NRF52840DONGLE # To let the nRF5 bootloader load an application, the application # must be linked after Nordic MBR, that is factory-programmed on the board. # Nordic nRF5 bootloader exists outside of the partitions specified in the # DTS file, so we manually override FLASH_LOAD_OFFSET to link the application # correctly, after Nordic MBR. # When building MCUBoot, MCUBoot itself will select USE_DT_CODE_PARTITION # which will make it link into the correct partition specified in DTS file, # the offset is applied here so that the full partition size can be used when # the bootloader Kconfig option has been disabled. config FLASH_LOAD_OFFSET default 0x1000 depends on BOARD_HAS_NRF5_BOOTLOADER && (MCUBOOT || !USE_DT_CODE_PARTITION) # ... other config not shown endif #BOARD_NRF52840DONGLE
I also tried this with my custom board, but for any reason it does not work.
So what I initially wanted to ask is, if there is any approach how to properly account for an exsisting bootloader, SoftDevice, etc. in the board configuration files?
Thank you in advance,
Mathias