AT91SAM7S64 and GCC from GNUARM

Started by Mike Wolfram April 27, 2005
Hi,

I am using the above compiler for our development. Currently I am developing
on the SAM7S-EK where we changed the MCU from revision E to G.

I run into some troubles with timer interrupts. When I setup the timer 0
interrupt the system completely hangs. When I attach the debugger the PC is
somewhere in the 0xff...... region. I have checked that the IRQ handler
assembler code is called, but the C function for the timer is never reached.

When I call the same function just from a loop without configuring the timer
interrupt then everything is fine.

I have some SAM7S expample code for the Keil GCC compiler and if I compare it,
it looks similar.

Is there anybody who has experienced the same problems?

--
Mike Wolfram



Hi again,

I have done some further investigation.

First I played around with the compiler switches -mapcs, -fomit-frame-pointer
and -mthumb-interworking. Well, without any or just -mthumg-interworking the
system restarts 3 times and then hangs. With -mapcs and/or
-fomit-frame-pointer the system just hangs when the irq occurs.

Because I cannot debug I have inserted sending one character through the DBGU
to the host PC after setting up and enabling the timer irq. The loop is
executed exactly 5 times and then the system dies.

If someone believes she/he can help me I can post the source code.

--
Mike Wolfram
On Wednesday 27 April 2005 12:14, Mike Wolfram wrote:
> Hi,
>
> I am using the above compiler for our development. Currently I am
> developing on the SAM7S-EK where we changed the MCU from revision E to G.
>
> I run into some troubles with timer interrupts. When I setup the timer 0
> interrupt the system completely hangs. When I attach the debugger the PC
> is somewhere in the 0xff...... region. I have checked that the IRQ handler
> assembler code is called, but the C function for the timer is never
> reached.
>
> When I call the same function just from a loop without configuring the
> timer interrupt then everything is fine.
>
> I have some SAM7S expample code for the Keil GCC compiler and if I compare
> it, it looks similar.
>
> Is there anybody who has experienced the same problems?
>
> --
> Mike Wolfram > Yahoo! Groups Links
>
> To



There are literally hundreds of products out there built with gcc and
ARM7s that call C routines from interrupts.

The 0xff... Region is where the vectors are set up for the vectored
interrupt controller. If this is not set up properly you could be be
getting unhandled ( or badly handled) interrupts.

The other thing to do is to check whether the interrupt is being
reenabled and acknowledged before you get to the C routine. If this is
the case you might be getting a second interrupt processing cycle
happening before you get to the C routine. This will lock you in a never
ending loop.
> -----Original Message-----
> From: AT91SAM7@AT91...
> [mailto:AT91SAM7@AT91...] On Behalf Of Mike Wolfram
> Sent: Wednesday, 27 April 2005 10:14 p.m.
> To: AT91SAM7@AT91...
> Subject: [AT91SAM7] AT91SAM7S64 and GCC from GNUARM >
> Hi,
>
> I am using the above compiler for our development. Currently
> I am developing
> on the SAM7S-EK where we changed the MCU from revision E to G.
>
> I run into some troubles with timer interrupts. When I setup
> the timer 0
> interrupt the system completely hangs. When I attach the
> debugger the PC is
> somewhere in the 0xff...... region. I have checked that the
> IRQ handler
> assembler code is called, but the C function for the timer is
> never reached.
>
> When I call the same function just from a loop without
> configuring the timer
> interrupt then everything is fine.
>
> I have some SAM7S expample code for the Keil GCC compiler and
> if I compare it,
> it looks similar.
>
> Is there anybody who has experienced the same problems?
>
> --
> Mike Wolfram >
> Yahoo! Groups Links



Well, I solved the problem. For some reason I had wrong values for the AIC_
defines. No idea where I got them from but now with the correct ones it is
working fine.

--
Mike On Wednesday 27 April 2005 23:56, Charles Manning wrote:
> There are literally hundreds of products out there built with gcc and
> ARM7s that call C routines from interrupts.
>
> The 0xff... Region is where the vectors are set up for the vectored
> interrupt controller. If this is not set up properly you could be be
> getting unhandled ( or badly handled) interrupts.
>
> The other thing to do is to check whether the interrupt is being
> reenabled and acknowledged before you get to the C routine. If this is
> the case you might be getting a second interrupt processing cycle
> happening before you get to the C routine. This will lock you in a never
> ending loop.
>
> > -----Original Message-----
> > From: AT91SAM7@AT91...
> > [mailto:AT91SAM7@AT91...] On Behalf Of Mike Wolfram
> > Sent: Wednesday, 27 April 2005 10:14 p.m.
> > To: AT91SAM7@AT91...
> > Subject: [AT91SAM7] AT91SAM7S64 and GCC from GNUARM
> >
> >
> >
> > Hi,
> >
> > I am using the above compiler for our development. Currently
> > I am developing
> > on the SAM7S-EK where we changed the MCU from revision E to G.
> >
> > I run into some troubles with timer interrupts. When I setup
> > the timer 0
> > interrupt the system completely hangs. When I attach the
> > debugger the PC is
> > somewhere in the 0xff...... region. I have checked that the
> > IRQ handler
> > assembler code is called, but the C function for the timer is
> > never reached.
> >
> > When I call the same function just from a loop without
> > configuring the timer
> > interrupt then everything is fine.
> >
> > I have some SAM7S expample code for the Keil GCC compiler and
> > if I compare it,
> > it looks similar.
> >
> > Is there anybody who has experienced the same problems?
> >
> > --
> > Mike Wolfram
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
>
> Yahoo! Groups Links
>
> To