DFU Functions for application management.
Functions | |
void | Cy_DFU_ExecuteApp (uint32_t appId) |
This function transfers control from the current application to another application. More... | |
void | Cy_DFU_OnResetApp0 (void) |
This function is used in an App0 firmware image in Reset_Handler() only. More... | |
uint32_t | Cy_DFU_GetRunningApp (void) |
This function reports the application number of the currently running application. More... | |
cy_en_dfu_status_t | Cy_DFU_SwitchToApp (uint32_t appId) |
This function switches to the application through the jump instruction. More... | |
cy_en_dfu_status_t | Cy_DFU_CopyApp (uint32_t destAddress, uint32_t srcAddress, uint32_t length, uint32_t rowSize, cy_stc_dfu_params_t *params) |
This function copies an application from a temporary location in flash to its destination location in flash. More... | |
cy_en_dfu_status_t | Cy_DFU_ValidateApp (uint32_t appId, cy_stc_dfu_params_t *params) |
This function reports whether or not metadata and the specified application is valid. More... | |
void Cy_DFU_ExecuteApp | ( | uint32_t | appId | ) |
This function transfers control from the current application to another application.
The function performs switching via software reset. In case if application need to switch without reset, for example if it needs to enable some peripheral during and after the application switching, use Cy_DFU_SwitchToApp(). The function does not return.
appId | An application number of the application to switch to. |
void Cy_DFU_OnResetApp0 | ( | void | ) |
This function is used in an App0 firmware image in Reset_Handler() only.
Checks if switching to the other application is scheduled with Cy_DFU_ExecuteApp().
If the switch is scheduled, then it validates the application and transfers control to it.
uint32_t Cy_DFU_GetRunningApp | ( | void | ) |
This function reports the application number of the currently running application.
cy_en_dfu_status_t Cy_DFU_SwitchToApp | ( | uint32_t | appId | ) |
This function switches to the application through the jump instruction.
The function should be used when an application switching must be done without a software reset. Possible reason is a need to enable some peripheral during and after the application switching. In other case use Cy_DFU_ExecuteApp().
Before calling this function, ensure all the peripherals and bus masters are in a known state. User is responsible to disable peripherals and to set MCU internal state before or after an application switching.
appId | An application number of the application to switch to. |
cy_en_dfu_status_t Cy_DFU_CopyApp | ( | uint32_t | destAddress, |
uint32_t | srcAddress, | ||
uint32_t | length, | ||
uint32_t | rowSize, | ||
cy_stc_dfu_params_t * | params | ||
) |
This function copies an application from a temporary location in flash to its destination location in flash.
This function is typically called when updating an application used as part of an update process, for example updating a BLE stack.
destAddress | The start address of the application to copy to. |
srcAddress | The start address of the copy of the application to be copied. |
length | The number of bytes to copy. |
rowSize | The size of a flash row in bytes. |
params | The pointer to a DFU parameters structure. See cy_stc_dfu_params_t . |
cy_en_dfu_status_t Cy_DFU_ValidateApp | ( | uint32_t | appId, |
cy_stc_dfu_params_t * | params | ||
) |
This function reports whether or not metadata and the specified application is valid.
It checks:
This is a weak function and the user may override it in the user's code by providing a function with the same name.
appId | The application number of the application to be validated. |
params | The pointer to a DFU parameters structure. See cy_stc_dfu_params_t . |