User Tools

Site Tools


dev:nab:v2:jtag_access

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
dev:nab:v2:jtag_access [2015/11/12 12:38] – [Nabaztag:tag] redoxdev:nab:v2:jtag_access [2015/11/12 13:37] – [ Usage] redox
Line 10: Line 10:
 ### JTAG probe: BusBlaster ### JTAG probe: BusBlaster
  
 +{{:dev:nab:v2:jtag:bbv3.jpg?200 |}}I think you can use any JTAG probe that's 3.3v compatible, if you have one. If you don't, I recommend the [BusBlaster v3](http://dangerousprototypes.com/docs/Bus_Blaster_v3_design_overview). It's a great board, versatile and cheap; oh ! and it's also open hardware and open source ! :-) 
  
 +On of the best features of the BusBlaster is you can reconfigure the CPLD to emulate any FT2232 JTAG probe. I think it comes pre-programmed with a JTAGkey buffer logic, which should work fine for this application.
 +
 +_Note_: My BusBlaster (a v4 !) uses a KT-link buffer logic, because I needed the SWD capabilities for another application. If the following steps don't work, try to reprogram the CPLD with a KT-link buffer and try again !
 +
 +You also need some jumper wires (also called _Dupont wire_ sometimes) F/F to connect the BusBlaster to the Nabaztag
  
 ### Nabaztag:tag ### Nabaztag:tag
Line 39: Line 45:
 ## Software: OpenOCD ## Software: OpenOCD
  
-### Pacth and compile+### Patch and compile OpenOCD 
 + 
 +The Nabaztag:tag uses a ML67Q4051 micro-controller which is not on the supported hardware list of OpenOCD. It's an ARM7TDMI variant, so I thought it should be possible to use it. I spent some time hacking code and I eventually ended up with a patch good enough to: 
 + 
 +- access the CPU registers, which means debug is possible ! 
 +- read and write the Internal flash 
 +  - First version was slow as hell: 5 to 10 minutes to read/write the whole flash 
 +  - Second version is much better: under 5 seconds. I had to write ARM assembler code to be run from RAM to write the Flash, which was a rather painful but interesting experience... 
 + 
 +So ! Download OpenOCD **0.8.0** from their website, or here (mirror): {{:dev:nab:v2:jtag:openocd-0.8.0.tar.gz|openocd 0.8.0}} 
 + 
 +Download the patch: {{:dev:nab:v2:jtag:openocd_0.8.0_oki.patch.gz|openocd_0.8.0_oki}} 
 + 
 +#### Prepare 
 + 
 +    sudo aptitude install libtool autoconf automake libusb-1.0-0-dev 
 +     
 +    gzip -d openocd_0.8.0_oki.patch.gz 
 +    tar xzvf ./openocd-0.8.0.tar.gz 
 + 
 + 
 +#### Patch 
 + 
 +    cd openocd-0.8.0/ 
 +    patch -p1 < ../openocd_0.8.0_oki.patch 
 + 
 +#### Compile 
 + 
 +    autoreconf -fi 
 +    ./configure 
 +    make 
 + 
 +When it's done, you should have a binary named **openocd** in the `src/` folder
  
 ### Usage ### Usage
 +
 +Now that you have a patched version of OpenOCD capable of debugging the OKI chip, you need some configuration files. Here are mine: {{:dev:nab:v2:jtag:openocd_nab.tar.gz|openocd_nab}}
 +
 +_Note_: You might need to tweak them a little bit, especially the `interface/ftdi/dp_busblaster.cfg` to get you BusBlaster recognized by OpenOCD. I think I renamed my BusBlaster, and OpenOCD checks the name... Shoot me an email if ou need some help.
 +
 +Once you have the config files, just copy the openocd binary in the same folder and then it's as easy as:
 +
 +    ./openocd -f nabaztagv2.cfg
  
 ## Pictures ## Pictures