How to provoke HardFault on STM32H7
((volatile int*)0xFFFFFFFF)[0] = 0;
This will perform an illegal memory access and hence trigger the hard faul. Due to voltatile
, it won’t be optimized out by the compiler.
((volatile int*)0xFFFFFFFF)[0] = 0;
This will perform an illegal memory access and hence trigger the hard faul. Due to voltatile
, it won’t be optimized out by the compiler.