Reply by Robert Adsett November 9, 20062006-11-09
At 08:03 PM 11/9/2006 +0000, rtstofer wrote:
>--- In l..., "Wagner R. Teixeira" wrote:
> >
> > The ISR must be void, but I think the real problem is that you set
>the irq
> > attributes in the ISR's declaration, but not in the definition.
> >
> > Wagner
> >
> > > -----Mensagem original-----
> > > De: l... [mailto:l...] Em
>nome de
> > > ricardo_silva_marinheiro
> > > Enviada em: quinta-feira, 9 de novembro de 2006 12:26
> > > Para: l...
> > > Assunto: [lpc2000] Uart IRQ doesn't hapen
> > >
> > > Hello
> > >
> > > I'm working with gnuarm tools and a LPC2148, and i've a little
> > > program just to send you a feedback from a uart received char, based
> > > on the uart IRQ.
> > > The problem is that i can't get the ISRoutine working even when
> > > the program gets compiled without any warning or error.
> > > Could any one give a little help please?..
> > >
> > >
> > > The declaration:
> > > unsigned long uartInterrupt (void) __attribute__ ((interrupt("IRQ")));
> > >
> > > The Enable of the Interruption:
> > > VICVectAddr0 = (unsigned long) uartInterrupt;
> > > VICIntEnable = (VICIntEnable | 0x00000040);
> > > VICVectCntl0 = 0x000000026; /* 0x20 + 0x06 */
> > > U0IER = 0x07;
> > >
> > > The routine:
> > > unsigned long uartInterrupt (void)
> > > {
> > > int read=0;
> > >
> > > IOSET0=(1<<16);
> > > read=U0IIR;
> > > U0FCR=(U0FCR|0x04);
> > > VICVectAddr=0x00000000;
> > >
> > > return 0;
> > > }
> >As previously stated, the interrupt routine must be void and it can't
>return anything.
>
>The variable 'read' isn't used after it is assigned. Is there some
>chance the compiler is optimizing away the assignment?
>
>The variable 'read' is also local to the interrupt routine. If you
>want to set a flag, it needs to be either global or file global
>('static').
>
>The attribute only needs to be with the declaration, not with the
>definition so you are ok there.

I'm not sure any of that would prevent the interrupt from occurring. Might
keep it from occurring more than once though.

Another thing to note. Interrupts must be enabled in three places, the
peripheral, the VIC and the CPU core. The OP has only shown one here, it
would be worth verifying the other two.

Robert
Another sign of the end of civilization, our technical magazines are
getting chatty
From an EETimes product descriptions 2006/08/09
".... systems that can sample gobs of inputs simultaneously"
Now just what is the technical definition for gobs again?
http://www.aeolusdevelopment.com/

An Engineer's Guide to the LPC2100 Series

Reply by rtstofer November 9, 20062006-11-09
--- In l..., "Wagner R. Teixeira" wrote:
>
> The ISR must be void, but I think the real problem is that you set
the irq
> attributes in the ISR's declaration, but not in the definition.
>
> Wagner
>
> > -----Mensagem original-----
> > De: l... [mailto:l...] Em
nome de
> > ricardo_silva_marinheiro
> > Enviada em: quinta-feira, 9 de novembro de 2006 12:26
> > Para: l...
> > Assunto: [lpc2000] Uart IRQ doesn't hapen
> >
> > Hello
> >
> > I'm working with gnuarm tools and a LPC2148, and i've a little
> > program just to send you a feedback from a uart received char, based
> > on the uart IRQ.
> > The problem is that i can't get the ISRoutine working even when
> > the program gets compiled without any warning or error.
> > Could any one give a little help please?..
> >
> >
> > The declaration:
> > unsigned long uartInterrupt (void) __attribute__ ((interrupt("IRQ")));
> >
> > The Enable of the Interruption:
> > VICVectAddr0 = (unsigned long) uartInterrupt;
> > VICIntEnable = (VICIntEnable | 0x00000040);
> > VICVectCntl0 = 0x000000026; /* 0x20 + 0x06 */
> > U0IER = 0x07;
> >
> > The routine:
> > unsigned long uartInterrupt (void)
> > {
> > int read=0;
> >
> > IOSET0=(1<<16);
> > read=U0IIR;
> > U0FCR=(U0FCR|0x04);
> > VICVectAddr=0x00000000;
> >
> > return 0;
> > }
>

As previously stated, the interrupt routine must be void and it can't
return anything.

The variable 'read' isn't used after it is assigned. Is there some
chance the compiler is optimizing away the assignment?

The variable 'read' is also local to the interrupt routine. If you
want to set a flag, it needs to be either global or file global
('static').

The attribute only needs to be with the declaration, not with the
definition so you are ok there.

Richard
Reply by "Wagner R. Teixeira" November 9, 20062006-11-09
The ISR must be void, but I think the real problem is that you set the irq
attributes in the ISR's declaration, but not in the definition.

Wagner

> -----Mensagem original-----
> De: l... [mailto:l...] Em nome de
> ricardo_silva_marinheiro
> Enviada em: quinta-feira, 9 de novembro de 2006 12:26
> Para: l...
> Assunto: [lpc2000] Uart IRQ doesn't hapen
>
> Hello
>
> I'm working with gnuarm tools and a LPC2148, and i've a little
> program just to send you a feedback from a uart received char, based
> on the uart IRQ.
> The problem is that i can't get the ISRoutine working even when
> the program gets compiled without any warning or error.
> Could any one give a little help please?..
> The declaration:
> unsigned long uartInterrupt (void) __attribute__ ((interrupt("IRQ")));
>
> The Enable of the Interruption:
> VICVectAddr0 = (unsigned long) uartInterrupt;
> VICIntEnable = (VICIntEnable | 0x00000040);
> VICVectCntl0 = 0x000000026; /* 0x20 + 0x06 */
> U0IER = 0x07;
>
> The routine:
> unsigned long uartInterrupt (void)
> {
> int read=0;
>
> IOSET0=(1<<16);
> read=U0IIR;
> U0FCR=(U0FCR|0x04);
> VICVectAddr=0x00000000;
>
> return 0;
> }
>
> Yahoo! Groups Links
>
Reply by ricardo_silva_marinheiro November 9, 20062006-11-09
Hello

I'm working with gnuarm tools and a LPC2148, and i've a little
program just to send you a feedback from a uart received char, based
on the uart IRQ.
The problem is that i can't get the ISRoutine working even when
the program gets compiled without any warning or error.
Could any one give a little help please?..
The declaration:
unsigned long uartInterrupt (void) __attribute__ ((interrupt("IRQ")));

The Enable of the Interruption:
VICVectAddr0 = (unsigned long) uartInterrupt;
VICIntEnable = (VICIntEnable | 0x00000040);
VICVectCntl0 = 0x000000026; /* 0x20 + 0x06 */
U0IER = 0x07;

The routine:
unsigned long uartInterrupt (void)
{
int read=0;

IOSET0=(1<<16);
read=U0IIR;
U0FCR=(U0FCR|0x04);
VICVectAddr=0x00000000;

return 0;
}