2010-08-13 07:55 AM
Enabling (other) interrupts in a fault exception
#debug2011-05-17 05:02 AM
Well I don't think that I have seen anything that says you cannot return from a hard fault. If you did that, the UART interrupt could function.
You might need to manipulate the stack in order to return from the hard fault to a safe place.2011-05-17 05:02 AM
2011-05-17 05:02 AM
2011-05-17 05:02 AM
2011-05-17 05:02 AM
You can print out this last message without using interrupts, just polling transmitter empty flag.
2011-05-17 05:02 AM
2011-05-17 05:02 AM
Unless of course the hard fault was in the USART code somewhere....
I use two LEDs to generate a fault code for any catastrophic failure. Red blinks out the 10's digit, Green blinks out the 1's digit. Very simple and reliable if everything else, including interrupts, is shut down. It doesn't have to rely on a console being connected or the USART hardware working correctly. Jack Peacock2011-05-17 05:02 AM
''I thought that the problem is that interrupts are disabled and no ISRs can be called.''
Interrupts may be disabled, but you can still enter an interrupt handler with a normal call instruction. On Cortex-M3 cores, a C interrupt handler is identical to any other C function and so the function will return OK. (The caller may need to save any non-scratch registers.)