Building and programming with Thingy:91
You can also program the Thingy:91 with the images obtained by building the code in an nRF Connect SDK environment.
To set up your system to be able to build a compatible firmware image, follow the processes described in the Building an application section. The build targets of interest for Thingy:91 in nRF Connect SDK are as follows:
Component |
Build target |
|---|---|
nRF9160 SiP |
|
nRF52840 SoC |
|
You must use the build target thingy91/nrf9160/ns when building the application code for the nRF9160 SiP and the build target thingy91/nrf52840 when building the application code for the onboard nRF52840 SoC.
Note
In nRF Connect SDK releases before v1.3.0, these build targets were named
nrf9160_pca20035,nrf9160_pca20035ns, andnrf52840_pca20035.In nRF Connect SDK releases ranging from v1.3.0 to v1.6.1, the build target
thingy91/nrf9160/nswas namedthingy91_nrf9160/ns.
LTE/GNSS features can only be used with Cortex-M Security Extensions enabled (_ns build target).
The following table shows the different types of build files that are generated and the different scenarios in which they are used:
File |
File format |
Programming scenario |
|---|---|---|
|
Full image, HEX format |
Using an external debug probe and the Programmer app. |
|
MCUboot compatible image, HEX format |
Using the built-in bootloader and the Programmer app. |
|
MCUboot compatible image, binary format |
|
For an overview of different types of build files in the nRF Connect SDK, see Output build files (image files).
There are multiple methods of programming a sample or application onto a Thingy:91. It is recommended to use an external debug probe to program the Thingy:91.
Note
If you do not have an external debug probe available to program the Thingy:91, you can directly program by using the USB (MCUboot) method and the Programmer app.
In this scenario, use the app_signed.hex firmware image file.
Note
While building applications for Thingy:91, the build system changes the signing algorithm of MCUboot so that it uses the default RSA keys. This is to ensure backward compatibility with the MCUboot versions that precede the nRF Connect SDK v1.4.0. Use the default RSA keys only for development. In a final product, you must use your own secret keys. See Using development keys for more information.
Programming onto Thingy:91
Complete the following steps to program firmware onto Thingy:91:
Set the Thingy:91 SWD selection switch (SW2) to nRF91 or nRF52 depending on whether you want to program the nRF9160 SiP or the nRF52840 SoC component.
Connect the Thingy:91 to the debug out port on a 10-pin external debug probe, for example, nRF9160 DK, using a 10-pin JTAG cable.
Note
If you are using nRF9160 DK as the debug probe, make sure that VDD_IO (SW11) is set to 1.8 V.
Connect the external debug probe to the PC using a USB cable.
Make sure that the Thingy:91 and the external debug probe are powered on.
In nRF Connect for VS Code, click the Flash option in the Actions View.
If you have multiple boards connected, you are prompted to pick a device at the top of the screen.
A small notification banner appears in the bottom-right corner of Visual Studio Code to display the progress and confirm when the flash is complete.
Start the toolchain environment in a terminal window.
Program the sample or application to the device using the following command:
west flash
The device resets and runs the programmed sample or application.