![]() |
RAFW Flexible Software Package Documentation
Release v2.0.1
|
|
Functions | |
| fsp_err_t | RM_OTA_W_Open (ota_ctrl_t *const p_api_ctrl, ota_cfg_t const *const p_cfg) |
| fsp_err_t | RM_OTA_W_Close (ota_ctrl_t *const p_api_ctrl) |
| fsp_err_t | RM_OTA_W_Swap (ota_ctrl_t *const p_api_ctrl) |
| fsp_err_t | RM_OTA_W_GetImageInfo (ota_ctrl_t *const p_api_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 | RM_OTA_W_BootIdxSet (ota_ctrl_t *const p_api_ctrl, uint8_t boot_idx) |
| fsp_err_t | RM_OTA_W_BootIdxGet (ota_ctrl_t *const p_api_ctrl, uint8_t *boot_idx) |
| fsp_err_t | RM_OTA_W_GetAddr (ota_ctrl_t *const p_api_ctrl, uint8_t state, rm_ota_w_update_type_t update_type, uint32_t *addr) |
| fsp_err_t | RM_OTA_W_SetAddr (ota_ctrl_t *const p_api_ctrl, uint8_t update_type, uint32_t addr) |
| fsp_err_t | RM_OTA_W_Cert (ota_ctrl_t *const p_api_ctrl, uint8_t cert_type, uint32_t sector_addr) |
Data Structures | |
| struct | rm_ota_w_update_sflash_t |
| Struct for flash writing. More... | |
| struct | rm_ota_w_update_download_t |
| Structure to download firmware. More... | |
| struct | rm_ota_w_instance_ctrl_t |
Macros | |
| #define | RM_OTA_W_OPEN |
| #define | RM_OTA_W_NVRAM_DW_PROGRESS |
| NVRAM name of Download progress. | |
| #define | RM_OTA_W_SUCCESS |
| Return success. | |
| #define | RM_OTA_W_FAILED |
| Return failed. | |
| #define | RM_OTA_W_ERROR_SFLASH_ADDR |
| SFLASH address is wrong. | |
| #define | RM_OTA_W_ERROR_TYPE |
| FW type is unknown. | |
| #define | RM_OTA_W_ERROR_URL |
| Server URL is unknown. | |
| #define | RM_OTA_W_ERROR_SIZE |
| FW size is wrong or offset address to be downloaded is wrong. | |
| #define | RM_OTA_W_ERROR_CRC |
| CRC is not correct. | |
| #define | RM_OTA_W_VERSION_UNKNOWN |
| FW version is unknown. | |
| #define | RM_OTA_W_VERSION_INCOMPATI |
| FW version is incompatible. | |
| #define | RM_OTA_W_NOT_FOUND |
| FW not found on the server. | |
| #define | RM_OTA_W_NOT_CONNECTED |
| Failed to connect to server. | |
| #define | RM_OTA_W_NOT_ALL_DOWNLOAD |
| All new FWs have not been downloaded. | |
| #define | RM_OTA_W_MEM_ALLOC_FAILED |
| Failed to alloc memory. | |
| #define | RM_OTA_W_BLE_VERSION_UNKNOWN |
| BLE FW version is unknown. | |
| #define | IMAGE_HEADER_MAGIC_CODE |
| Image MAGIC CODE. | |
| #define | IMAGE_HEADER_NAME_LEN |
| Image Name Length. | |
| #define | RM_OTA_W_STATE_NOT_READY |
| Process is not ready. | |
| #define | RM_OTA_W_STATE_READY |
| Process is ready. | |
| #define | RM_OTA_W_STATE_PROGRESS |
| Process is ongoing. | |
| #define | RM_OTA_W_STATE_FINISH |
| Process completed. | |
| #define | RM_OTA_W_STATE_STOP |
| Process stopped. | |
| #define | RM_OTA_W_VER_START_OFFSET |
| address 0x02008 ~ 0x02063 | |
| #define | RM_OTA_W_FW_MAGIC_NUM |
| IMAGE_HEADER_MAGIC_CODE 0x36314144. | |
| #define | RM_OTA_W_UPDATE_TYPE_MAX |
| Firmware version structure. | |
| #define | RM_OTA_W_MCU_FW_NAME_LEN |
| MCU Firmware version structure. | |
Enumerations | |
| enum | rm_ota_w_version_flags_t |
| Status for version check. More... | |
| enum | rm_ota_w_refuse_type_t |
| enum | rm_ota_w_state_t |
| enum | rm_ota_w_bgo_operation_t |
| struct rm_ota_w_update_sflash_t |
| struct rm_ota_w_update_download_t |
Structure to download firmware.
| Data Fields | ||
|---|---|---|
| rm_ota_w_update_type_t | update_type | Update type. |
| rm_ota_w_update_sflash_t | write | Write struct field. |
| UINT | download_status | Status of the downloading operation. |
| UINT | version_check | Version check information. |
| UINT | content_length | The size of the download image in bytes. |
| UINT | received_length | Updated data which was received in the current process. |
| struct rm_ota_w_instance_ctrl_t |
Ota b instance control block. DO NOT INITIALIZE.
Data Fields | |
| uint32_t | opened |
| To check whether api has been opened or not. | |
| uint32_t | source_start_offset |
| Offset for continous download update. | |
| rm_ota_w_bgo_operation_t | current_operation |
| Operation in progress, for example, FLASH_OPERATION_CF_ERASE. | |
| rm_ota_w_update_type_t | ota_update_type |
| Update type. | |
| uint8_t | update_cache [RM_OTA_W_CACHE_LEN] |
| Server address where firmware exists. | |
| 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. | |
| uint8_t | ota_auto_swap |
| If true, reboot after FW download process is successfully (Only for RTOS) | |
| uint32_t | download_sflash_addr |
| Address of SFLASH 2nd FW is stored. (Only for MCU_FW and CERT_KEY) | |
| uint8_t | update_state |
| Download status. (success or failed) | |
| uint8_t | status |
| Status of the download process (not_ready, ready, progress, finish, stop). | |
| uint8_t | progress_rtos |
| RTOS download progress. | |
| uint8_t | progress_mcu_fw |
| MCU FW download progress. | |
| uint8_t | progress_cert_key |
| CERT_KEY download progress. | |
| uint8_t | progress_ble |
| BLE download progress. | |
| uint32_t | ota_custom_address |
| Set the address for custom data for fw_mcu and cert keys. | |
| char | mcu_fw_name [RM_OTA_W_MCU_FW_NAME_LEN] |
| Set MCU FW name. | |
| void(* | p_callback )(ota_callback_args_t *) |
| Pointer to callback. | |
| ota_callback_args_t * | p_callback_memory |
| Pointer to optional callback argument memory. | |
| void const * | p_context |
| Pointer to context to be passed into callback function. | |
| #define RM_OTA_W_OPEN |
"OPEN" in ASCII, used to avoid multiple open.
Status for version check.
| enum rm_ota_w_state_t |
Possible Flash operation states
| fsp_err_t RM_OTA_W_Open | ( | ota_ctrl_t *const | p_api_ctrl, |
| ota_cfg_t const *const | p_cfg | ||
| ) |
Initializes the high performance OTA peripheral. Implements ota_api_t::open.
The Open function initializes the ota.
Example:
| FSP_SUCCESS | Initialization was successful and timer has started. |
| FSP_ERR_ALREADY_OPEN | The OTA control block is already open. |
| FSP_ERR_ASSERTION | NULL provided for p_ctrl or p_cfg. |
| FSP_ERR_IRQ_BSP_DISABLED | Caller is requesting BGO but the OTA interrupts are not enabled. |
| FSP_ERR_FCLK | FCLK must be a minimum of 4 MHz for OTA operations. |
| fsp_err_t RM_OTA_W_Close | ( | ota_ctrl_t *const | p_api_ctrl | ) |
Releases any resources that were allocated by the Open() or any subsequent OTA operations.
Implements ota_api_t::close.
| FSP_SUCCESS | Successfully close. |
| FSP_ERR_NOT_OPEN | The control block is not open. |
| FSP_ERR_ASSERTION | NULL provided for p_ctrl or p_cfg. |
| fsp_err_t RM_OTA_W_Swap | ( | ota_ctrl_t *const | p_api_ctrl | ) |
Trigger versions swap. Swap the programs located at address 0x00002000 and address 0x00400000. Before version swap is done, there will be version check and boot index toggle.
Implements ota_api_t::swap.
| FSP_SUCCESS | Version swap finished successfully. |
| FSP_ERR_ASSERTION | NULL provided for p_ctrl. |
| FSP_ERR_IN_USE | OTA process is in progress, we need to wait for last process to finished. |
| fsp_err_t RM_OTA_W_GetImageInfo | ( | ota_ctrl_t *const | p_api_ctrl, |
| rm_ota_w_update_type_t | update_type, | ||
| uint32_t | sector_addr, | ||
| rm_ota_w_image_header_data_t * | info_image | ||
| ) |
Returns the information about the image installed in a specific address.
Implements ota_api_t::getImageInfo.
| FSP_SUCCESS | Callback updated successfully. |
| FSP_ERR_INVALID_ADDRESS | Invalid image address was input. |
| fsp_err_t RM_OTA_W_BootIdxSet | ( | ota_ctrl_t *const | p_api_ctrl, |
| uint8_t | boot_idx | ||
| ) |
Updates the boot index value.
Implements ota_api_t::bootIdxSet.
| FSP_SUCCESS | Successfully set the request data. |
| FSP_ERR_INVALID_ADDRESS | Invalid boot index value |
| fsp_err_t RM_OTA_W_BootIdxGet | ( | ota_ctrl_t *const | p_api_ctrl, |
| uint8_t * | boot_idx | ||
| ) |
Query the current boot index.
Note: This function may also update/synchronize the boot index before returning it.
Implements ota_api_t::bootIdxGet.
| FSP_SUCCESS | Successfully retrieved the request information. |
| fsp_err_t RM_OTA_W_GetAddr | ( | ota_ctrl_t *const | p_api_ctrl, |
| uint8_t | state, | ||
| rm_ota_w_update_type_t | update_type, | ||
| uint32_t * | addr | ||
| ) |
Query the address information regarding the current version address and swap version address.
Implements ota_api_t::getAddr.
| FSP_SUCCESS | Successfully retrieved the request information. |
| FSP_ERR_INVALID_ADDRESS | Invalid state address value |
| fsp_err_t RM_OTA_W_SetAddr | ( | ota_ctrl_t *const | p_api_ctrl, |
| uint8_t | update_type, | ||
| uint32_t | addr | ||
| ) |
Set Address value for user device.
Implements ota_api_t::setAddr.
| FSP_SUCCESS | Key variable was changed successfully. |
| FSP_ERR_INVALID_ADDRESS | Invalid data flash address was input. |
| FSP_ERR_INVALID_DATA | Invalid key type or unknown data source. |
| fsp_err_t RM_OTA_W_Cert | ( | ota_ctrl_t *const | p_api_ctrl, |
| uint8_t | cert_type, | ||
| uint32_t | sector_addr | ||
| ) |
Performs a certification check over the program data, base program or downloaded data based on a specified address area.
Implements ota_api_t::cert.
| FSP_SUCCESS | Operation check passed successfully. |
| FSP_ERR_INVALID_DATA | Operation check failed due to calculation failure |