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

ParameterDescription
[in] lengthThe 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_contentPointer to the image fragment data.

Return values

Return valueDescription
MBA_RES_SUCCESSFragment of firmware image updated successfully.
MBA_RES_INVALID_PARAInvalid 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_STATEThe API cannot be executed in the current state of the DFU process.
MBA_RES_OOMOut of memory error.
MBA_RES_FAILFailed to update the fragment to flash memory.