CONFIG_HW_UNIQUE_KEY_LOAD does not work with CONFIG_DISABLE_FLASH_PATCH

I am using nRF Connect SDK 1.9.0 and the NRF52840.

When building samples/keys/hw_unique_key you get this warning:

----------------------------------------------------------
--- WARNING: To maintain the integrity of secure boot, ---
--- enable CONFIG_DISABLE_FLASH_PATCH in production. ---
----------------------------------------------------------

If you turn on CONFIG_DISABLE_FLASH_PATCH for b0, it breaks the sample and you can never boot. This is because CONFIG_HW_UNIQUE_KEY_LOAD only allows one boot for the application to load the HUK. CONFIG_DISABLE_FLASH_PATCH needs to reboot b0 when running the first time. This means we can never boot to the app.

So what is the best solution, should you use CONFIG_DISABLE_FLASH_PATCH in production and not use CONFIG_HW_UNIQUE_KEY_LOAD?

The sample works without CONFIG_HW_UNIQUE_KEY_LOAD, so what is the benefit of using CONFIG_HW_UNIQUE_KEY_LOAD?

Is there a fix that can be made to allow both CONFIG_DISABLE_FLASH_PATCH and CONFIG_HW_UNIQUE_KEY_LOAD?

Related