If you pause the program manually, chances are it's going to stop in a sleep handler. Why not set a breakpoint in your UART ISR? I *think* you might then be able to see the timer ISR in the call stack.
Failing that, you could try the following bit banging technique. I don't use the alt_irq_interruptible and alt_irq_noninterruptible functions.
What the following does is set the IRQ mask to choose what IRQs you don't want to the serviced (note this includes the current IRQ number to avoid another instance of it running). It then remembers the "global IRQ enable" state, and forces it on.
The "finish" routine merely resets the state noted in the "start" routine.
Please let me know if I've got anything wrong!
# ifndef _IRQ_DEBUG_H_# define _IRQ_DEBUG_H_
// ----------------------------------------------------------------------------
extern volatile alt_u32 alt_irq_active;
// ----------------------------------------------------------------------------
// 26/09/05 - Call this within an ISR to allow other handlers to run
static ALT_INLINE alt_irq_context ALT_ALWAYS_INLINE IRQ_ALLOW_ESSENTIAL_START (alt_u32 id, alt_u32* pActive)
{
alt_irq_context Ctrl0;
alt_u32 irq_mask;
// irq_mask = ~(0x0FFFFFFFF << id); //mask out self and all others of lower priority
irq_mask = (~(1 << id)) & 0x000FFFFFF; //mask out self and IRQs 32-29, 28-25
*pActive = alt_irq_active;
alt_irq_active &= irq_mask;
NIOS2_WRITE_IENABLE (alt_irq_active);
/* equivalent to:
alt_irq_disable (id); //avoid re-entry
alt_irq_disable (IRQ1); //disable those that can wait
alt_irq_disable (IRQ2);
...etc
*/
NIOS2_READ_STATUS (Ctrl0);
Ctrl0 |= NIOS2_STATUS_PIE_MSK;
NIOS2_WRITE_STATUS (Ctrl0);
return (Ctrl0);
}
// ----------------------------------------------------------------------------
static ALT_INLINE void ALT_ALWAYS_INLINE IRQ_ALLOW_ESSENTIAL_FINISH (alt_irq_context Ctrl0, alt_u32 id, alt_u32 Active)
{
Ctrl0 &= ~NIOS2_STATUS_PIE_MSK;
NIOS2_WRITE_STATUS (Ctrl0);
/*
* equivalent to.....
alt_irq_enable (IRQ1); ....
alt_irq_enable (id);
*/
alt_irq_active = Active;
NIOS2_WRITE_IENABLE (Active);
}
// ----------------------------------------------------------------------------
# endif //_IRQ_DEBUG_H_
in ISR:
// class DeviceDriver.....
// public:
// static void Handle_Device_IRQ (void* context, alt_u32 id)
void DeviceDriver::Handle_Device_IRQ (void* context, alt_u32 id)
{
alt_irq_context Ctrl0;
alt_u32 Active;
//do something uninterruptible
//Allow other high priority IRQs to be serviced
Ctrl0 = IRQ_ALLOW_ESSENTIAL_START (id, &Active);
//do something interruptible
IRQ_ALLOW_ESSENTIAL_FINISH (Ctrl0, id, Active);
}