Updating the Thingy:91 firmware using Programmer

You can use the Programmer app from nRF Connect for Desktop to:

These operations can be done through USB using MCUboot, or through an external debug probe. When developing with your Thingy:91, it is recommended to use an external debug probe.

Note

The external debug probe must support Arm Cortex-M33, such as the nRF9160 DK. You need a 10-pin 2x5 socket-socket 1.27 mm IDC (Serial Wire Debug (SWD)) JTAG cable to connect to the external debug probe.

Download and extract the latest application and modem firmware from the Thingy:91 Downloads page.

The downloaded ZIP archive contains the following firmware:

Application firmware

The img_app_bl folder contains full firmware images for different applications. The guides for programming through an external debug probe in this section use the images in this folder.

Application firmware for Device Firmware Update (DFU)

The images in the img_fota_dfu_bin and img_fota_dfu_hex folders contain firmware images for DFU. The guides for programming through USB in this section use the images in the img_fota_dfu_hex folder.

Modem firmware

The modem firmware is in a ZIP archive instead of a folder. The archive is named mfw_nrf9160_ followed by the firmware version number. Do not unzip this file.

The CONTENTS.txt file in the extracted folder contains the location and names of the different firmware images.

The instructions in this section show you how to program the Connectivity bridge and Asset Tracker v2 applications, as well as the modem firmware. Connectivity bridge provides bridge functionality for the hardware, and Asset Tracker v2 simulates sensor data and transmits it to Nordic Semiconductor’s cloud solution, nRF Cloud.

The data is transmitted using either LTE-M or NB-IoT. Asset Tracker v2 first attempts to use LTE-M, then NB-IoT. Check with your SIM card provider for the mode they support at your location. For the iBasis SIM card provided with the Thingy:91, see iBasis IoT network coverage.

Tip

For a more compact nRF Cloud firmware application, you can build and install the Cellular: nRF Cloud multi-service sample. See the Programming onto Thingy:91 section for more information.

Note

To update the Thingy:91 through USB, the nRF9160 SiP and nRF52840 SoC bootloaders must be factory-compatible. The bootloaders might not be factory-compatible if the nRF9160 SiP or nRF52840 SoC has been updated with an external debug probe. To restore the bootloaders, program the nRF9160 SiP or nRF52840 SoC with factory-compatible Thingy:91 firmware files through an external debug probe.

Note

You can also use these precompiled firmware image files for restoring the firmware to its initial image.

Updating the firmware in the nRF52840 SoC

To update the firmware, complete the following steps:

  1. Open nRF Connect for Desktop and launch the Programmer app.

  2. Scroll down in the menu on the left and make sure Enable MCUboot is selected.

    Programmer - Enable MCUboot

    Programmer - Enable MCUboot

  3. Switch off the Thingy:91.

  4. Press SW4 while switching SW1 to the ON position.

    thingy91_sw1_sw4

    Thingy:91 - SW1 SW4 switch

  5. In the Programmer navigation bar, click SELECT DEVICE. A drop-down menu appears.

    Programmer - Select device

    Programmer - Select device

  6. In the menu, select the entry corresponding to your device (MCUBOOT).

    Note

    The device entry might not be the same in all cases and can vary depending on the application version and the operating system.

  7. In the menu on the left, click Add file in the FILE section, and select Browse. A file explorer window appears.

    Programmer - Add file

    Programmer - Add file

  8. Navigate to where you extracted the firmware.

  9. Open the folder img_fota_dfu_hex that contains the HEX files for updating over USB. See the CONTENTS.txt file for information on which file you need.

  10. Select the Connectivity bridge firmware file.

  11. Click Open.

  12. Scroll down in the menu on the left to the DEVICE section and click Write.

    Programmer - Writing of HEX files

    Programmer - Writing of HEX files

    The MCUboot DFU window appears.

    Programmer - MCUboot DFU

    Programmer - MCUboot DFU

  13. In the MCUboot DFU window, click Write. When the update is complete, a “Completed successfully” message appears.

  14. Scroll up in the menu on the left to the FILE section and click Clear files.

Update the modem firmware on the nRF9160 SiP

To update the modem firmware using USB, complete the following steps:

  1. Open nRF Connect for Desktop and launch the Programmer app if you do not have it open already.

  2. Make sure that Enable MCUboot is selected.

  3. Switch off the Thingy:91.

  4. Press SW3 while switching SW1 to the ON position.

    Thingy:91 - SW1 SW3 switch

    Thingy:91 - SW1 SW3 switch

  5. In the menu, select Thingy:91.

  6. In the menu on the left, click Add file in the FILE section, and select Browse. A file explorer window appears.

    Programmer - Add file

    Programmer - Add file

  7. Navigate to where you extracted the firmware.

  8. Find the modem firmware zip file with the name similar to mfw_nrf9160_*.zip and the number of the latest version.

    Note

    Do not extract the modem firmware zip file.

  9. Select the zip file and click Open.

  10. In the Programmer app, scroll down in the menu on the left to the DEVICE section and click Write.

    Programmer - Update modem

    Programmer - Update modem

    The Modem DFU via MCUboot window appears.

    Programmer - Modem DFU via MCUboot

    Programmer - Modem DFU via MCUboot

  11. In the Modem DFU via MCUboot window, click Write. When the update is complete, a Completed successfully message appears.

Program the nRF9160 SiP application

To program the application firmware using USB, complete the following steps:

  1. Open nRF Connect for Desktop and launch the Programmer app if you have not done already.

  2. Make sure that Enable MCUboot is selected.

  3. Switch off the Thingy:91.

  4. Press SW3 while switching SW1 to the ON position.

    Thingy:91 - SW1 SW3 switch

    Thingy:91 - SW1 SW3 switch

  5. In the Programmer navigation bar, click SELECT DEVICE. A drop-down menu appears.

    Programmer - Select device

    Programmer - Select device

  6. In the menu, select Thingy:91.

  7. In the menu on the left, click Add file in the FILE section, and select Browse. A file explorer window appears.

    Programmer - Add file

    Programmer - Add file

  8. Navigate to where you extracted the firmware.

  9. Open the folder img_fota_dfu_hex that contains the HEX files for updating over USB. See the CONTENTS.txt file for information on which file you need.

  10. Select the appropriate Asset Tracker v2 firmware file.

    Note

    If you are connecting over NB-IoT and your operator does not support extended Protocol Configuration Options (ePCO), select the file that has legacy Protocol Configuration Options (PCO) mode enabled.

  11. Click Open.

  12. Scroll down in the menu on the left to the DEVICE section and click Write.

    Programmer - Writing of HEX files

    Programmer - Writing of HEX files

    The MCUboot DFU window appears.

    Programmer - MCUboot DFU

    Programmer - MCUboot DFU

  13. In the MCUboot DFU window, click Write. When the update is complete, a Completed successfully message appears.

  14. Scroll up in the menu on the left to the FILE section and click Clear files.

Partition layout

When building firmware on the Thingy:91 board, a static partition layout matching the factory layout is used. This ensures that programming firmware through USB works. In this case, the MCUboot bootloader will not be updated. So, to maintain compatibility, it is important that the image partitions do not get moved. When programming the Thingy:91 through an external debug probe, all partitions, including MCUboot, are programmed. This enables the possibility of using an updated bootloader or defining an application-specific partition layout.

Configure the partition layout using one of the following configuration options:

  • CONFIG_THINGY91_STATIC_PARTITIONS_FACTORY - This option is the default Thingy:91 partition layout used in the factory firmware. This ensures firmware updates are compatible with Thingy:91 when programming firmware through USB.

  • CONFIG_THINGY91_STATIC_PARTITIONS_SECURE_BOOT - This option is similar to the factory partition layout, but also has space for the immutable bootloader and two MCUboot slots. A debugger is needed to program Thingy:91 for the first time. This is an experimental feature.

  • CONFIG_THINGY91_STATIC_PARTITIONS_LWM2M_CARRIER - This option uses a partition layout, including a storage partition needed for the LwM2M carrier library.

  • CONFIG_THINGY91_NO_PREDEFINED_LAYOUT - Enabling this option disables Thingy:91 pre-defined static partitions. This allows the application to use a dynamic layout or define a custom static partition layout for the application. A debugger is needed to program Thingy:91 for the first time. This is an experimental feature.