Skip to main content
swhite2
Associate II
August 13, 2010
Question

Enabling (other) interrupts in a fault exception

  • August 13, 2010
  • 8 replies
  • 1698 views
Posted on August 13, 2010 at 16:55

Enabling (other) interrupts in a fault exception

#debug
This topic has been closed for replies.

8 replies

stforum2
Visitor II
May 17, 2011
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.

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

What is a Hard Fault ?

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

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

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

stforum2
Visitor II
May 17, 2011
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.)

jpeacock23
Associate
May 17, 2011
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

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