Content originally posted in LPCWare by ronkrem on Fri Jun 14 06:06:34 MST 2013
I have an LCD display that is only reset by power up. There is no programmable reset line. The LCD initialisation code can only run once after the PCB is powered up. Running it again destroys the initialisation. Thus I power up the board, the already loaded code runs, I start the LPC-Link debugger from LPCXpresso and so the LCD initialisation code runs again, corrupting the display. Note that the LPC-Link is always connected.
What I was hoping for was something the running code could test so it could tell if it was being monitored by the debugger or not, and consequently skip the init code.
I have a workaround where I put a switch on one of the board's IO lines, put a while loop just after the GPIOInit call, and hold this set while powering up the board and starting the debugger. Once it is ready to I release the switch and press the debugger's run button. This prevents the processor from running the code on power up. Arkward as you can understand.
Regards, Ron