MW_DFU_FwImageUpdate
C
uint16_t MW_DFU_FwImageUpdate(uint16_t length, uint8_t *p_content);
Description
Updates a fragment of the firmware image in flash memory.
Note
This API should be called multiple times to update all fragments of the firmware image.
Parameters
Parameter | Description |
---|---|
[in] length | The length of the image fragment to update, in bytes. Must be aligned to 16 bytes for internal flash. For external flash, it must be 256-byte aligned unless it is the last fragment. |
[in] p_content | Pointer to the image fragment data. |
Return values
Return value | Description |
---|---|
MBA_RES_SUCCESS | Fragment of firmware image updated successfully. |
MBA_RES_INVALID_PARA | Invalid parameters. The length exceeds the image size, the maximum block length MW_DFU_MAX_BLOCK_LEN, or does not meet alignment requirements. |
MBA_RES_BAD_STATE | The API cannot be executed in the current state of the DFU process. |
MBA_RES_OOM | Out of memory error. |
MBA_RES_FAIL | Failed to update the fragment to flash memory. |