![]() |
RAFW Flexible Software Package Documentation
Release v2.0.1
|
|
Interface for the OTA Functionality.
The OTA interface provides the ability to read, write, erase, and blank check the FW versions and data regions.
Data Structures | |
| struct | rm_ota_w_update_proc_t |
| struct | rm_ota_w_image_header_data_t |
| struct | ota_regions_t |
| struct | ota_info_t |
| struct | ota_callback_args_t |
| struct | ota_cfg_t |
| struct | ota_api_t |
| struct | ota_instance_t |
Typedefs | |
| typedef void | ota_ctrl_t |
Enumerations | |
| enum | rm_ota_w_update_type_t |
| enum | ota_event_t |
| struct rm_ota_w_update_proc_t |
Settings structure used for ota update requests
Data Fields | |
| rm_ota_w_update_type_t | update_type |
| FW type being downloaded. | |
| char | update_cache [RM_OTA_W_CACHE_LEN] |
| Cache data from last update. | |
| uint32_t | auto_swap |
| If the value is true, if the new firmware download is successful, it will reboot with the new firmware. Only for RTOS. | |
| uint32_t | download_sflash_addr |
| Flash address where the downloaded FW is written. | |
| void(* | download_notify )(rm_ota_w_update_type_t update_type, uint32_t ret_status, uint32_t progress) |
| Callback function pointer to check the download status. | |
| void(* | swap_notify )(uint32_t ret_status) |
| Callback function pointer to check the swap state. Only for RTOS. | |
| uint32_t | update_state |
| Status of the download process (not_ready, ready, progress, finish, stop). | |
| uint32_t | status |
| Download status. (success or failed) | |
| uint32_t | progress_rtos |
| RTOS download progress. | |
| uint32_t | progress_mcu_fw |
| MCU FW download progress. | |
| uint32_t | progress_cert_key |
| CERT_KEY download progress. | |
| struct rm_ota_w_image_header_data_t |
Image header data for updates
| struct ota_regions_t |
| struct ota_info_t |
Information about the ota blocks
| Data Fields | ||
|---|---|---|
| ota_regions_t | code_ota | Information about the code ota regions. |
| ota_regions_t | data_ota | Information about the code ota regions. |
| struct ota_callback_args_t |
Callback function parameter data
| Data Fields | ||
|---|---|---|
| ota_event_t | event | Event can be used to identify what caused the callback (ota ready or error). |
| void const * | p_context | Placeholder for user data. Set in ota_api_t::open function in::ota_cfg_t. |
| struct ota_cfg_t |
OTA Configuration
Data Fields | |
| bool | data_ota_bgo |
| True if BGO (Background Operation) is enabled for Data OTA. | |
| void(* | p_callback )(ota_callback_args_t *p_args) |
| Callback provided when a OTA interrupt ISR occurs. | |
| void const * | p_extend |
| OTA hardware dependent configuration. | |
| void const * | p_context |
| Placeholder for user data. Passed to user callback in ota_callback_args_t. | |
| uint8_t | ipl |
| OTA ready interrupt priority. | |
| IRQn_Type | irq |
| OTA ready interrupt number. | |
| uint8_t | err_ipl |
| OTA error interrupt priority. | |
| IRQn_Type | err_irq |
| OTA error interrupt number. | |
| struct ota_api_t |
Shared Interface definition for OTA
Data Fields | |
| fsp_err_t(* | open )(ota_ctrl_t *const p_ctrl, ota_cfg_t const *const p_cfg) |
| fsp_err_t(* | swap )(ota_ctrl_t *const p_ctrl) |
| fsp_err_t(* | getImageInfo )(ota_ctrl_t *const p_ctrl, rm_ota_w_update_type_t update_type, uint32_t sector_addr, rm_ota_w_image_header_data_t *info_image) |
| fsp_err_t(* | bootIdxSet )(ota_ctrl_t *const p_ctrl, uint8_t boot_idx) |
| fsp_err_t(* | bootIdxGet )(ota_ctrl_t *const p_ctrl, uint8_t *boot_idx) |
| fsp_err_t(* | getAddr )(ota_ctrl_t *const p_ctrl, uint8_t state, rm_ota_w_update_type_t update_type, uint32_t *addr) |
| fsp_err_t(* | setAddr )(ota_ctrl_t *const p_ctrl, uint8_t key_type, uint32_t key_val) |
| fsp_err_t(* | cert )(ota_ctrl_t *const p_ctrl, uint8_t cert_type, uint32_t sector_addr) |
| fsp_err_t(* | close )(ota_ctrl_t *const p_ctrl) |
| fsp_err_t(* ota_api_t::open) (ota_ctrl_t *const p_ctrl, ota_cfg_t const *const p_cfg) |
Open OTA device.
| [in] | p_ctrl | Pointer to OTA device control. Must be declared by user. Value set here. |
| [in] | ota_cfg_t | Pointer to OTA configuration structure. All elements of this structure must be set by the user. |
| fsp_err_t(* ota_api_t::swap) (ota_ctrl_t *const p_ctrl) |
Swap is the process for swapping programs after 2nd download program is valid. When the program data is successfully applied, the new program data will be executed after reboot. The swap process will trigger the reset if version check is pass.
| [in] | p_ctrl | Pointer to OTA device control. |
| fsp_err_t(* ota_api_t::getImageInfo) (ota_ctrl_t *const p_ctrl, rm_ota_w_update_type_t update_type, uint32_t sector_addr, rm_ota_w_image_header_data_t *info_image) |
Get program image in a specific location
| [in] | p_ctrl | Pointer to OTA device control. |
| [in] | update_type | Specifies the update type id for info request. |
| [in] | sector_addr | Sector address for version header info. |
| [out] | info_image | Parsed data of the image information. |
| fsp_err_t(* ota_api_t::bootIdxSet) (ota_ctrl_t *const p_ctrl, uint8_t boot_idx) |
Set the image index.
| [in] | p_ctrl | Pointer to OTA device control. |
| [in] | boot_idx | Boot index to be set. |
| fsp_err_t(* ota_api_t::bootIdxGet) (ota_ctrl_t *const p_ctrl, uint8_t *boot_idx) |
Get Current image index which is set
| [in] | p_ctrl | Pointer to OTA device control. |
| [in] | boot_idx | Boot index to get. |
| fsp_err_t(* ota_api_t::getAddr) (ota_ctrl_t *const p_ctrl, uint8_t state, rm_ota_w_update_type_t update_type, uint32_t *addr) |
Load key data value from device
| [in] | p_ctrl | Pointer to OTA device control. |
| [in] | state | Specifies which program data, current or other. |
| [in] | update_type | Specifies the update type id for info request. |
| [out] | addr | Pointer for the version address |
| fsp_err_t(* ota_api_t::setAddr) (ota_ctrl_t *const p_ctrl, uint8_t key_type, uint32_t key_val) |
Set Address value for user device
| [in] | p_ctrl | Pointer to OTA device control. |
| [in] | update_type | Specifies which program data, current or other. |
| [in] | addr | New address value |
| fsp_err_t(* ota_api_t::cert) (ota_ctrl_t *const p_ctrl, uint8_t cert_type, uint32_t sector_addr) |
Data validation of image data
| [in] | p_ctrl | Pointer to OTA device control. |
| [in] | cert_type | Type of the validation data. |
| [in] | sector_addr | Address for sector data. |
| fsp_err_t(* ota_api_t::close) (ota_ctrl_t *const p_ctrl) |
Close FLASH device.
| [in] | p_ctrl | Pointer to FLASH device control. |
| struct ota_instance_t |
This structure encompasses everything that is needed to use an instance of this interface.
| Data Fields | ||
|---|---|---|
| ota_ctrl_t * | p_ctrl | Pointer to the control structure for this instance. |
| ota_cfg_t const * | p_cfg | Pointer to the configuration structure for this instance. |
| ota_api_t const * | p_api | Pointer to the API structure for this instance. |
| typedef void ota_ctrl_t |
OTA control block. Allocate an instance specific control block to pass into the OTA API calls.
| enum ota_event_t |
Event types returned by the ISR callback when used in Data OTA BGO mode