How kiko283/mbed-os-fota-main-application works
This is an Mbed OS cellular firmware-over-the-air (FOTA) application. Its main workflow powers and configures a SARA-R4xx modem, brings up cellular networking, publishes device telemetry over MQTT, checks for a newer firmware version over HTTP, and downloads the image into external SPI flash. It then resets so the separate bootloader can install the staged image. The README documents the external-flash and bootloader roles; sampled excerpts do not show every FOTA helper implementation, so uncertain internal connections are omitted.
Main entry points: main.cpp Application loop · fota_cellular.cpp FOTA coordinator · bootloader.bin Bootloader image · sara_r4xx.cpp SARA-R4xx driver
Components 17
Application control
- Application loop
source/main.cpp - Watchdog thread
source/main.cpp - Tracing setup
include/tracing.h
Cellular connectivity
- SARA-R4xx driver
source/sara_r4xx.cpp - Modem serial link
source/main.cpp - Cellular network
- MQTT telemetry
source/fota_cellular.cpp
Firmware update
- FOTA coordinator
source/fota_cellular.cpp - Version check
source/fota_cellular.cpp - Image download
source/fota_cellular.cpp
Device storage and install
- External SPI flash
- System reset
source/fota_cellular.cpp - Bootloader image
bootloader/bootloader.bin - MCU firmware
Other components
- Device startup
- MQTT broker
- Firmware service
Connections 22
- Device startup → Application loop: starts
- Application loop → Watchdog thread: starts thread
- Application loop → Tracing setup: opens tracing
- Application loop → SARA-R4xx driver: creates
- Application loop → Modem serial link: provides serial
- SARA-R4xx driver → Modem serial link: uses
- Application loop → Cellular network: creates context
- Application loop → FOTA coordinator: runs
- FOTA coordinator → SARA-R4xx driver: powers and configures
- FOTA coordinator → Cellular network: connects
- FOTA coordinator → MQTT telemetry: invokes
- MQTT telemetry → Cellular network: uses TCP
- MQTT telemetry → MQTT broker: publishes telemetry
- FOTA coordinator → Version check: checks update
- Version check → Firmware service: requests version
- FOTA coordinator → Image download: starts download
- Image download → Firmware service: requests image
- Image download → External SPI flash: erases and writes
- FOTA coordinator → System reset: resets on update
- System reset → Bootloader image: boots
- Bootloader image → External SPI flash: reads staged image
- Bootloader image → MCU firmware: installs firmware