Fix ECC Failure Check in Bootloader and recovery from it
For STM32H7 board the RAM[0] is actually non DMA'ble memory in bootloader. And for doing ECC check we were trying to copy values from Flash to non-DMA'ble memory which will just fail and not raise an error when the ECC fail actually happens.
The easiest way I think is to simply not use DMA and use memcpy instead. A good side benefit I found is that the CPU raises SIGTRAP under GDB and breaks properly, allowing for better debugging around the address of failure.
Total time taken when using memcpy is 18ms. My guess is it wouldn't be that different with dma either.
@bugobliterator you need to discuss with me
This is actually boards with >= 128K of bootloader space, right? Do we have any with > 128K?
Cube red is 256kb bootloader.
Looks like it applies to the 128K boards too so the comment is wrong.
Cube red is 256kb bootloader.
No it is 128K only. And yes @tpwrules is correct the patch applies to boards with bl flash >= 128 . Will fix the commit name
ignoring the comment error to get this PR in