Seagate Dockstar JTAG Interface

In case of a broken boot loader, the last help is a JTAG interface. Connector J1 already provides such an interface. See the link dockstar-debricking-jtag-with-buspirate for the procedure. By adopting the file dockstar.cfg of openOCD (On Chip Debug) you can also use the Wiggler clone interface.

But you need a PC interface in order to connect to the JTAG port of Dockstar.

The cheapest (about 10 EUR) solution is a Wiggler clone attached to the parallel port of the PC, but modern PC's no longer have one.

For the USB port a cheap (about 25 EUR) solution is the Bus Pirate version 3.5, see Link. In case of an USB connection, you need a driver for the USB interface chip.

The software is OpenOCD version 0.5 created by Dominic Rath, see link. OpenOCD is hosted up to the end of 2011 at berlios.de, then at sourceforge (source only). The 0.5 binary for Ubuntu Linux can be found in the repository. For the Win32 binary see at the links.

Additionally you need an 3.3 V USB to Serial Port cable (e.g. Nokia CA-42), please see for the details at DockStarSerialLink.

In order to avoid problems, especially on a first time connection, remove all cables and USB connections from the Dockstar, while connected to the JTAG port.

attachment:Wiggler_Dockstar_J1_DSC02747.jpg

J1 Connector on Dockstar

The board inside the DockStar does have a 10 pin connector with 2 rows of 2 mm spaced pins. The 2 mm spaced plug comes from an old notebook harddisk or CD-ROM adapter. If you have opened the DockStar Pin 1 is the upper right one of the 10-pin header when the ethernet jack looks away from you and the 10-pin header is on the side near you. You have to use the three pins on the lower right (6, 4 and 2). In the data cable the data wires may have a different color, just test it if doesn't work, the hardware doesn't take any harm if those wires are exchanged. The picture on the right will expand, if you click on it. The pinout of the 10 pin conncetor is (for serial and JTAG):

Dockstar plug J1 10 pin, Serial Link / JTAG (Pin counting pairwise, and original)
function               name pin org   pin name function color RS232
output                 VCC  1   1 10  2   GND           blk
Test Reset, active low TRST 3   2  9  4   TxD  3.3 V    blu
Test Data Input        TDI  5   3  8  6   RxD  3.3 V    wht
Test Mode Select       TMS  7   4  7  8   SRST System Reset, active low
Test Clock             TCK  9   5  6 10   TDO  Test Data Output

attachment:Wiggler_P0009-06_DSC02746.jpg

attachment:JTAG_DS_P0009_06.png

Wiggler clone JTAG Interface, PC parallel port

In Germany a cheap ($14) Wiggler clone is available from company Anvilex, see link P0009-006.

Unfortunately is has several drawbacks, see the schematics:

In order to fix that, I first draw a schematic (see link for an EAGLE 5 file), then added/changed some resistors:

attachment:Wiggler_Dockstar_DSC02748.jpg

attachment:JTAG_Wiggler_Dockstar.png

The last hardware measure was to build a connection cable from the 20 pin flat cable to the 10 pin plug of the Dockstar. See on the right the picture of the cable and the schematic.

In order to have a reference of the signal timing I will attach a Logic Analyzer printout.

Some explanation to the signals:

attachment:wiggler_nTRST_inv2.png

The openOCD configuration files need the following setup:

source [find interface/parport.cfg]

# 0 = first parallel port (usually only one)
parport port = 0
parport_cable wiggler_ntrst_inverted

Use of openOCD with Dockstar and Wiggler

Open 3 Terminal instances in parallel and try to connect with openOCD to the JTAG port of Dockstar.

# in Terminal #1 instance connect to Dockstar Serial Port
$ screen /dev/ttyUSB0 115200
# You will see an empty screen, if the port is connected

# Plug in the power supply of the Dockstar
# You will see some boot messages
# Stop the count down for Linux boot with a key press
Hit any key to stop autoboot:  0 
Marvell>> 

A successful OpenOCD connection (in Terminal #2) under Linux looks like:

$ sudo openocd -f board/dockstar.cfg
[sudo] password for rudi: 
Open On-Chip Debugger 0.5.0 (2011-08-26-10:27)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.berlios.de/doc/doxygen/bugs.html
Warn : Adapter driver 'parport' did not declare which transports it allows; assuming legacy JTAG-only
Info : only one transport option; autoselect 'jtag'
parport port = 0x0
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain
adapter_nsrst_delay: 200
jtag_ntrst_delay: 200
500 kHz
adapter_nsrst_delay: 500
Warn : use 'feroceon.cpu' as target identifier, not '0'
dockstar_reset_cpu
Info : clock speed 500 kHz
Info : JTAG tap: feroceon.cpu tap/device found: 0x20a023d3 (mfg: 0x1e9, part: 0x0a02, ver: 0x2)
Info : Embedded ICE version 0
Info : feroceon.cpu: hardware has 1 breakpoint/watchpoint unit

Next you open a third terminal for the communication with the openOCD server:

$ telnet localhost 4444
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Open On-Chip Debugger
> 

Then I tried to download and start a new boot loader uboot.kwb, but it does not work. I had success only with the Bus Pirate interface.

# in Terminal #3
> init
> halt                                   
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x400000d3 pc: 0x0060a3ac
MMU: disabled, D-Cache: disabled, I-Cache: enabled
> nand probe 0
NAND flash device 'NAND 256MiB 3.3V 8-bit (Micron)' found
> load_image Downloads/uboot.kwb 0x800000
524288 bytes written at address 0x00800000
downloaded 524288 bytes in 57.479519s (8.908 KiB/s) 
> resume 0x800200
> 
# it does not work
> nand probe 0                           
NAND flash access requires halted target

Bus Pirate Firmware Update

Because I had no success with the first try to get the JTAG function working I made an firmware update from version 5.10 to 6.0RC. But I do not know if this was the cause of the problem.

For details have a look at Gonemad's Bus Pirate/OpenOCD walk through, see in Links.

To show the programmed version number have the following dialog with the Bus Pirate in a terminal:

On MAC OS X Terminal
$ screen /dev/tty.usbserial-A800F1FF 115200
HiZ> i
Bus Pirate v3b
Firmware v6.0RC (r572)  Bootloader v4.4
DEVID:0x0447 REVID:0x3043 (24FJ64GA002 B5)
http://dangerousprototypes.com
HiZ>
# Exit with (":" for command mode):
strg A : quit CR

Bus Pirate JTAG Interface

attachment:JTAG_BusPirate_Dockstar.png

The universal debugging board Bus-Pirate does also allow JTAG use. A good description can be found in the link: "dockstar-debricking-jtag-with-buspirate".

You need also an 3.3 V USB to Serial Cable, in order to bring the CPU in the Halt State.

For the connection between Dockstar JTAG (10 pin connector) and the Bus Pirate board (10 pin connector), please see the schematic in the picture to the right. A PDF version for better printing, and an EAGLE 5 version are also available, please see at the links.

Beside the flat cable, several things are to consider:

The openOCD configuration files need the following setup:

source [find interface/buspirate.cfg]]

# if the USB-Serial cable grabs "ttyUSB0", connect it after Linux is running!
buspirate_port /dev/ttyUSB0

# normal works with 115200 baud
#buspirate_speed normal
# fast works with about 1 MHz - OK
buspirate_speed fast

buspirate_vreg 0

reset_config srst_only

$ ls -ld /dev/ttyU*
0 crw-rw---- 1 root dialout 188, 0 2011-12-20 11:09 /dev/ttyUSB0
0 crw-rw---- 1 root dialout 188, 1 2011-12-20 11:09 /dev/ttyUSB1

Use of openOCD with Dockstar and Bus Pirate

# in Terminal #1 instance connect to Dockstar Serial port
$ screen /dev/ttyUSB1 115200
# You will see an empty screen, if the port is connected

# Plug in the power supply of the Dockstar
# You will see some boot messages
# Stop the count down for Linux boot with a key press
Hit any key to stop autoboot:  0 
Marvell>> 

# open Terminal #2 instance and connect to Bus Pirate
$ sudo openocd -f board/dockstar_bp.cfg
# on Bus Pirate board the "mode" LED lits green, the "USB" LED flickers.
Open On-Chip Debugger 0.5.0 (2011-08-26-10:27)

Licensed under GNU GPL v2
For bug reports, read
        http://openocd.berlios.de/doc/doxygen/bugs.html
Warn : Adapter driver 'buspirate' did not declare which transports it allows; assuming legacy JTAG-only
Info : only one transport option; autoselect 'jtag'
srst_only separate srst_gates_jtag srst_open_drain
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain
adapter_nsrst_delay: 200
jtag_ntrst_delay: 200
500 kHz
adapter_nsrst_delay: 500
Warn : use 'feroceon.cpu' as target identifier, not '0'
dockstar_reset_cpu
Info : Buspirate switched to FAST mode
Info : Buspirate Interface ready!
Info : Want to set speed to 500kHz, but not implemented yet
Error: Translation from jtag_speed to khz not implemented
Info : adapter-specific clock speed value 500
Info : JTAG tap: feroceon.cpu tap/device found: 0x20a023d3 (mfg: 0x1e9, part: 0x0a02, ver: 0x2)
Info : Embedded ICE version 0
Info : feroceon.cpu: hardware has 1 breakpoint/watchpoint unit

# open Terminal #3 instance to connect to openOCD command server
$ telnet localhost 4444
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Open On-Chip Debugger
> 

# in Terminal #2 instance
Info : accepting 'telnet' connection from 4444

# in Terminal #3 instance
> init
> halt
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x400000d3 pc: 0x0063f890
MMU: disabled, D-Cache: disabled, I-Cache: enabled
> dockstar_init
>

Load and Start uboot Loader

# in Terminal #3
> load_image Downloads/uboot.kwb 0x800000
>

# in Terminal #2 (Bus Pirate fast mode)
524288 bytes written at address 0x00800000
downloaded 524288 bytes in 80.474571s (6.362 KiB/s)

# in Terminal #3
> resume 0x800200

# in Terminal #1 Hit any key to stop autoboot
U-Boot 2010.09 (Oct 23 2010 - 11:49:22)
Marvell-Dockstar/Pogoplug by Jeff Doozan

SoC:   Kirkwood 88F6281_A0
DRAM:  128 MiB
NAND:  256 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
88E1116 Initialized on egiga0
Hit any key to stop autoboot:  0 
Marvell>> 

RAM memory dump for compare

# in Terminal #3
> dump_image Downloads/uboot_NAND.kwb 0x800000 0x80000
dumped 524288 bytes in 85.558037s (5.984 KiB/s)

# in Terminal #4
$ cd Downloads
$ diff uboot.kwb uboot_NAND.kwb 
$
# so, both files are identical

NAND flash memory check

In order to test the NAND flash memory the following can be done:

# in Terminal #3
> nand probe 0
NAND flash device 'NAND 256MiB 3.3V 8-bit (Micron)' found
> nand list
#0: NAND 256MiB 3.3V 8-bit (Micron) pagesize: 2048, buswidth: 8,
        blocksize: 131072, blocks: 2048

> nand check_bad_blocks 0
bad block: 212
bad block: 659
bad block: 1199
checked NAND flash device for bad blocks, use "nand info" command to list blocks

NAND flash Hints

From forum archlinuxarm.org (page 14, 2011-07-26, by displacedtexan ) I got an interesting statement:

Finally got it to work.

I did two thing differently. First after running the "resume 0x800200" command, I IMMEDIATELY switched to the terminal screen and hit a key to keep the dockstar from rebooting. Previously I would let it reboot a few times and then stop it.

After flashing the nand, I quit openocd, disconnected the buspirate and then rebooted. Worked fine. Previously I had left the JTAG adapter connected.

List of pages in this category:

-- RudolfReuter 2011-12-06 05:48:56


Go back to CategoryDockStar or FrontPage ; KontaktEmail (ContactEmail)