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.
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow