Program the device firmware and provision the credentials

Note

Provisioning the certificates and programming the firmware through CLI are not currently supported on WSL 2 since it lacks support for serial devices. For more information, see the issue on WSL 2. Instead, use nRF Connect for Desktop to provision your certificates and then program the firmware.

First, make sure you have Segger JLink installed in your path.

To provision the device certificates using the CLI, run the following command:

 node cli flash "imei" -f /path/to/firmware.hex
 # default secTag is 42
 # default board is the Thingy:91, use --dk to program a DK
 # when programming a Thingy:91, most likely you need to override the default port: -p /dev/ttyACM2
 # pass --help to see the additional options, for example, option that enables the use of a different secTag

Provisioning of the certificate using CLI also results in the following actions:

  • Programming of the AT Client sample onto the device.

  • Provisioning of the created device credentials for the respective cloud flavour AWS, or Azure.

  • Programming of the configured and built firmware to the device.

After the programming of the firmware, the device reboots and connects to the AWS broker, and eventually reports its state to the cloud:

[00:00:35.591,644] <inf> event_manager: CLOUD_EVT_CONNECTED