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

ParameterDescription
[in] offsetThe offset in flash memory from where to start reading the image fragment.
[in] lengthThe length of the image fragment to read, in bytes.
[in] p_contentPointer to the buffer where the image fragment will be stored.

Return values

Return valueDescription
MBA_RES_SUCCESSFragment of firmware image read successfully.
MBA_RES_INVALID_PARAInvalid 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_FAILFlash access failed.