Bootloader Cloud Connector
Bootloader Cloud Overview
A bootloader cloud connector is an enhancement to a standard bootloader that allows it to interact with a cloud platform. It enables seamless communication between embedded devices and the cloud to support Over-The-Air (OTA) updates, remote diagnostics, and secure provisioning.
Application Interface
The below table captures the functions that are to be called from the application layer.
Function |
Description |
---|---|
rs_bl_cloud_init |
To initializes the cloud-based services for the bootloader. |
rs_bl_cellular_file_download_process |
To processes the file download over a cellular network for the bootloader. |
rs_bl_mqtt_post_fmw_status |
To posts the firmware status to an MQTT broker. |
rs_bl_cloud_deinit |
To deinitializes the cloud-based services for the bootloader |
Error Code
Every API’s for the bootloader cloud connector returns some success or failure values. Please refer below section,
Implementation Guide
This section explains how to implement the bootloader using the RAPIDSEA stack, the steps to be followed are
Initialize the bootloader cloud connector information.
Processes the file download over a cellular network for the bootloader
Posts the firmware status to an MQTT broker.
Then deinitialize the bootloader cloud connector.
Bootloader cloud connector Header Details
Documentation from the relevant header as follows:
Bootloader Specific APIs.
Defines macros and functions specific to Bootloader functionality
- Author
Embien RAPIDSEA Team
- Copyright
Embien Technologies India Pvt. Ltd.
Defines
-
RS_BL_DOWNLOAD_INITIATE_STATE
Firmware download initiated state.
-
RS_BL_WAIT_FOR_DOWNLOAD_COMPLETE_STATE
Firmware downloading state.
-
RS_BL_MQTT_TOPIC_LEN
MQTT topic length.
-
RS_BL_MQTT_PAYLOAD_LEN
MQTT topic payload.
Functions
-
rs_ret_val_t rs_bl_cloud_init(rs_bl_instance_t *ptr_bl_instance, rs_bl_download_info_t *ptr_download_info)
Initializes the cloud-based services for the bootloader.
This function initializes the necessary cloud-related components for the bootloader operation, including setting up communication with the cloud and preparing for downloading firmware or other updates.
- Parameters:
ptr_bl_instance – [in] - Pointer to the bootloader instance structure.
ptr_download_info – [in] - Pointer to the download information structure.
- Returns:
0 on success or error code on failure
-
rs_ret_val_t rs_bl_cloud_deinit()
Uninitialized the cloud-based services for the bootloader.
This function cleans up and shuts down any cloud-related services or connections established during the initialization process.
- Returns:
0 on success or error code on failure
-
rs_ret_val_t rs_bl_cellular_file_download_process(rs_bl_instance_t *ptr_bl_instance)
Processes the file download over a cellular network for the bootloader.
This function is responsible for managing the file download process via cellular connection.
- Parameters:
ptr_bl_instance – [in] - Pointer to the bootloader instance structure.
- Returns:
0 on success or error code on failure
-
rs_ret_val_t rs_bl_mqtt_post_fmw_status(uint32_t u32_mqtt_handle, rs_bl_instance_t *ptr_bl_instance, uint8_t u8_firmware_state)
Posts the firmware status to an MQTT broker.
This function sends the current firmware status (e.g., update progress,success,or failure) to an MQTT broker.
- Parameters:
u32_mqtt_handle – [in] - The handle for the active MQTT connection.
ptr_bl_instance – [in] - Pointer to the bootloader instance structure.
u8_firmware_state – [in] - Current firmware state
- Returns:
0 on success or error code on failure