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 (2013-11-25 version 0.7) 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.
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
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:
- The base resistor for the transistors (inverter) are just 51 Ohm, it should be 10K Ohm.
- The signal lines to the JTAG target should have a series resistor of about 50 to 100 Ohm (signal line wave impedance).
- The signal TRST is inverted compared to the original Wiggler board.
In order to fix that, I first draw a schematic (see link for an EAGLE 5 file), then added/changed some resistors:
- Changed the two 51R transistor base resistors to 10 KOhm.
- Added three 51R resistors in series to the signal lines TDI, TCK and TMS.
- The jumper from pin 7 DB25 to pin 11 JTAG allows to drive a LED for wiggler2 mode, see link. The LED can show the access of the JTAG interface in OpenOCD V.0.5.
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.
- Add a 4k7 pullup resistor (Dockstar R166) to the TRST line, so you need not to solder on the Dockstar board.
- RP1 (4 x 4k7) on the Dockstar board is not populated with resistors.
- The pins of SV2 were added to connect easily to a Logic analyzer.
- Because the 74HC125 has a push-pull output, no further pull up resistors are needed.
- The supply voltage is delivered from the target circuit (Dockstar).
In order to have a reference of the signal timing I will attach a Logic Analyzer printout.
Some explanation to the signals:
The trigger was set to the rising edge of clock.
- nTRST must usually be high, because of the pull up resistor R166.
- TMS is usually low.
The openOCD configuration files need the following setup:
board/dockstar_w.cfg
source [find interface/parport.cfg]
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 with Coolterm.app 115000 baud, no handshake, or $ 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 board
There is a low cost universal debugging board Bus-Pirate on the market. It can be ordered from http://watterott.com, please see also at the Links.
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. 2013-11-25 firmware update to 6.1.
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 or use CoolTerm.app with 115000 baud, no handshake, or $ screen /dev/tty.usbserial-A800F1FF 115200 HiZ> i Bus Pirate v3.5 Firmware v6.1 r1676 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
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:
- Add a 4k7 pullup resistor (Dockstar R166) to the TRST line, so you need not to solder on the Dockstar board.
- RP1 (4 x 4k7) on the Dockstar board is not populated with resistors.
The supply voltage is not delivered from the target circuit (Dockstar).
Plug in both USB cables only after the openOCD computer (Linux) is powered up. Connect first the USB cable from Bus Pirate, then from Dockstar, in order to get the correct numbering.
- Check if both USB-Serial ports are alive (#1 is Bus Pirate, #2 is Serial Link to Dockstar):
$ 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
Setup of OpenOCD
Download the latest source code, please see at Links and build (Ubuntu 12.04):
$ cd to openocd folder $ ./configure --enable-buspirate --enable-maintainer-mode # delay patch for buspirate speed FAST # edit file src/jtag/drivers/buspirate.c (line 773 in version 0.7) /* here the adapter changes speed, we need follow */ usleep(200); // sleep 200 us, to allow for change buspirate_serial_setspeed(fd, speed); usleep(200); // sleep 200 us $ make $ sudo make install
Download the already prepared configuration file dockstar.cfg from the Links.
The openOCD configuration files in /usr/local/share/openocd/scripts/ need the following setup:
Copy dockstar.cfg to board/dockstar_bp.cfg (owner root) and edit:
source [find interface/buspirate.cfg]
Edit interface/buspirate.cfg (owner root)
# 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 - works only with delay patch in src/jtag/drivers/buspirate.c buspirate_speed fast # voltage regulator Enabled = 1 Disabled = 0 #buspirate_vreg 0 buspirate_vreg 0 # pin mode normal or open-drain #buspirate_mode normal buspirate_mode open-drain # pullup state Enabled = 1 Disabled = 0 #buspirate_pullup 0 buspirate_pullup 0 # this depends on the cable, you are safe with this option reset_config srst_only
Use of openOCD with Dockstar and Bus Pirate
- Open 3 Terminal instances in parallel and try to connect with openOCD to the JTAG port of Dockstar.
If the halt command does not work, try with soft_reset_halt, or replug the USB cables and start again.
# in Terminal #1 instance connect to Dockstar Serial port $ screen /dev/ttyUSB1 115200 or use PUTTY # 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) # buspirate speed "normal" needs 778 s (0.89 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.
Links
JTAG_Wiggler_Dockstar Interface cable schematic in EAGLE 5 format
Gonemad's Bus Pirate/OpenOCD walk through, Bus Pirate Firmware Update
Good explanation to ARM (Marvell Feroceon CPU) JTAG and OpenOCD, Troubleshooting
JTAG_BusPirate_Dockstar Interface cable schematic in EAGLE 5 format
JTAG_BusPirate_Dockstar Interface cable schematic PDF format
List of pages in this category:
-- RudolfReuter 2011-12-06 05:48:56
Go back to CategoryDockStar or FrontPage ; KontaktEmail (ContactEmail)