Edge Impulse enables developers to create the next generation of intelligent device solutions with embedded Machine Learning. This repository contains the Edge Impulse firmware for the Nordic Semiconductor Thingy:53 development board that includes a subset of the available sensors, for all of the currently supported sensors see src/sensors. This firmware supports all Edge Impulse features, including ingestion, remote management, and inferencing. Direct communication with the device is performed over a mobile application, but the user can execute all functions via AT command over a USB interface. By including specific build configuration this firmware can be enabled to run with Nordic compatible WiFi external board nRF7002eb.
-
Install the nRF Connect SDK in a separate folder from this repository (e.g.
~/repos/ncs
). -
Clone this repository:
$ git clone https://github.com/edgeimpulse/firmware-nordic-thingy53
-
Build the application:
# Thingy:53 build command $ west build -b thingy53_nrf5340_cpuapp # Thingy:53 with nRF7002eb (WiFi) builf command $ west build -b thingy53_nrf5340_cpuapp -- -DSHIELD=nrf7002eb
-
Clone this repository:
$ git clone https://github.com/edgeimpulse/firmware-nordic-thingy53
-
Build the Docker container:
$ docker build -t edge-impulse-nordic .
-
Build the application:
# Thingy:53 build command $ docker run --rm -v $PWD:/app edge-impulse-nordic west build -b thingy53_nrf5340_cpuapp # Thingy:53 with nRF7002eb (WiFi) builf command $ docker run --rm -v $PWD:/app edge-impulse-nordic west build -b thingy53_nrf5340_cpuapp -- -DSHIELD=nrf7002eb
-
Connect the JLink to the Thingy:53 as described in this guide; if not previously done, erase the chip with:
$ nrfjprog --recover
-
Flash the chip, both application core and networking core, with the command:
$ west flash
-
Connect USB-C to the Thingy:53. Open the enclosure, press the small button (
SW2
) on top of the device and turn the power switch on. -
After the device is on, release the button. The device is now in bootloader mode. For flashing the new firmware, use commands:
mcumgr -t 60 --conntype serial --connstring=/dev/ttyACM0 image list mcumgr -t 60 --conntype serial --connstring=/dev/ttyACM0 image upload app_update.bin
Follow the steps from this guide. Instead of precompiled firmware, use the file build/zephyr/app_signed.hex
.
Use nRF Connect for Android or nRF Connect for iOS and build/zephyr/dfu_application.zip
. After connecting to the device, click on the DFU icon and select the file. When the DFU process is done, the device will boot with the new image.
-
Install mcumgr
-
Upload the firmware (adjust the path to
app_update.bin
andhci
interface number if you have a few of them)mcumgr --conntype ble --hci 0 --connstring peer_name='EdgeImpulse' image upload app_update.bin
-
Check if the firmware has been uploaded correctly and get the hash of new firmware
mcumgr --conntype ble --hci 0 --connstring peer_name='EdgeImpulse' image list
The output should be similar to the one below; the new image is in slot 1.
Images: image=0 slot=0 version: 0.9.9 bootable: true flags: active confirmed hash: 67f6f87f3f639217140f9e8073cb28f214499d7f646cb774276496108326a7ba image=0 slot=1 version: 0.9.1 bootable: true flags: hash: c218220606d3ecef26dc46ffd7c112e700d08837335516c40ae12f6a86aa7ab2 Split status: N/A (0)
-
Test the image and swap the images
mcumgr --conntype ble --hci 0 --connstring peer_name='EdgeImpulse' image test <HASH_OF_THE_IMAGE>
-
Reset the device (may take up to 10-20 seconds)
mcumgr --conntype ble --hci 0 --connstring peer_name='EdgeImpulse' reset