I’m an ARM newb. I have an Olimex LPC-P2148 board and an ARM-USB-TINY. I was using the 30-day Crossworks demo. Very nice and easy to use. The demo expired and I decided to give Eclipse/yagarto another try.
And the headaches began. I’ve been Googling for days. I have it successfully compiling finally. I even have openocd talking to the usb-tiny programmer. Gdb kind of works, but it won’t flash the chip. It debugs, but of course it’s pointing to the wrong source code, as the new code doesn’t get loaded into the LPC2148.
Here’s the init script I grabbed from somewhere (I forget where):
It just says "load failed" every time. Anybody know what I'm doing wrong?
Tonight I pounded away at this thing for hours and made some good progress. The init file above is bogus! Do not use it.
I had been running openocd r204. Updated to r717. Studied the docs while running openocd in a DOS-style console. Turns out that openocd and the docs are a bigtime moving target. You can’t trust any config file you find online. At a guess, I’d say that 99% of the openocd info you find while Googling is badly out of date and useless. This even goes for the very well done Lynch articles - I read them all, but none of it worked for me. Use one little parameter that worked fine on older versions and the newer openocd doesn’t work, period.
I think I have it figured out. After hours of trying things to clarify what the docs say (they could be a bit more verbose, with examples, but they’re adequate), just minutes ago I was finally able to write my program to flash and run it from the openocd console. :mrgreen:
Tomorrow I’ll get it working proper in Eclipse. Should be easy now. :roll: And the config files are going to look significantly different from everything else I got off the web before. I’ll post my findings here because I see many other people posting all over the internet asking the same questions I was.
inventore123:
Since you are using an LPC micro, if you just want to flash your chip you can use the serial bootloader until you find a good openocd script.
Yes, I was using Flash Magic for that. But it's those extra steps that bug me, and not having a real debugger was making me crazy.
The script is coming together. It works except for one minor little fix I’m still experimenting with. That is, it flashes the chip fine but doesn’t yet set the breakpoint at main() and halt there.