Forums

ARM-VIC-Crossworks

Started by mgiaco82 April 18, 2006
I found this on the Page from Rowley.

>>I'm trying to use vectored interrupts on the LPC2000. I've
programmed >>up the VIC but when the interrupt occurs the program
jumps to >>the "irq_handler" label/function, not the ISR I have
configured using >>the VIC.

>>How do I make the LPC2000 jump to my vectored ISR when the
interrupt >>occurs?

Answer:

You need to have the instruction "ldr pc, [pc, #-0xFF0]" located at
the IRQ exception vector for vectored interrupts to work.

To do this make sure you have the preprocessor definition
VECTORED_IRQ_INTERRUPTS defined when you compile the
Philips_LPC210X_Startup.s file.

This mean i have to define anything before i can use the vic?
Can anybody explain pleas.

thanks mathias

An Engineer's Guide to the LPC2100 Series

--- In l..., "mgiaco82" wrote:
>
> I found this on the Page from Rowley.
>
> >>I'm trying to use vectored interrupts on the LPC2000. I've
> programmed >>up the VIC but when the interrupt occurs the program
> jumps to >>the "irq_handler" label/function, not the ISR I have
> configured using >>the VIC.
>
> >>How do I make the LPC2000 jump to my vectored ISR when the
> interrupt >>occurs?
>
> Answer:
>
> You need to have the instruction "ldr pc, [pc, #-0xFF0]" located at
> the IRQ exception vector for vectored interrupts to work.
>
> To do this make sure you have the preprocessor definition
> VECTORED_IRQ_INTERRUPTS defined when you compile the
> Philips_LPC210X_Startup.s file.
>
> This mean i have to define anything before i can use the vic?
> Can anybody explain pleas.
>
> thanks mathias
>

Yes, you have to do 'something' to alter the way in which the startup
file is assembled. Look at the Philips_LPC????_Startup.s file.
Somewhere (maybe around line 86) you will find:

#ifdef VECTORED_IRQ_INTERRUPTS
.word 0xB9205F84 /* boot loader checksum */
ldr pc, [pc, #-0xFF0] /* irq handler */
#else
.word 0xB8A06F60 /* boot loader checksum */
ldr pc, [pc, #irq_handler_address - . - 8] /* irq handler */
#endif

One way to get VECTORED_IRQ_INTERRUPTS defined is to put, at the top
of the .S file:

#define VECTORED_IRQ_INTERRUPTS

Maybe put that just before:
.section .vectors, "ax"

If you do it that way, you will want to import the .s file to the
specific project rather than linking to a modified master copy. Right
click on the file name in the Project Explorer dialog and select
Import. Put the copy with the other source files for the project.

There is probably a much better way to do this. At the moment, I
can't find it.

Richard
Richard,
> One way to get VECTORED_IRQ_INTERRUPTS defined is to put, at
> the top of the .S file:
>
> #define VECTORED_IRQ_INTERRUPTS
>
> Maybe put that just before:
> .section .vectors, "ax"
>
> If you do it that way, you will want to import the .s file to
> the specific project rather than linking to a modified master
> copy. Right click on the file name in the Project Explorer
> dialog and select Import. Put the copy with the other source
> files for the project.
>
> There is probably a much better way to do this. At the
> moment, I can't find it.

Set it in the preprocessor definitions of the project.

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors
--- In l..., "rtstofer" wrote:
>
> --- In l..., "mgiaco82" wrote:
> >
> > I found this on the Page from Rowley.
> >
> > >>I'm trying to use vectored interrupts on the LPC2000. I've
> > programmed >>up the VIC but when the interrupt occurs the
program
> > jumps to >>the "irq_handler" label/function, not the ISR I have
> > configured using >>the VIC.
> >
> > >>How do I make the LPC2000 jump to my vectored ISR when the
> > interrupt >>occurs?
> >
> > Answer:
> >
> > You need to have the instruction "ldr pc, [pc, #-0xFF0]" located
at
> > the IRQ exception vector for vectored interrupts to work.
> >
> > To do this make sure you have the preprocessor definition
> > VECTORED_IRQ_INTERRUPTS defined when you compile the
> > Philips_LPC210X_Startup.s file.
> >
> > This mean i have to define anything before i can use the vic?
> > Can anybody explain pleas.
> >
> > thanks mathias
> >
>
> Yes, you have to do 'something' to alter the way in which the
startup
> file is assembled. Look at the Philips_LPC????_Startup.s file.
> Somewhere (maybe around line 86) you will find:
>
> #ifdef VECTORED_IRQ_INTERRUPTS
> .word 0xB9205F84 /* boot loader checksum */
> ldr pc, [pc, #-0xFF0] /* irq handler */
> #else
> .word 0xB8A06F60 /* boot loader checksum */
> ldr pc, [pc, #irq_handler_address - . - 8] /* irq handler */
> #endif
>
> One way to get VECTORED_IRQ_INTERRUPTS defined is to put, at the
top
> of the .S file:
>
> #define VECTORED_IRQ_INTERRUPTS
>
> Maybe put that just before:
> .section .vectors, "ax"
>
> If you do it that way, you will want to import the .s file to the
> specific project rather than linking to a modified master copy.
Right
> click on the file name in the Project Explorer dialog and select
> Import. Put the copy with the other source files for the project.
>
> There is probably a much better way to do this. At the moment, I
> can't find it.
>
> Richard
>

Hallo Richard, thanks for the message. Pleas can you give me a
detailed description of that. I don't see the point.

When I use the sample code from rowley for the timer irq it works.
But with der uart code, i have ported, it doesnt work.

thanks,

mathias



--- In l..., "Paul Curtis" wrote:
>
> Richard,
> > One way to get VECTORED_IRQ_INTERRUPTS defined is to put, at
> > the top of the .S file:
> >
> > #define VECTORED_IRQ_INTERRUPTS
> >
> > Maybe put that just before:
> > .section .vectors, "ax"
> >
> > If you do it that way, you will want to import the .s file to
> > the specific project rather than linking to a modified master
> > copy. Right click on the file name in the Project Explorer
> > dialog and select Import. Put the copy with the other source
> > files for the project.
> >
> > There is probably a much better way to do this. At the
> > moment, I can't find it.
>
> Set it in the preprocessor definitions of the project.
>
> --
> Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
> CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors
>
Hello Paul,

where ??? and what must I set? and pleas can you have a look to my
other question concerning rowley.

thanks,

mathias
Hi,

> > > One way to get VECTORED_IRQ_INTERRUPTS defined is to put,
> at the top
> > > of the .S file:
> > >
> > > #define VECTORED_IRQ_INTERRUPTS
> > >
> > > Maybe put that just before:
> > > .section .vectors, "ax"
> > >
> > > If you do it that way, you will want to import the .s file to the
> > > specific project rather than linking to a modified master copy.
> > > Right click on the file name in the Project Explorer dialog and
> > > select Import. Put the copy with the other source files for the
> > > project.
> > >
> > > There is probably a much better way to do this. At the moment, I
> > > can't find it.
> >
> > Set it in the preprocessor definitions of the project.
> >
> > --
> > Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
> > CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors
> >
> Hello Paul,
>
> where ??? and what must I set? and pleas can you have a look
> to my other question concerning rowley.

1. Right click the project node in the project explorer.

2. Click Properties.

3. Click the Preprocessor tab (at the end).

4. Preprocessor Definitions is now right in front of you.

What other question?

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors
--- In l..., "Paul Curtis" wrote:
>
> Richard,
> > One way to get VECTORED_IRQ_INTERRUPTS defined is to put, at
> > the top of the .S file:
> >
> > #define VECTORED_IRQ_INTERRUPTS
> >
> > Maybe put that just before:
> > .section .vectors, "ax"
> >
> > If you do it that way, you will want to import the .s file to
> > the specific project rather than linking to a modified master
> > copy. Right click on the file name in the Project Explorer
> > dialog and select Import. Put the copy with the other source
> > files for the project.
> >
> > There is probably a much better way to do this. At the
> > moment, I can't find it.
>
> Set it in the preprocessor definitions of the project.
>
> --
> Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
> CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors
>

Paul,

Outstanding! I had tried that earlier without success. But then, I
didn't know if it was supposed to work.

I certainly have no desire to change the startup file.

Richard
--- In l..., "Paul Curtis" wrote:
>
> Hi,
>
> > > > One way to get VECTORED_IRQ_INTERRUPTS defined is to put,
> > at the top
> > > > of the .S file:
> > > >
> > > > #define VECTORED_IRQ_INTERRUPTS
> > > >
> > > > Maybe put that just before:
> > > > .section .vectors, "ax"
> > > >
> > > > If you do it that way, you will want to import the .s file
to the
> > > > specific project rather than linking to a modified master
copy.
> > > > Right click on the file name in the Project Explorer dialog
and
> > > > select Import. Put the copy with the other source files for
the
> > > > project.
> > > >
> > > > There is probably a much better way to do this. At the
moment, I
> > > > can't find it.
> > >
> > > Set it in the preprocessor definitions of the project.
> > >
> > > --
> > > Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
> > > CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3
processors
> > >
> > Hello Paul,
> >
> > where ??? and what must I set? and pleas can you have a look
> > to my other question concerning rowley.
>
> 1. Right click the project node in the project explorer.
>
> 2. Click Properties.
>
> 3. Click the Preprocessor tab (at the end).
>
> 4. Preprocessor Definitions is now right in front of you.
>
> What other question?

Hello this:

http://groups.yahoo.com/group/lpc2000/message/15362
--- In l..., "Paul Curtis" wrote:
>
> Hi,
>
> > > > One way to get VECTORED_IRQ_INTERRUPTS defined is to put,
> > at the top
> > > > of the .S file:
> > > >
> > > > #define VECTORED_IRQ_INTERRUPTS
> > > >
> > > > Maybe put that just before:
> > > > .section .vectors, "ax"
> > > >
> > > > If you do it that way, you will want to import the .s file
to the
> > > > specific project rather than linking to a modified master
copy.
> > > > Right click on the file name in the Project Explorer dialog
and
> > > > select Import. Put the copy with the other source files for
the
> > > > project.
> > > >
> > > > There is probably a much better way to do this. At the
moment, I
> > > > can't find it.
> > >
> > > Set it in the preprocessor definitions of the project.
> > >
> > > --
> > > Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
> > > CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3
processors
> > >
> > Hello Paul,
> >
> > where ??? and what must I set? and pleas can you have a look
> > to my other question concerning rowley.
>
> 1. Right click the project node in the project explorer.
>
> 2. Click Properties.
>
> 3. Click the Preprocessor tab (at the end).
>
> 4. Preprocessor Definitions is now right in front of you.

And there i must write

#define VECTORED_IRQ_INTERRUPTS 1

or what else?

thanks,

mathias
Hi,

> > What other question?
>
> Hello this:
>
> http://groups.yahoo.com/group/lpc2000/message/15362

The latest v1.6 release has this capability.

-- Paul.