cancel
Showing results for 
Search instead for 
Did you mean: 

Enabling (other) interrupts in a fault exception

swhite2
Associate III
Posted on August 13, 2010 at 16:55

Enabling (other) interrupts in a fault exception

#debug
8 REPLIES 8
stforum2
Associate II
Posted on May 17, 2011 at 14:02

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.

greg_t
Associate II
Posted on May 17, 2011 at 14:02

What is a Hard Fault ?

swhite2
Associate III
picguy2
Associate II
Posted on May 17, 2011 at 14:02

baranovus
Associate III
Posted on May 17, 2011 at 14:02

You can print out this last message without using interrupts, just polling transmitter empty flag.

baranovus
Associate III
Posted on May 17, 2011 at 14:02

jpeacock23
Associate III
Posted on May 17, 2011 at 14:02

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 Peacock

stforum2
Associate II
Posted on May 17, 2011 at 14:02

''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.)