Hello Victor,
thank you for the example.
I looked into the source code and there seems to be a bug or just the description of the function is wrong:
The data is no written to DFU_DEST_BASE memory area but it is read from there instead.
Later, start_image((void *) DFU_DEST_BASE) is called but DFU_DEST_BASE was not written before, therefore I assume that the example does not work.
/* DFU write callback is called during DFU_DOWNLOAD state. In this example
*/
uint8_t dfu_wr(uint32_t block_num, uint8_t * *pBuff, uint32_t length, uint8_t *bwPollTimeout)
{
uint32_t dest_addr = DFU_DEST_BASE;
if (block_num >= DFU_MAX_BLOCKS) {
return DFU_STATUS_errADDRESS;
}
dest_addr += (block_num * DFU_XFER_BLOCK_SZ);
dest_addr += length;
// ---> HERE AT THIS PLACE dest_addr is read instead of written:
*pBuff = (uint8_t *) dest_addr;
return DFU_STATUS_OK;
}
Kind regards,
Ernst
ERNST MURNLEITNER
GESCHÄFTSFÜHRER / GENERAL MANAGER
AWITE BIOENERGIE GMBH
GRÜNSEIBOLDSDORFER WEG 5
D-85416 LANGENBACH
TEL. +49 (0)8761 72162 - 0 (ZENTRALE)
TEL. +49 (0)8761 72162 - 18 (DURCHWAHL)
FAX +49 (0)8761 72162 - 11
WWW.AWITE.DE