Hello,
We are in the process of migrating from NCS v2.1.3 to NCS v2.6.0.
Since we have many devices fielded already, one of our requirements is to continue using pre-built hex files for NSIB/B0 and mcuboot.
As such, we also have a separate pre-built hex file to provision our public key hashes to the OTP region.
Our pre-built hex files predate the following features of the NSIB introduced in v2.2.0:
- PRoT lifecycle state
- Implementation ID
The addition of this new data to the OTP region would not be a problem in itself, but it seems to have also brought a breaking change to the build process.
- In NCS v2.6.0,
provision.hex
is always generated and appended tomerged.hex
even when usingCONFIG_B0_BUILD_STRATEGY_USE_HEX_FILE=y.
- I do not know if this behavior is true for v2.2.0 - v2.5.0; we will not be doing any migrations to those versions.
- In NCS v2.1.3,
provision.hex
is not appended tomerged.hex
when usingCONFIG_B0_BUILD_STRATEGY_USE_HEX_FILE=y.
We want to generate one set of binaries without provision.hex
, and one set with provision.hex
(for the manufacturing process).
When trying to create the latter set, mergehex
fails with the following error message:
mergehex -m /path/to/prebuilt/provision.hex build/zephyr/merged.hex -o merged-with-provision.hex
Parsing input files.
Merging file "provision.hex" into output.
Merging file "merged.hex" into output.
Overlapping segments detected at address 16744752.ERROR: The hex files cannot be merged since there are conflicts.
ninja: build stopped: subcommand failed.
It is not possible to use the generated provision.hex
even with the same public keys because the offset of data in provision.hex
now accounts for PRoT lifecycle state and Implementation ID. Our old, pre-built bootloaders will not have knowledge of this layout change for the bl_storage library.
For now as a workaround I will be stripping the generated provision.hex
as a post-build step, but this is very tedious to maintain; what if build output paths/filenames change in the future?
My questions boil down to:
- Is there a white paper or migration guide detailing how applications with B0 built from NCS <=v2.1.x should proceed? I was surprised to find no migration guide for NCS v2.2.0...
- Is there a Kconfig option to control this behavior -- that is, to prevent generating & merging
provision.hex
? I cannot find one documented.
Thank you in advance for your guidance!