I’m attempting to get the OTA demo working on the ESP32, but if I uncomment out the vStartOTAUpdateDemoTask in AWS_Demo_Runner.c, the application doesn’t link. It appears that none of the OTA code in /lib/ota or in /demos/common/ota is getting compiled.
This is my output when I attempt to build the project:
CC build/amazon-freertos-common/demos/common/demo_runner/aws_demo_runner.o
AR build/amazon-freertos-common/libamazon-freertos-common.a
LD build/aws_demos.elf
/home/henrymcdonald/controller-0-10v/demos/espressif/esp32_devkitc_esp_wrover_kit/make/build/amazon-freertos-common/libamazon-freertos-common.a(aws_demo_runner.o):(.literal.DEMO_RUNNER_RunDemos+0x0): undefined reference to `vStartOTAUpdateDemoTask'
/home/henrymcdonald/controller-0-10v/demos/espressif/esp32_devkitc_esp_wrover_kit/make/build/amazon-freertos-common/libamazon-freertos-common.a(aws_demo_runner.o): In function `DEMO_RUNNER_RunDemos':
/home/henrymcdonald/controller-0-10v/demos/common/demo_runner/aws_demo_runner.c:58: undefined reference to `vStartOTAUpdateDemoTask'
collect2: error: ld returned 1 exit status
/home/henrymcdonald/controller-0-10v/demos/espressif/esp32_devkitc_esp_wrover_kit/make/../../../../lib/third_party/mcu_vendor/espressif/esp-idf/make/project.mk:393: recipe for target '/home/henrymcdonald/controller-0-10v/demos/espressif/esp32_devkitc_esp_wrover_kit/make/build/aws_demos.elf' failed
make: *** [/home/henrymcdonald/controller-0-10v/demos/espressif/esp32_devkitc_esp_wrover_kit/make/build/aws_demos.elf] Error 1
vStartOTAUpdateDemoTask is defined in {project root}/demos/common/ota/aws_ota_update_demo.c
I think that this may be a Makefile issue, but I’m perplexed so far at how the Makefile decides what .c files to include in the compilation. I’ll keep digging into that while I hope to receive a response here with some help.
Thanks for the interest on OTA update for ESP32. However, OTA update is currently not supported on ESP32. We did not include OTA demo in the aws_demo project for ESP32.
I’m also looking to use an ESP32 with FreeRTOS. Is there an available roadmap that shows if support is expected to come in the future?
esp-idf includes an OTA update example. As this is my first time ever considering using FreeRTOS (or any RTOS on an embedded system), I’m not sure how difficult it is to get external code working on the system. Do you, or anyone else that is reading this, have any insight? How difficult can I expect it to be to get this OTA example working?
In general, we plan to continue to work with our semiconductor partners to support (AWS IoT) OTA with Amazon FreeRTOS. Prioritization of those efforts is based largely on customer feedback such as this.
(If you are asking what portions of the ESP-IDF implementation of OTA are reusable in a port of Amazon FreeRTOS OTA then, at a broad level, I would first point out that the former downloads the new firmware image over HTTP, while the latter uses MQTT over mutually-authenticated TLS. But note that the existing ESP32 port of Amazon FreeRTOS in https://github.com/aws/amazon-freertos/blob/master/demos/espressif/esp32_devkitc_esp_wrover_kit/common/application_code/main.c already includes the necessary MQTT and network transport plumbing. The reusable logic from the ESP-IDF OTA example will be in how and where the new image is stored on the device, and how the app triggers a device reset once the new image has been validated.)
If you are looking to port the Amazon FreeRTOS OTA library to ESP32, that effort will mainly consist of implementing our OTA “Platform Abstraction Layer” (PAL). Here are some documentation links to get you started:
An OTA update is initiated from a job created in AWS IoT (either via console or API; the “-workflow” link above describes both). The Amazon FreeRTOS OTA cloud service uses AWS IoT Device Management to create those jobs. General information about Device Management jobs can be found in https://docs.aws.amazon.com/iot/latest/developerguide/iot-jobs.html.
I am also working with ESP32 and just found out that OTA is not yet supported with Amazon FreeRTOS. Is the work going on and when can we expect OTA functionality for this hardware?