Part: LPC222x
Hi,
I am experiencing a Prefetch Abort after entering Idle mode via setting the IDL bit in PCON.
Where I normally would run this:
StartTimerInterrupts(); while (1) { // Check If Timers Have Set Variables, Do Stuff DoWorkloop(); }
I am trying to do this:
StartTimerInterrupts(); while (1) { // Check If Timers Have Set Variables, Do Stuff DoWorkloop(); // Sleep Until Timers Wake Me Up PCON |= 0x01; }
I experience a Prefetch Abort and now am stuck as to how to debug this.
Please see my registers here:
ieee.usask.ca/.../Registers.png ieee.usask.ca/.../Registers-2.png
Thanks! -Chris
IDE-Version: µVision3 V3.31 Copyright (c) Keil Elektronik GmbH / Keil Software, Inc. 1995 - 2006
Tool Version Numbers: Toolchain Path: BIN30\ C Compiler: ARMCC.Exe Assembler: ARMASM.Exe Linker/Locator: ARMLINK.Exe Librarian: ARMAR.Exe Hex Converter: FROMELF.Exe CPU DLL: SARM.DLL V1.51 Dialog DLL: DARMP.DLL V1.11e Target DLL: BIN\UL2ARM.DLL V1.17 Dialog DLL: TARMP.DLL V1.10
// Sleep Until Timers Wake Me Up PCON |= 0x01;
Check what you are actually writing here in this read-modify-write operation.
Values read from undefined bits in PCON are undefined. The datasheet says that you should not write one to undefined bits which you quite possibly have just done.
Fix that first and see if it helps.
Your help is appreciated.
PCON = 0x01
Did NOT fix it.
I am looking for a way to debug the Prefetch Abort, stack back-tracing tips?
Could it be some kind of unwanted interaction between idle mode and JTAG bedugger?
- mike
Appears to be the case... I just noticed that if I load the LPC with code via the JTAG, but let the code run automatically by exiting the debug mode (instead of clicking the run button), it works just fine.
What could be going on?
The following Keil support document suggests that there are problems with JTAG and idle mode.
http://www.keil.com/support/docs/2752.htm