MCUboot: Recovery retention

This sample demonstrates how to reboot into MCUboot’s recovery (firmware loader) mode using the retention boot mode subsystem. See Running the DFU process for details on DFU support in Bare Metal.

Requirements

The sample supports the following development kits:

S115:

Hardware platform

PCA

Board target

nRF54L15 DK

PCA10156

bm_nrf54l15dk/nrf54l15/cpuapp/s115_softdevice/mcuboot

nRF54L15 DK (emulating nRF54L10)

PCA10156

bm_nrf54l15dk/nrf54l10/cpuapp/s115_softdevice/mcuboot

nRF54L15 DK (emulating nRF54L05)

PCA10156

bm_nrf54l15dk/nrf54l05/cpuapp/s115_softdevice/mcuboot

nRF54LM20 DK

PCA10184

bm_nrf54lm20dk/nrf54lm20a/cpuapp/s115_softdevice/mcuboot

nRF54LS05 DK

PCA10214

bm_nrf54ls05dk/nrf54ls05b/cpuapp/s115_softdevice/mcuboot

nRF54LV10 DK

PCA10188

bm_nrf54lv10dk/nrf54lv10a/cpuapp/s115_softdevice/mcuboot

S145:

Hardware platform

PCA

Board target

nRF54L15 DK

PCA10156

bm_nrf54l15dk/nrf54l15/cpuapp/s145_softdevice/mcuboot

nRF54L15 DK (emulating nRF54L10)

PCA10156

bm_nrf54l15dk/nrf54l10/cpuapp/s145_softdevice/mcuboot

nRF54L15 DK (emulating nRF54L05)

PCA10156

bm_nrf54l15dk/nrf54l05/cpuapp/s145_softdevice/mcuboot

nRF54LM20 DK

PCA10184

bm_nrf54lm20dk/nrf54lm20a/cpuapp/s145_softdevice/mcuboot

nRF54LS05 DK

PCA10214

bm_nrf54ls05dk/nrf54ls05b/cpuapp/s145_softdevice/mcuboot

nRF54LV10 DK

PCA10188

bm_nrf54lv10dk/nrf54lv10a/cpuapp/s145_softdevice/mcuboot

Overview

After the application boots, it waits 3 seconds before setting the retention register for entering the firmware loader mode and then reboots the device. The device then starts advertising the MCUmgr service allowing for a firmware update to be loaded.

Building and running

This sample can be found under samples/boot/mcuboot_recovery_retention/ in the Bare Metal folder structure.

For details on how to create, configure, and program a sample, see Getting Started with the samples.

Testing

  1. Compile and program the application.

  2. Connect the device to the computer to access UART 0. If you use a development kit, UART 0 is forwarded as a COM port (Windows) or ttyACM device (Linux) after you connect the development kit over USB.

  3. Connect to the DK with a terminal emulator (for example, the Serial Terminal app) to UART 0.

  4. Reset the DK.

  5. Observe that the device boots and reboots into firmware loader mode and then advertises with the default name nRF_BM_MCUmgr.

    You can configure this name using the CONFIG_APP_FIRMWARE_LOADER_BLE_DEVICE_NAME Kconfig option of the firmware_loader image. For information on how to do this, see Configuring Kconfig.

  6. Connect to your device using the nRF Connect Device Manager mobile application.

  7. Under the image tab, tap Advanced. Then, in the image control pane, tap Read. Observe that the details of the currently loaded application are displayed.