2015-02-18 01:34 AM
Hi all,
I would like to check my whole flash memory integrity. I´ve the posibility of read the whole sectors and calculate a CRC and check if it is correct by firmware. My question is the following one. Is there any other possibility to do that with uController hardware resources?2015-02-18 04:58 AM
Perhaps you can use DMA (Memory to Memory?) against the CRC peripheral's data register?
2015-02-18 06:09 AM
Hi clive1
I am trying to use HAL_CRC_Accumulate(&CrcHandle, u32buff, u16Size);Is your way of doing it faster?2015-02-18 06:15 AM
I'm not using the L0 or HAL, but I would expect the DMA to be able to outpace a software loop reading and writing memory. Suggest you experiment, and benchmark.
2015-02-19 07:03 AM
How can I know the size of my binary to do the correct check in my program?
2015-02-19 07:14 AM
This would depend a lot on your tools and process.
Most linkers have symbols, or you can place symbols, to know what the size of the image (code + statics) is. You can also post-process the output, and sign it with length and CRC information, or package the firmware suitably. If you package it properly, you know what the CRC is for the valid image, and also have it divide out to zero.