Over the air updates for MCUs with Azure Device Update
Published Aug 15 2022 08:00 AM 5,662 Views

Keeping IoT devices up to date is crucial to any IoT solution given the potential for large fleets of devices, their physical location, exposure to security threats, among other factors. All these scenarios can benefit from a centralized way to remotely manage and send software and security updates. That is especially true for the embedded devices category, which may run bare metal solutions or real time operating systems like Azure RTOS or FreeRTOS, and whose location, physical access limitations or fleet sizes make updates more difficult.

Another scenario, often ignored, is the category of embedded devices based on MCUs (microcontrollers) which are not IoT devices per definition, but rather operate offline most of the time and happily support their business need. Even such devices will require, from time to time, a way of applying software (firmware) updates remotely.

To help in all the above scenarios, Microsoft released the ADU (Azure Device Update) library to allow OTA (Over the Air updates) for IoT devices based on microcontrollers using the Azure IoT middleware for FreeRTOS, both service and the device libraries are GA (generally available) and recommended for production scenarios.


OTA with Azure

The following illustration shows the high-level flow of the ADU solution for a device using our middleware for FreeRTOS:


A centralized Azure update service (ADU) manages the storage of manifest and update files. Manifest files contain the update instructions for devices and the update files are normally new firmware versions the devices need to apply.

ADU can trigger an update to a device (or group of devices) matching specific tags, and these devices will be notified via messages from the Azure IoT Hub about the need to update to a different version, and where to get this image from.

The OTA agent on the device validates the update manifest, to ensure its origin and integrity, and downloads the new firmware version from Azure Blob Storage. The progress of remote updates is reported back to the ADU service so that operators can track the progress across the devices’ fleet.

The device can validate the firmware image, install it and reboot, reporting its updated version to the ADU service once back online, completing the update process.


How to get started?

We created samples to help you get started with the ADU service for both the Azure IoT middleware for FreeRTOS and a bare metal version using the Embedded C SDK: 

  • FreeRTOS sample with the ESP32
  • FreeRTOS sample with the STM32L475
  • Bare metal sample with ESP32

Additional development kits from other manufacturers will follow this release, stay tuned for more!


Follow the instructions on the links above to learn how to:

  • Install the latest version of Azure IoT middleware for FreeRTOS with the ADU library
  • Setup the device with specific ADU tags
  • Generate a device update manifest file
  • Create and trigger an update using the ADU service
  • Monitor progress using both the device’s serial port and the ADU service


Azure Device Update service is also available for Azure RTOS and Linux-based devices.


Let us know what you think!

As we continue to work on improving the experience for IoT developers, we encourage you to join this open-source project on GitHub, provide your feedback, file issues, contribute with your own pull requests and stay tuned on Azure Updates for any new Azure IoT SDK announcements.


Azure IoT for C Embedded repo: https://github.com/Azure/azure-sdk-for-c/tree/main/sdk/docs/iot 
Azure IoT middleware for FreeRTOS samples repo: https://github.com/Azure-Samples/iot-middleware-freertos-samples
Azure IoT middleware for FreeRTOS source code: https://github.com/Azure/azure-iot-middleware-freertos

Version history
Last update:
‎Nov 16 2022 08:54 AM
Updated by: