1.2.2.2.5.2.3.2 MW_DFU_FwImageRead
C
uint16_t MW_DFU_FwImageRead(uint32_t offset, uint16_t length, uint8_t *p_content);
Description
The API is used to read the fragment of firmware image from flash.
Note
Before the new firmware image is activated, the first 16 bytes image fragment read from flash is invalid.
Parameters
Parameter | Description |
---|---|
[in] offset | The flash offset to start reading image fragment. |
[in] length | The length of image fragment to read, unit: byte. |
[in] p_content | Pointer to the image fragment buffer. |
Return values
Return value | Description |
---|---|
MBA_RES_SUCCESS | Read the fragment of firmware image successfully. |
MBA_RES_INVALID_PARA | Invalid parameters. The offset + length exceed MW_DFU_MAX_SIZE_FW_IMAGE or length exceed MW_DFU_MAX_BLOCK_LEN. |