I am trying to compile a custom bootloader for nRF5340 net core (b0n) that is part of a multi-image build.
I have created two separate applications, one based on b0n (nrf/samples/nrf5340/netboot) and one based on nrf/samples/bluetooth/peripheral_lbs. These both build without issue when used as single image applications and I can debug them (using hello_world on the app core) and they appear to work.
I have tried adding the b0n as a child image of the application by adding the following code to CMakeLists.txt
if (CONFIG_SECURE_BOOT)
add_child_image(
NAME b0n
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../boot_stage1
)
endif()
If I then build the net app, the application builds, but b0n is neither built nor linked.
I have tried adding CONFIG_SECURE_BOOT=y to the prj.conf file. If I have the above CMakeLists.txt change, I get the following compilation error:
- I don't know why the netboot sample should be used to generate the cache.
- The CMakeLists.txt are identical in both the sample and in my local build.
- I don't know why they need to match anyway.
What is going wrong here?
p.s. Most of the documnetation about multi-image bootloader builds suggest using CONFIG_B0_BUILD_STRATEGY_FROM_SOURCE=y. There doesn't appear to be an equivalent CONFIG_B0N_BUILD_STRATEGY_FROM_SOURCE.