1.2.2.2.5.2.3.4 MW_DFU_FwImageUpdate
C
uint16_t MW_DFU_FwImageUpdate(uint16_t length, uint8_t *p_content);
Description
The API is used to update the fragment of firmware image to flash. The API should be called multiple times to udpate all fragments of firmware image to flash.
Parameters
Parameter | Description |
---|---|
[in] length | The length of image fragment to update, unit: byte. It must be 16-bytes aligned for internal flash. For external flash, it must be 256-bytes aligned unless it is the last fragment. |
[in] p_content | Pointer to the image fragment. |
Return values
Return value | Description |
---|---|
MBA_RES_SUCCESS | Update the fragment of firmware image successfully. |
MBA_RES_INVALID_PARA | Invalid parameters. The length exceeds the image size or length exceeds MW_DFU_MAX_BLOCK_LEN or length is not 16-bytes aligned. |
MBA_RES_BAD_STATE | This API cannot be executed in current DFU process state. |
MBA_RES_OOM | No available memory. |
MBA_RES_FAIL | Fail to update fragment to flash. |