I am struggling with getting a reliable flash programming script to work on the LPC23xx with OpenOCD and Olimex ARM-USB-OCD dongle. The problem is that some targets will not halt from a script.
My test script is this:
mww 0xE01FC040 0x1
flash erase 0 0 26
sleep 300
reset run_and_halt
wait_halt
poll
What that does is map the memory to user flash, erase the user flash, then reset the target, letting it run for a bit and then halt. With empty user flash, the LPC23xx should start up in ISP mode, setting the system clock to a known state.
My problem is that some targets, will not halt after being reset from within the script. I have no idea why this would happen. If I then telnet into the session, and try to use the halt command, it still will not halt. But if I use the “reset run_and_halt” command from the telnet session it works!
What would possibly prevent the halt command from halting the target? I tried setting “arm7_9 dbgrq enable” but this made no difference. Why would “reset run_and_halt” work from telnet session, but not from a script?
- Joe