EmbeddedRelated.com
Forums
Memfault Beyond the Launch

Crosswork UART0 interrupt problem

Started by g_gambler2000 July 9, 2007
Hi,

If you don't define VECTORED_IRQ_INTERRUPTS then the default
irq_handler is used. This will handle spurious interrupts and then
call (using bx) the function that is in the VICVectAddr. Using this
technique any function can be an interrupt handler.

If you define VECTORED_IRQ_INTERRUPTS then VICVectAddr is jumped to
(using ldr pc, [pc, #-0xff0]) and as such cannot contain the address
of a regular function - this is what the __attribute__ ((interrupt
("IRQ"))) is for. Note that this is buggy area of GCC (depending on
the version and the optimisation level), the function must be compiled
in ARM mode and the code generated doesn't handle spurious interrupts.

Regards
Michael
>
> ok, i have found a tweak that makes my ISR work.
>
> What i did was removed the following line.
>
> static void IRQ_UART0(void) __attribute__ ((interrupt ("IRQ")));
>
> and also DO NOT define VECTORED_IRQ_INTERRUPTS.
>
> Please correct me if i'm wrong.
>
> It seems that the __attribute__ ((interrupt ("IRQ"))) somehow make a
> wrong entry to my ISR function.
>
> Also, VECTORED_IRQ_INTERRUPTS is defined to point the irq_handler to
> VICVectAddr (ISR location), but somehow it didn't work as i expected.
>
> Anyone experience the same problem?
> Or is there any better solution than this tweak??
> --- In l..., "g_gambler2000" wrote:
> >
> > Yes, i have defined VECTORED_IRQ_INTERRUPTS for the startup.s
> >
> >
> > --- In l..., "Darcy Williams" wrote:
> > >
> > > Have you defined VECTORED_IRQ_INTERRUPTS in your project settings?
> > > You could also declare this within startup.s as "#define
> > > VECTORED_IRQ_INTERRUPTS"
> > >
> > >
> > > --- In l..., "g_gambler2000" wrote:
> > > >
> > > > Ok, i am running code from SYSTEM Mode and i have the I bit
set to 0
> > > > in SYSTEM mode. However, the ISR is still not firing up.
> > > > Do i need to set I=0 in IRQ mode as well??
> > > > Any other suggestion?
> > > >
> > > > By the way, i can get my ISR code running using CodeWarrior IDE.
> > > > So, i think there must be some setting in startup file or Rowley
> > > > Crosswork that i have miss out....
> > > >
> > > >
> > >
>

An Engineer's Guide to the LPC2100 Series


Memfault Beyond the Launch