The firmware over-the-air (FOTA) 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, which the Main module usually triggers. When an update is available, the module initiates the download automatically, without additional commands.
The module supports the following firmware image types:
- Application: Updates the 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. The module marks application and delta modem images ready after the download completes. Full modem images need 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 complete the following steps:
- Disconnect from the cellular network.
- Reply with
FOTA_NETWORK_DISCONNECTEDonce 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, the module publishes FOTA_ABORTED and the application can resume normal operation. The update does not complete when the download fails, times out, is canceled, or is rejected, or when no update is available.