Programming application firmware using MCUboot serial recovery

nRF Util

tags
nRF Util

nrfutil device can be used to program application firmware on devices with the mcuBoot device trait.

Note

This is a programming method for Nordic Thingy:91 X, Nordic Thingy:91, and Nordic Thingy:53.

The procedure happens over the MCUboot serial recovery, a mode in which the bootloader is waiting for a new image upload to start. In this mode, the new image is transferred through an USB CDC ACM class instance. The bootloader overwrites the existing application located on the primary slot with the new application image. If the transfer is interrupted, the device cannot boot the incomplete application, and the image upload must be performed again.

Complete the following steps:

  1. Build your nRF Connect SDK project for the System in Package (SiP) or the System on Chip (SoC) of the Thingy device. For example, Nordic Thingy:91 uses nRF9160 SiP. This will generate the file zephyr.signed.hex.

  2. Connect your device to your computer using an USB cable.

  3. Find the device serial number by running the following command:

    nrfutil device list --traits mcuBoot
    

    The serial number of the device will be referenced as <serial_number> in the programming step. For Nordic Thingy:91 and Nordic Thingy:53, the serial number is composed of 20 characters (for example, THINGY91_C2E0AC7F599 or THINGY53_C2E0AC7F599). For Nordic Thingy:91 X, it has 21 characters (for example, THINGY91X_C2E0AC7F599).

  4. Put the SiP or the SoC of the Thingy device in the application serial recovery mode by holding in the appropriate button while powering it off and on.
    This is the SW3 button for Nordic Thingy:91 and Nordic Thingy:91 X, and the SW2 button for Nordic Thingy:53.

  5. Program the zephyr.signed.hex file to the device by running the following command:

    nrfutil device program --firmware build/<your_application_name>/zephyr/zephyr.signed.hex --serial-number <serial_number>
    

If nrfutil device fails with a timeout error, make sure you put the device in the application serial recovery mode with the SW3 button. See also Troubleshooting.