AnsweredAssumed Answered

Create a fault on purpose

Question asked by rost0031 on Aug 1, 2015
Latest reply on Aug 14, 2015 by rost0031
I would like to test all my hard fault and friends (MemManage, BusFault, UsageFault, etc) fault handlers.  Essentially, I'd like to log their occurence to an I2C EEPROM.  I have all the HardFault handling working (at least it prints out registers when I saw it crash early in dev) but I'd like to actually log them.  That part is easy (I hope). 

What would really want to do is have some tests that actually cause these faults.  I'm pretty sure I can cause a Hard Fault pretty easily (divide by zero or something equally dumb) but how do you cause the rest of the faults to occur on purpose?  Any advice?

I'm on STM32F4 using GCC 4.6.

Outcomes