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

ParameterDescription
[in] lengthThe length of image fragment to update, unit: byte. It must be 16-bytes aligned.
[in] p_contentPointer to the image fragment.

Return values

Return valueDescription
MBA_RES_SUCCESSUpdate the fragment of firmware image successfully.
MBA_RES_INVALID_PARAInvalid 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_STATEThis API cannot be executed in current DFU process state.
MBA_RES_OOMNo available memory.
MBA_RES_FAILFail to updpate fragment to flash.