EmbeddedRelated.com
Forums

Interrupt problem on LPC23xx after reset

Started by Mark Butcher December 4, 2008
Hi All

I wonder whether someone has a fast answer to this?

Board is Olimex LPC-2378-STK (but board probably not the problem).
After a power on the SW runs correctly (100% reliable after many tests).
After a push button reset the software often runs correctly, but not
always. When it doesn't run correctly it is because no interrupts are
operating.

Some details:
- when the SW is reset by the push button reset I have seen that the
peripherals are not all reset. For example timer 0, used for OS tick,
is still counting and the overflow interrupt is signaled (interrupts
are however disabled).
- when the SW starts it resets the timer (and its interrupt flags),
enables interrupts and starts the timer. But sometimes there is never
an interrupt when the timer reaches its TICK count value although the
interrupt flag gets set in the timer register and also propagates in
to the main interrupt status register (VICIRQStatus).

I found that it helped (reduced the chance of the interrupts not
working, but not completely solves it) when I perform an interrupt
acknowledge before setting up the timer interrupt [writing VICAddress
= 0;]. The value seen at VICAddress is the interrupt handler for timer
0, as would probably be expected - this is not cleared in teh
register, but this is probably also normal.

The fact that a (soft) reset doesn't reset all peripherals seems to be
a characteristic of the chip but the fact that the interrupt operation
is not reliable after such a reset seems to mean that something
special needs to be performed by the software to ensure reliability.

Probably more experienced users know what this trick is.

Any ideas?

regards

Mark
www.uTasker.com

An Engineer's Guide to the LPC2100 Series

Mark,

> Board is Olimex LPC-2378-STK (but board probably not the problem).
> After a power on the SW runs correctly (100% reliable after many tests).
> After a push button reset the software often runs correctly, but not
> always. When it doesn't run correctly it is because no interrupts are
> operating.

Whilst I do not wish to cast doubt about the reliability of Olimex hardware,
I had to return the same model board as you as Ethernet frames always
arrived with CRC errors, yet on all my other boards, with identical
software, frames were received without error. An existing customer has also
seen some problems identifying the PHY on the same board.

Again, I would not cast doubt on the board design, but I *would* suggest you
to try a recent Keil LPC237x board as a reference. The Keil boards are
nicely done, and are (in my experience) reliable.

I haven't seen what you are experiencing--but remember, the bootloader runs
before the user application, so the user program is not entered in
pristine-from-reset state...

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors

Hi Paul

Seeing as the suggestion came from you I immediately dug out my Keil
board and rebuild for that (different PHY as you know).

I tested 100 soft resets and all were successful (also after removing
the irq acknowledge at the beginning).

Therefore it does look rather like a problem with the board after all.

I did have the feeling that it got worst during the day - initially I
could debug from FLASH but later on debugging from FLASH never worked
because IRQs never arrived any more. But after loading older SW and
finding also the unreliability I was worried that this was something
that I just hadn't noticed before (having not actually worked on the
chip for a while).

It is a strange problem though - but I will stay with the KEIL board
for a while and, if I don't get more such effects or hear of the such,
will file it under "bad HW".

The only change I made to the keil board was sticking some "Blu-tack"
over the little red LED marked SD. It was so bright that I would
probably have gone blind if I had to look at it much longer...

Cheers

Mark
>
> Mark,
>
> > Board is Olimex LPC-2378-STK (but board probably not the problem).
> > After a power on the SW runs correctly (100% reliable after many
tests).
> > After a push button reset the software often runs correctly, but not
> > always. When it doesn't run correctly it is because no interrupts are
> > operating.
>
> Whilst I do not wish to cast doubt about the reliability of Olimex
hardware,
> I had to return the same model board as you as Ethernet frames always
> arrived with CRC errors, yet on all my other boards, with identical
> software, frames were received without error. An existing customer
has also
> seen some problems identifying the PHY on the same board.
>
> Again, I would not cast doubt on the board design, but I *would*
suggest you
> to try a recent Keil LPC237x board as a reference. The Keil boards are
> nicely done, and are (in my experience) reliable.
>
> I haven't seen what you are experiencing--but remember, the
bootloader runs
> before the user application, so the user program is not entered in
> pristine-from-reset state...
>
> --
> Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
> CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors
>