cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Participant
Participant
10,412 Views
Registered: ‎10-10-2007

In microblaze,can an interrupt handler be interrupt by an later interrupt?

Jump to solution
in one of my interrupt handler coder, i use the microblaze_enable_interrupts() to set microblaze IE bit of MSR unintentionally. but after doing so, my system seem work wrong, no longer accept other interrupt . is microblaze interrupt hander cann't be interrupt by other interrupt?
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Explorer
Explorer
11,575 Views
Registered: ‎08-14-2007

I haven't seen any documentation on using nested interrupts on MicroBlaze.  Saving R14 (and probably some other state) onto the stack before enabling nested interrupts is an example of one of the many things you would have to do.  That sort of complication is exactly why I recommended against using nested interrupts. 

View solution in original post

0 Kudos
3 Replies
Highlighted
Explorer
Explorer
10,388 Views
Registered: ‎08-14-2007

What you describe is known as "nested interrupts".  It's possible to do this on MicroBlaze, but it requires a lot more care than simply setting the IE bit in the interrupt handler.  In particular, you can't enable IE until the device requesting the interrupt stops requesting it, or you'll just have interrupt recursion until the stack overflows.

 

In general, I recommend against using nested interrupts, as they aren't necessary for most applications, add a lot of complexity, and make debugging more difficult.  In almost all cases, it is possible instead to use "light" interrupt handlers, that do an absolute minimum of work at interrupt time, and signal or queue a non-interrupt process to do the "heavy lifting".  By doing that, the interrupt latency is so short that nested interrupts aren't needed. 

0 Kudos
Highlighted
Participant
Participant
10,384 Views
Registered: ‎10-10-2007
Thank you for your answer! But is there any detailed document about 'nested interrupt' in microblaze? In microblaze processor reference guide, it said when a interrupt occur, the PC will be stored into R14. when nested interrupt is enabled, i think the original PC in R14 will be overwrite ,and then how the subroutine return to the main routine? Of course, nested interrupt is not necessory in my application, I just want to now how microblaze deal with nested interrupt now. Thank you!
0 Kudos
Highlighted
Explorer
Explorer
11,576 Views
Registered: ‎08-14-2007

I haven't seen any documentation on using nested interrupts on MicroBlaze.  Saving R14 (and probably some other state) onto the stack before enabling nested interrupts is an example of one of the many things you would have to do.  That sort of complication is exactly why I recommended against using nested interrupts. 

View solution in original post

0 Kudos