FOTA module

Asset Tracker Template

tags
Asset Tracker Template

The FOTA (Firmware Over-The-Air) module manages remote firmware updates for both application and modem firmware. It handles all the stages of the update process:

  • Polling nRF Cloud for available updates.
  • Downloading firmware images.
  • Applying updates.

The update process begins when the module receives a FOTA_POLL_REQUEST message, typically triggered by the main application module. When an update is available, the module automatically initiates the download without requiring additional commands.

The module supports three firmware image types:

  • Application: Updates the main application firmware.
  • Delta Modem: Incremental modem firmware updates for minor version changes.
  • Full Modem: Complete modem firmware replacements.

Once a download has started, the module publishes FOTA_STARTING so the application can move into its FOTA state. Application and delta modem images are marked ready after the download completes; full modem images require an additional apply step that can only run while the modem is offline.

When the module needs the network to be disconnected (for example, to apply a full modem image or to release modem resources before reboot), it publishes FOTA_NETWORK_DISCONNECT_NEEDED. The application must then:

  1. Disconnect from the cellular network.
  2. Reply with FOTA_NETWORK_DISCONNECTED once the network is down.

The FOTA module then continues the sequence and, when the device is ready to reboot with the new image staged, publishes FOTA_REQUEST_REBOOT. If the update cannot complete (download failure, timeout, cancellation, rejection, or no update available), the module publishes FOTA_ABORTED and the application can resume normal operation.