Skip to main content
This guide will show you how to perform an over-the-air (OTA) update on a PSoC Edge AI Kit device using Thistle. You can follow along with our video guide as well.

Part 1. Prepare your PSoC Edge AI kit

Part 2. AI Model update using Thistle

Overview of Thistle OTA Update for PSoC Edge Thistle Control Center

Tools Needed for This Tutorial

Hardware

  • One PSoC Edge AI Kit Evaluation board with PSOC™ E84 for Artificial Intelligence
    (the board has multiple sensing capabilities: Voice, Radar, Audio, Movement, etc.)
  • One USB-C cable
  • One desktop/laptop PC running MacOS X, Windows, or Linux for publishing OTA updates, programming the PSoC Edge AI kit, and observing its logs using a terminal application.

Software

Demo Preparation

Connect PC and PSoC Edge AI Kit over USB Port

Connect the USB-C cable to the USB port of the PSoC Edge AI Kit that is further away from the pin header (see picture below). Plug the other end of the USB-Ccable to the PC. Connect PC to PSoC Edge AI Kit

Quick Start

  1. Install the ModusToolbox Programmer
  2. Download our CTUC binary for PSoC Edge
  3. Flash the CTUC binary to your PSoC Edge AI Kit using the ModusToolbox Programmer
  4. Start minicom or your preffered terminal application
  • Press the black Reset button and observe:
Total Flash Size:67108864 bytes
Thistle Update Client for MCUs on the PSoC Edge AI kit
=== This demo CTUC will always flash a new firmware regardless of Release versioning ===
                Current CTUC mode: Enroll (First Run)

=== Thistle Setup ===
Enter your Thistle Device Enrollment Token (max 64 chars): 

Device Enrollment Token

The Device Enrollment Token is unique per project and can be found in your Thistle Control Center (TCC). Create a new project by pressing the +Project button in the top right of TCC: Create a project in TCC Enter your new project and and go into settings (it is the last menu on the left), open the access submenu and press the copy button next to the Device Enrollment Token: Create a project in TCC Go back to the terminal and paste the value of the Device Enrollment Token and press “Enter”. The next prompt is for the Thistle Public Verification Key that is available in the same settings page. Copy the OTA Public Verification Key, then paste it into the terminal.
Enter your Thistle Public Key (max 94 chars): 
Last prompt asks for WiFi settings, so that the PSoC Edge AI Kit can download OTA updates from your TCC project.
=== WiFi Setup ===
Enter WiFi SSID (max 32 chars): wifi6
Enter WiFi Password (max 63 chars): halloween
OTA starts now and you should be able to see an output likes this:
Wi-Fi Connection Manager initialized.
Successfully connected to Wi-Fi network 'wifi6'.
IPv4 address assigned: 192.168.68.107
Enrolling

Connecting to Thistle Control Center ...
Connected to Thistle Control Center
Response Status: 200
Enrolling to Thistle Control Center
Response Status: 200
Found device_token: 64dc12a986f08a...
Thistle Update Client enrolls the device to TCC once and acquires a unique device id
Soon after enrolling, the device will reboot to download the latest project manifest:
...
Checking for a new firmware update

Connecting to Thistle Control Center ...
Connected to Thistle Control Center

Fetching the latest manifest for this project
Response Status: 204

No Releases found for this project - Add at least one Release in your project.
Use the white button to trigger OTA again - Rebooting back to normal operations.
We need to have at least one Release published in our project before continuing further.

OTA Release

Go to your project in TCC and choose the second menu on the right named Releases. In the same place where we had the +Project button, now we have the +Release button. Create a new release by pressing the +Release button in the top right of TCC and you should a similar window: Create a MCU Firmware Release in TCC As shown on the picture above, perform the following three steps:
  1. Select the “Infineon PSoC” from the drop-down menu
  2. Press the “Select Files” button and upload the DEEPCRAFT-AlarmModel.bin (link below)
  3. Press the “Deploy Release” button. That’s it!
This prebuilt Alarm Detection Model is based on the DEEPCRAFT Ready Models for PSoC Edge by Imagimob (an Infineon Technologies company): download

Start OTA Update

Press the white User button on the PSoC Edge AI Kit
Checking for a new firmware update

Connecting to Thistle Control Center ...
Connected to Thistle Control Center

Fetching the latest manifest for this project
...
Manifest is genuine
Inform Thistle Control Center of started event

Downloading the latest release for this device
...
🎉 Congratulations! OTA is now under way
OTA update on PSoC Edge can take up to 5 minutes depending on the size of your AI Model.
Once ready CTUC will perform one final reboot for an extra integrity check of the updated firmware and then start the new application. Here is how this looks:
New Firmware Image (427368 bytes) is stored
Latest release is downloaded
****************** DEEPCRAFT Ready Model: alarm ****************** 

........................
Play an Alarm sound next to the PSoC Edge AI Kit to test the AI Model detection. For example, here is a School Alarm sound from Youtube.

Conclusion

💡 Thistle OTA on PSoC Edge can be ran as many times as you want. Add a new Release to your TCC project with a different AI Model and press the white User button to start OTA. This tutorial shows how to perform an update on the PSoC Edge AI Kit using the C Thistle Update Client (CTUC). This process can be automated to update a fleet of devices. We support different enrollment setups, either based on Trust On First Use (TOFU), or only accepting pre-enrolled devices. Contact us for more information