My favorites | Sign in
Project Logo
                
Code license: MIT License
Labels: JTAG, USB, MCU, AVR, AT90USB162, OpenHardware, Wiggler

A simple USB-JTAG interface implemented using LUFA library running AT90USB162 based on Open Hardware board opendous. Primary reason is to create a cheap replacement for the parallel port JTAG adapter "Wiggler" and alike.

Connecting pins to JTAG interface

PORTB is used for JTAG communications, with following pins configuration:

PinFunction
0TDI
1TMS
2TRST
3SRST
4TCK
5TDO

Various JTAG cable pin outs are available here: http://www.jtagtest.com/pinouts/

Configuring openocd

get the rev 1454 of openocd:

svn export -r 1454 http://svn.berlios.de/svnroot/repos/openocd/trunk openocd

apply the patch from patches subdirectory:

cd openocd
patch -p0 < ../opendous-jtag/patches/openocd-r1454.patch

Run the ./bootstrap script to refresh autoconf/automake rules, and then run ./configure

./bootstrap
./configure --prefix=/opt/arm --enable-opendous
make 
make install

make sure that PATH includes /opt/arm/bin directory, run openocd:

openocd -f interface/opendous -f target/<your cpu target>

Testing speed

At the moment it is quite slow, following is a test of uploading binary on a blackfin cpu using gdbproxy:

(gdb) load u-boot
Loading section .text, size 0x15d30 lma 0x3fc0000
Loading section .rodata, size 0x5ba4 lma 0x3fd5d30
Loading section .data, size 0x4100 lma 0x3fdb8d4
Loading section .u_boot_cmd, size 0x658 lma 0x3fdf9d4
Loading section .text_l1, size 0x2c lma 0x3fe002c
Start address 0x3fc0000, load size 131160
Transfer rate: 2892 bits/sec, 10930 bytes/write. 

Test of loading a FreeRTOS demo project on a Stellaris LM3S2965 demo kit

> openocd -f opendous.cfg -f target/lm3s6965.cfg

Info : OPENDOUS JTAG Interface ready
Info : JTAG tap: lm3s6965.cpu tap/device found: 0x3ba00477 (Manufacturer: 0x23b, Part: 0xba00, Version: 0x3)
Info : JTAG Tap/device matched
Warn : no telnet port specified, using default port 4444
Warn : no gdb port specified, using default port 3333
Warn : no tcl port specified, using default port 6666
Info : accepting 'telnet' connection from 0
target state: halted
target halted due to undefined, current mode: Thread 
xPSR: 0x00000000 pc: 0x00000000
Info : JTAG tap: lm3s6965.cpu tap/device found: 0x3ba00477 (Manufacturer: 0x23b, Part: 0xba00, Version: 0x3)
Info : JTAG Tap/device matched

> halt
target was in unknown state when halt was requested

> flash probe 0
flash 'stellaris' found at 0x00000000

> flash erase_sector 0 0 255
erased sectors 0 through 255 on flash bank 0 in 0.811001s

> flash write_image RTOSDemo.bin 0 bin  
Algorithm flash write 2048 words to 0x0, 18758 remaining
Algorithm flash write 2048 words to 0x2000, 16710 remaining
Algorithm flash write 2048 words to 0x4000, 14662 remaining
Algorithm flash write 2048 words to 0x6000, 12614 remaining
Algorithm flash write 2048 words to 0x8000, 10566 remaining
Algorithm flash write 2048 words to 0xa000, 8518 remaining
Algorithm flash write 2048 words to 0xc000, 6470 remaining
Algorithm flash write 2048 words to 0xe000, 4422 remaining
Algorithm flash write 2048 words to 0x10000, 2374 remaining
Algorithm flash write 326 words to 0x12000, 326 remaining
wrote 75032 byte from file RTOSDemo.bin in 25.443260s (2.879876 kb/s)








Hosted by Google Code