In the code for the AN12218 Boodloader if the SREC record straddles a page boundary (flash_program_address is in one page, flash_program_address+data_size is in the next page) then it does not erase the next page to allow programming the data and on the next pass the FlashEraseSector() call erases and leaves a hole unprogrammed (all 0xFF).
Another conditional to check flash_prog_address+data_size and erase is needed.
Hi,
this weakness of s-record parser has been already reported to us:
We are working to fix this. Currently the workaround is to convert the file as mentioned in the thread above.
Regards,
Lukas
I think you misunderstand.
The 8-byte alignment issue is related to the flash write process.
This issue is related to the sector erase. If an aligned SREC (say 32 bytes, evenly divisible by 8 bytes) straddles the sector boundary (say 16 bytes in one sector, 16 bytes in the next) then the erase will not properly happen and you'll be left with invalidly programmed data.