Quality RTOS & Embedded Software

LIBRARIES
WHAT'S NEW
FreeRTOS SMP:
FreeRTOS security certification:
Embedded World track keynote:
FreeRTOS formal verification:

AWS IoT Over the Air (OTA) Library

Introduction

The Internet of Things (IoT) extends internet connectivity to embedded devices that were traditionally not connected. These devices are capable of being programmed to communicate usable data over the internet, and to be remotely monitored and controlled. With advances in technology, these traditional embedded devices are getting internet capabilities in consumer, industrial, and enterprise space at a fast pace.

IoT devices are typically deployed in large quantities and often in places that are difficult or impractical for a human operator to access. Imagine a scenario where a security vulnerability that can expose data is discovered. In such scenarios, it is important that the affected devices are updated with security fixes quickly and reliably. Without the ability to perform OTA updates, it can also be difficult to update devices that are geographically dispersed. The cost of having these devices updated by a technician will be high, time consuming, and often times impractical. The delay in the time required to update these devices leaves them exposed to security vulnerabilities for a longer period. Recalling these devices for updating will also be costly and may cause significant disruption to consumers due to downtime.

Over the Air (OTA) Updates make it possible to update device firmware without an expensive recall or technician visit. This method adds the following benefits: 

  1. Security  - The ability to quickly respond to security vulnerabilities and software bugs that are discovered after the devices are deployed in field.
  2. Innovation - Products can be updated frequently as new features are developed, thus driving the innovation cycle. The updates can take effect quickly with minimum downtime compared to traditional update methods.
  3. Cost - OTA updates can reduce maintenance costs significantly compared to methods traditionally used to update these devices.
Providing the OTA functionality requires the following design considerations:
  1. Secure Communication - Updates must use encrypted communication channels to prevent the downloads from being tampered with during transit.
  2. Recovery - Updates can fail due to things like intermittent network connectivity or receiving an invalid update. In these scenarios, the device needs to be able to return to a stable state and avoid becoming bricked.
  3. Author Verification - Updates must be verified to be from a trusted source, along with other validations like version checking and compatibility.
AWS IoT Over-the-air (OTA) Update Library

The AWS IoT OTA library enables you to manage the notification of a newly available update, download the update, and perform cryptographic verification of the firmware update. Using the over-the-air (OTA) client library, you can logically separate firmware updates from the application running on your devices. The over-the-air (OTA) client library can share a network connection with the application, saving memory in resource-constrained devices. In addition, the over-the-air (OTA) client library lets you define application-specific logic for testing, committing, or rolling back a firmware update. The library supports different application protocols like Message Queuing Telemetry Transport (MQTT) and Hypertext Transfer Protocol (HTTP) and provides various configuration options you can fine tune depending on network type and conditions. The

The major functions that this library's APIs provide are - 

  1. Register for notifications or poll for new update requests that are available.
  2. Receive, parse and validate the update request.
  3. Download and verify the file according to the information in the update request.
  4. Run a self-test before activating the received update to ensure the functional validity of the update.
  5. Update the status of the device.
This library uses AWS services to manage various cloud related topics such as sending firmware updates, monitoring large numbers of devices across multiple regions, reducing the blast radius of faulty deployments, and verifying the security of updates. This library can be used with any MQTT or HTTP library.

The demos for this library demonstrates complete over-the-air updates using the coreMQTT Library and AWS Services on FreeRTOS.

 

Code Size of AWS IoT OTA (example generated with GCC for ARM Cortex-M)
FileWith -O1 OptimizationWith -Os Optimization
ota.c8.0K7.1K
ota_interface.c0.1K0.1K
ota_base64.c0.6K0.6K
ota_mqtt.c2.2K2.1K
ota_cbor.c0.8K0.6K
ota_http.c0.3K0.3K
Total estimates12.0K10.8K
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.