Based on our standalone Wi-Fi MCU and Wi-Fi network controller, these four examples show you how to use the OTA application to update the firmware and security content of a Wi-Fi MCU, a Wi-Fi network controller and a general host MCU.
For a device like the ATWINC1500:
For a 32-bit PIC® or other MCU:
For AWS or other certificates:
For devices like the WFI32 Wi-Fi MCU module and PIC32MZ-W1 Wi-Fi SoC:
Having enough memory space available is a key requirement for performing OTA updates. However, because memory adds costs, most systems offer limited memory space. If you would like to enable your application to perform OTA updates, you will need to plan on generally providing memory that offers storage for more than twice the size of the code to be updated. The bootloader or application that will be managing the OTA update will also need adequate memory space.
New code for the OTA update should be filed locally when downloaded. This enables the download to be checked for authenticity and integrity before the actual update is performed. If the download is interrupted or corrupted, the downloaded file should not be used. Only after the download is checked, the bootloader or the application that is managing the OTA update will be able to update the previous software using one of these two methods:
The local memory can be placed in various locations in the system. You might choose to use the host controller’s memory, the wireless network controller’s memory or external Flash or other memory. However, to guarantee higher reliability, using a dual-partition memory on the target itself allows the old and new software versions to coexist in parallel. Instead of overwriting the old version with the new version, this will allow the system to simply update a pointer onto the new code after it is checked for authenticity and integrity. It also makes it easy to roll back to the previous version of the software as a failsafe in case of issues with the new version.
A program needs to be executed to perform any type of OTA update. This program can be a dedicated application running on a host, but in most cases the update is handled by a bootloader. Commonly used with MCUs, a bootloader is the code in charge of loading and executing an application program. Bootloaders can include additional features such as validating the code integrity and authenticity, and in some cases the bootloader can be tasked with performing an OTA application update.
Because not all bootloaders include OTA update capabilities, your system needs to be programmed and customized for your specific requirements. It is important that you define your OTA update use case, program the functionality and verify the target firmware available for this type of functionality. See the Documents tab below for links to some user guides that will help you get started.