MW_DFU_FwImageRead
C
uint16_t MW_DFU_FwImageRead(uint32_t offset, uint16_t length, uint8_t *p_content);
Description
Reads a fragment of the firmware image from flash memory.
Note
The first 16 bytes of the image fragment read from flash are invalid until the full firmware image is activated.
Parameters
Parameter | Description |
---|---|
[in] offset | The offset in flash memory from where to start reading the image fragment. |
[in] length | The length of the image fragment to read, in bytes. |
[in] p_content | Pointer to the buffer where the image fragment will be stored. |
Return values
Return value | Description |
---|---|
MBA_RES_SUCCESS | Fragment of firmware image read successfully. |
MBA_RES_INVALID_PARA | Invalid parameters. The sum of offset and length exceeds the maximum firmware image size MW_DFU_MAX_SIZE_FW_IMAGE, or the length exceeds the maximum block length MW_DFU_MAX_BLOCK_LEN. |
MBA_RES_FAIL | Flash access failed. |