FOTA coordination

Serial Modem Host Applications

tags
Serial Modem Host Applications

Because a firmware download and the reboot that follows must not be interrupted by the application, the module tracks the download separately from the cloud state:

  • FOTA_STARTING moves the state machine to STATE_FOTA from anywhere under STATE_RUNNING, which stops the periodic synchronization.
  • The cloud state at that point is remembered in cloud_history. A CLOUD_DISCONNECTED or CLOUD_CONNECTED message received during the download updates cloud_history without leaving STATE_FOTA.
  • FOTA_ABORTED restores the remembered cloud state, so the application resumes synchronizing if the connection is still up.
  • FOTA_REBOOT_REQUEST moves the state machine to STATE_REBOOTING, which reboots the device to let MCUboot swap in the new image.