Coldfire (MCF5235) Interrupt Problem

Ivica Eftimovski IEFTIMOVSKI at teledyne.com
Fri May 11 15:55:56 UTC 2012


Hi all,

I am just starting with RTEMS and I am trying to interface the MCF5235 BCC board to our existing hardware. I am trying to set it to use *IRQ4, which should have fixed level/priority.

When I execute the code noted below, the interrupts are disabled properly, the vector seems set and interrupts are re-enabled. But anytime I ground*IRQ4 (default high) line while my example program is running, I do not vector to the ISR.

I fashioned my code using the clock/network/console code as guide, and those work great.

Can anyone please give me a hint of what am I doing wrong?

------------------------------------- CODE -------------------------------------
#define TPU_INT_VECTOR (64+4)
#define TPU_IRQ_LEVEL  4
#define TPU_IRQ_PRIORITY 4

void InitTPUInterrupt(void);
static rtems_isr TPUInterruptHandler(rtems_vector_number vector);


#define TPUInterruptSetPriority()                            \
     do {                                                     \
           MCF5235_INTC0_ICR4 =                                 \
                MCF5235_INTC_ICR_IL(TPU_IRQ_LEVEL) |             \
                MCF5235_INTC_ICR_IP(TPU_IRQ_PRIORITY);           \
     } while(0)


#define TPUInterruptSetHandler(_level,_vector,_old_handler)  \
     do {                                                     \
           rtems_interrupt_disable(_level);                     \
           MCF5235_INTC0_IMRL &= ~(MCF5235_INTC0_IMRL_INT4 |    \
                     MCF5235_INTC0_IMRL_MASKALL);                 \
           handle_status = rtems_interrupt_catch(TPUInterruptHandler, \
                     TPU_INT_VECTOR, &old_handler); \
           rtems_interrupt_enable(level);                       \
     } while(0)



void InitTPUInterrupt(void) {

     rtems_interrupt_level level;
     rtems_isr_entry old_handler;

     uint16 status;

     TPUInterruptSetPriority();

     TPUInterruptSetHandler(level, TPU_INT_VECTOR, old_handler);

     asm ("move.w  %%sr ,%0;" : "=r"(status));

}

static rtems_isr
TPUInterruptHandler(rtems_vector_number vector)
{
     uint volatile chan = vector - TPU_INT_VECTOR;

     printf("\nGot interrupt number: %i", chan);

    rtems_interrupt_clear(MCF5235_INTC0_ICR4);
}


rtems_task Init(
  rtems_task_argument ignored
)
{
     ....

     InitTPUInterrupt();

     ...
}
------------------------------------- CODE -------------------------------------




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20120511/26365e3f/attachment.html>


More information about the users mailing list