lpc2148 fast IO and the JTAG interface with OpenOCD

I have an issue with the combination of using the NXP LPC2148, the Fast IO function registers and the OpenOCD debugger via Amontec JTAGKey.

I have written software to run on the ARM. I know it is working because I can see the led on the board toggling and data coming form the serial stream. I have also been able to step through the code using GDB from the gnuarm toolset and openocd with JTAGKey.

My problem comes when I let the code free run then enter debug mode. While running, I make sure that it is correctly functioioning by checking the flashing led, then I enter debug mode from GDB. I can read the FAST IO direction registers in the ARM device from the debugger using

monitor mdw 0x3fffc000

monitor mdw 0x3fffc020

And the values have been corrupted. When I try to continue the code, the GPIO actions are now broken.

This failure does not occur during the time the code is free running - I have run the sofware for 24hours to ensure it not a intermittent bug.

So I suspect the either

  1. OpenOCD is somehow writing to these addresses

  2. The Amontec JTAGKey and the ARM JTAG interface somehow spuriously effect the Fast IO registers

Has anyone seen this problem previously?

My fix for now is to use the slow GPIO legacy registers provided in the device and the problem of corruption does not occur.

Thanks,

Kent.