ardupilot icon indicating copy to clipboard operation
ardupilot copied to clipboard

Fix ECC Failure Check in Bootloader and recovery from it

Open bugobliterator opened this issue 1 year ago • 2 comments

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 avatar Jun 21 '24 04:06 bugobliterator

image

peterbarker avatar Jun 21 '24 04:06 peterbarker

@bugobliterator you need to discuss with me

tridge avatar Jun 25 '24 01:06 tridge

This is actually boards with >= 128K of bootloader space, right? Do we have any with > 128K?

tpwrules avatar Jul 05 '24 13:07 tpwrules

Cube red is 256kb bootloader.

magicrub avatar Jul 05 '24 13:07 magicrub

Looks like it applies to the 128K boards too so the comment is wrong.

tpwrules avatar Jul 05 '24 16:07 tpwrules

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

bugobliterator avatar Jul 08 '24 02:07 bugobliterator

ignoring the comment error to get this PR in

tridge avatar Jul 17 '24 07:07 tridge