OpenOCD Makefile Automation

I haven’t tried much with OpenOCD so far and would like to integrate flash programming into the Makefile. Calling

make burn

should compile and link the code and flash the binary in the target’s program memory in one go. With interest, I read Martin’s most helpful

http://www.siwawi.arubi.uni-kl.de/avr_p … index.html

but this is based on a DOS Batch, which I want to avoid. The solution should be as platform independent as possible, portable C/C++ is fine though. My idea is to write a small tool, which feeds an OpenOCD script to the telnet interface at port 4444. I observed, that OpenOCD is not always responding with a prompt, but that should provide no real problem.

Does such a tool already exist (at least for Win32, Linux and OS X)?

Is there any simpler way to add flashing via OpenOCD to a Makefile?

Many thanks,

Harald

I think you can find something useful reading Lynch’s tutorial, you can find it searching with Google. There’s a section dealing with Flash programming using OpenOCD, all the commands are integrated in the Makefile, so you can launch all the operation typing “make program”. Hope this helps

l3golas

Mh, yes. Dynamically creating the script in the Makefile might be a reasonable way.

Thanks for this hint. Btw. if I didn’t miss something, he latest version of James’ document is available at

http://www.atmel.com/dyn/products/app_n … ily_id=605

Harald

The OpenMoko project has a tool called “devirginator” that allows bricked or completely unprogrammed devices to be reinstalled. They’re controlling the OpenOCD’s telnet interface with a few Perl scripts. I’ve seen other reports from people succesfully controlling the OpenOCD using some Python scripts.

I think that this is the way to go - instead of putting more sophisticated scripting support in the OpenOCD, people should use existing scripting languages to control the OpenOCD.

Regards,

Dominic