Re: Getting started

OpenOCD JTAG debugging with the Bus Pirate.

Getting started

Postby ian » Fri Jan 01, 2010 8:55 am

OpenOCD is a popular open source JTAG utility. Zach Welch, a regular contributor to the project, has offered to help add Bus Pirate support. You can follow the progress in his git repository.

The current plan is to port the excellent work done by the USBPROG project to the Bus Pirate. Here are some tentative goals:
    *  Port the AVR/USB-based microcontroller code from USBPROG to the Bus Pirate. Modify the code to work through the PIC serial port.
    * Add a Bus Pirate device to OpenOCD based on the existing USBPROG source code. Modify the code to write and read through a serial port.
    * Add message header, checksum to the existing USBPROG protocol.
Got a question? Please ask in the forum for the fastest answers.
User avatar
ian
Crew
Crew
 
Posts: 10803
Joined: Mon Jul 06, 2009 6:14 am

Re: Getting started

Postby ukoda » Mon Feb 08, 2010 6:25 pm

I'm wondering if this solution is functional enough to use or it will be a while?

We have been using the Amontec JTag with OpenOCD for Arm software development but one has died.  Even though they work I'm reluctant to buy a replacement since they provide no support and have a shipping policy that would see them in court if they operated here.

So now I'm looking at open source JTag solutions first.  I like the idea of the Bus Pirate but looking here it appears it may not be quite ready for general use.  Is there another path that I should be following now and give this option time to mature, or is it worth jumping in and taking a punt?
ukoda
Newbie
Newbie
 
Posts: 1
Joined: Mon Feb 08, 2010 6:10 pm

Re: Getting started

Postby robots » Tue Feb 09, 2010 8:12 am

So far there has been no beta testers. But I have been using the Buspirate as OpenOCD interface for a while, and i have had no problems so far.

It is not the fastest interface out there, but it works :)
Debuging is realtime-ish - in the first version i had to wait few seconds for one gdb step, now it takes <1 second. (tested with STM32 cpu)

I would be happy if you could give it a try !
User avatar
robots
Hero Member
Hero Member
 
Posts: 569
Joined: Sat Dec 05, 2009 11:19 am
Location: CZ/Prague

Re: Getting started

Postby brett » Tue Feb 09, 2010 7:03 pm

i'd be happy to test, but i have no idea how to get started. Is there a "dummies guide for dummies" on OpenOCD/JTAG, say for someone who has an ATMEGA32 sitting around and with zero JTAG experience to start with (ie will still need help or pointers to fuse level info)? Yes, I am a mega dummy with a ATMEGA32 :)
brett
Jr. Member
Jr. Member
 
Posts: 61
Joined: Tue Dec 15, 2009 4:52 pm
Location: Sydney, AU

Re: Getting started

Postby robots » Wed Feb 10, 2010 3:52 am

OpenOCDs primary target is ARM. I'm not sure if there is any atmega support.
User avatar
robots
Hero Member
Hero Member
 
Posts: 569
Joined: Sat Dec 05, 2009 11:19 am
Location: CZ/Prague

Re: Getting started

Postby robots » Wed Feb 10, 2010 3:56 am

According to openocd-devel mailing list
http://lists.berlios.de/pipermail/openo ... 05734.html

There is support for the avr cpu. They have tested mega128 succesfully. I guess that for mega32 you would need to change few numbers (IDs)
User avatar
robots
Hero Member
Hero Member
 
Posts: 569
Joined: Sat Dec 05, 2009 11:19 am
Location: CZ/Prague

Re: Getting started

Postby brett » Fri Feb 12, 2010 3:50 am

i guess I was hoping for a *real* "dummies" guide.  My eyes glazed over in the first few seconds of reading that article :)  Guess I'm not going to be any use in the test cycle sorry
brett
Jr. Member
Jr. Member
 
Posts: 61
Joined: Tue Dec 15, 2009 4:52 pm
Location: Sydney, AU

Re: Getting started

Postby Slimfish » Wed Feb 24, 2010 3:44 am

Robots,

i'm trying to get a couple of hours to test the openOCD/Buspirate integration but unfortunately i'm quite busy right now.

But i'd like to say kudos for your impressive work and programming skills. Well done man!!!
Slimfish
Newbie
Newbie
 
Posts: 9
Joined: Wed Feb 24, 2010 3:34 am
Location: Spain

Re: Getting started

Postby robots » Wed Feb 24, 2010 7:42 am

I have created patch for the latest git repo. I have also sent it to the development mailing list, so that it should be easier for others to use this interface :)
User avatar
robots
Hero Member
Hero Member
 
Posts: 569
Joined: Sat Dec 05, 2009 11:19 am
Location: CZ/Prague

Re: Getting started

Postby Slimfish » Wed Feb 24, 2010 7:53 am

Hi robots,

i was going to ask you for a patch of openOCD last revision (0.4.0). Can you also post it in the bus pirate repositories?

Thank you,
Slimfish
Newbie
Newbie
 
Posts: 9
Joined: Wed Feb 24, 2010 3:34 am
Location: Spain

Re: Getting started

Postby CheBuzz » Fri Feb 26, 2010 11:55 am

robots,
I just checked out and built the openocd repository.  Also just got my bus pirate.  So I am ready to do some testing whenever you need it!
CheBuzz
Newbie
Newbie
 
Posts: 3
Joined: Fri Feb 26, 2010 11:43 am

Re: Getting started

Postby robots » Fri Feb 26, 2010 3:05 pm

Latest patch that applies to the git repository is attached. I have emailed it to the devel mailing list for review. It should apply without any major problem. Then you will need to enable the buspirate interface compilation using:
Code: Select all
./configure --enable-buspirate --enable-maintainer-mode

(maintainer mode is needed when compiling development version)

Some short howto on how to use openocd is on my blog. It points out some things you need to configure before using openocd (maybe gdb) and the target.

http://michaldemin.wordpress.com/2010/0 ... d-openocd/

When testing, just be sure that your target JTAG is 3v3 compatible :)

Current state is "works-for-me", and I don't think that many bugs will emerge.
Attachments
buspirate.txt
(28.7 KiB) Downloaded 489 times
User avatar
robots
Hero Member
Hero Member
 
Posts: 569
Joined: Sat Dec 05, 2009 11:19 am
Location: CZ/Prague

Re: Getting started

Postby JimNarem » Fri Feb 26, 2010 6:57 pm

>When testing, just be sure that your target JTAG is 3v3 compatible :)

Can you use other target voltages If you turn pullup resistors on, and supply Vextern with
the JTAG interface voltage?  This is a real issue for FPGAs and CPLDs.
User avatar
JimNarem
Newbie
Newbie
 
Posts: 22
Joined: Fri Feb 26, 2010 6:50 pm
Location: Connecticut, USA

Re: Getting started

Postby robots » Fri Feb 26, 2010 7:18 pm

Sure you can, just be sure to edit the buspirate.cfg config file. You want to set it to something like:
Code: Select all
buspirate_mode open-drain
buspirate_pullup 1


Edit: I'll post detailed tutorial tomorrow.
Last edited by robots on Fri Feb 26, 2010 7:20 pm, edited 1 time in total.
User avatar
robots
Hero Member
Hero Member
 
Posts: 569
Joined: Sat Dec 05, 2009 11:19 am
Location: CZ/Prague

Re: Getting started

Postby robots » Sat Feb 27, 2010 5:28 am

simple "how to" buspirate and openocd:

http://michaldemin.wordpress.com/2010/0 ... d-openocd/
User avatar
robots
Hero Member
Hero Member
 
Posts: 569
Joined: Sat Dec 05, 2009 11:19 am
Location: CZ/Prague

Next

Return to OpenOCD JTAG