Dockstar Debricking - JTAG with BusPirate

Rédigé par RedoX - 12 février 2011

I recently bricked my Seagate Dockstar, so I had to use JTAG to restore it...
At the time, I didn't have any JTAG adapter. I tried with a parport Wiggler, but without the correct chip (I only had 74HC244, instead of 74LS244) it didn't work. So I bought a BusPirate (from Sparkfun). And so, here's the story of the Dockstar...

Disclaimer

By following these steps, you agree that I can't be held for responsible if your Dockstar happened to be really broken or if you break it during the process I describe. I'm just writing my experience in case it could help someone (or me later) but I'm not responsible if things go wrong. Don't screw up, read all the process first, don't try hazardous things, if you have questions, ask first...

Here we go !

There are some preliminary steps as the BusPirate received from Sparkfun didn't have OpenOCD JTAG capabilities. There shouldn't be any error or timeout during the JTAG steps. Check everything if you have any.

  • Upgrade the BusPirate Bootloader to v4 and Firmware to v4.1
    python2.7 ./P24qp.py -s /dev/ttyUSB0 -i -v
    python2.7 ./P24qp.py -s /dev/ttyUSB0 -i -v -a ./BPv3-v2blupdaterVa3-v4.1.hex 
    cu -l /dev/ttyUSB0 -s 115200
    yes
    ./pirate-loader_lnx --dev=/dev/ttyUSB0 --hex=/home/redox/v4firmware/BPv3-Firmware-v4.1.hex
  • Upgrade the BusPirate Bootloader to v4.3 and Firmware to v5.8 with the pirate_loader tool.
  • Now, the Buspirate is ready to be an OpenOCD adapter
  • Compile OpenOCD from GIT, with option --enable-bus-pirate
  • Configure OpenOCD buspirate.cfg. Here's mine:
    interface buspirate
    buspirate_port /dev/ttyUSB0
    buspirate_speed fast
    buspirate_vreg 0
    buspirate_mode open-drain
    buspirate_pullup 0
    reset_config srst_only
    
  • Do some changes in dockstar.cfg
    Here's mine (adapted from Kragorn's original file): dockstar.cfg
  • Connect the BusPirate and the Serial Adapter to the Dockstar's JTAG header
    Dockstar -- Bus Pirate (Wire colors from Sparkfun cable)
    01 - NC
    02 - Aux (Green)
    03 - TDI (Orange)
    04 - TMS (Red)
    05 - TCK (Yellow)
    06 - TDO (Brown)
    07 - NC
    08 - TXD of the Serial Adapter
    09 - RXD of the Serial Adapter
    10 - GND (Black)?
  • Plug the Dockstar power supply
  • Plug the BusPirate and the Serial Adapter
  • Start OpenOCD server
    openocd -f ./dockstar.cfg
  • Open an other Term and connect by telnet to the server
    telnet localhost 4444
  • Open an other Term and open the serial connection
    cu -s 115200 -l /dev/ttyUSB1
  • Download a valid uBoot mtd0 image, renamed in uboot.kwb (easier to type later). I used this one (from Jeff Doozan): Link
  • In the telnet term:
    • Type "init" then press Enter
    • Type "halt" then hold the Dockstar's reset button, then press Enter, then release the button
    • The Dockstar should be halted
    • Type "dockstar_init" then press Enter
    • Type "load_image uboot.kwb 0x800000" then press Enter and wait ~ 90sec
    • Type "resume 0x800200" then press Enter, the Dockstar should be booting now...
  • In the serial terminal:
    • Hit a key to stop the boot process
    • Type "nand write.e 0x800000 0x0 0x80000" then press Enter to restore uBoot in Nand
    • When it's done, type" reset", press Enter, you should see your dockstar booting correctly
  • You should now be able to recover/reinstall your Dockstar by Tftp as already well explained on the Internet

RedoX

Classé dans : Dev, Linux, Dockstar - Mots clés : Dockstar, JTAG, BusPirate

12 commentaires

jeudi 24 juillet 2014 @ 00:45 lunettes vue a dit : #1

lentilles trouver vente en ligne oeil lunettes de soleil ophtalmologie Spectre lumineux en ligne maladie opticien

mercredi 23 juillet 2014 @ 22:04 lunettes de vue a dit : #2

opticien trouver achat en ligne visuel lunettes de soleil Presbytie vue en ligne maladie verres toriques

dimanche 01 juin 2014 @ 23:00 rachat de pret propriétaire a dit : #3

Merci for all

lundi 26 mai 2014 @ 17:25 alarme maison pas cher a dit : #4

Vente télésurveillance filaire surveillance kit alarme se protéger meilleur prix alarme maison pas chère installation sans fil filaire equipement

jeudi 07 février 2013 @ 14:29 murpf a dit : #5

hey, i used a seeedstudio cable, but i can't get it to halt in ARM state. Everytime its just in thumb mode where it can't access nand. Is there a better way to get into ARM mode (tried the reset-halt approach at least a hundred times...)

thanks

dimanche 02 octobre 2011 @ 09:54 RedoX a dit : #6

J'avoue ne pas avoir assez de connaissances dans ce domaine pour avoir remarqué ça, et ca fonctionnait tel quel ^^

Merci pour cette modification. C'est corrigé :)

jeudi 29 septembre 2011 @ 00:00 exxos a dit : #7

Il y a une petit erreur dans le fichier de dockstar.cfg

$_TARGETNAME configure \
-work-area-phys 0x100000 \
-work-area-size 65536 \
-work-area-backup 0

Amicalement.

mardi 14 juin 2011 @ 11:46 Charles a dit : #8

Thank you very much for this howto, I just resurrected my Dockstar \o/

I just encountered one problem: I was plugging the serial adapter first, before the buspirate, so the buspirate got the device ID /dev/ttyUSB1, I modified the buspirate.cfg to reflect this change, but I continualy got errors when trying to hald the dockstar.
Plugging the buspirate first (and in another USB port, don't know if this matters) so that he was recognised under /dev/ttyUSB0 solved the problems.
Looks strange (software bug ? or brain bug ?), but it worked...

samedi 04 juin 2011 @ 22:32 RedoX a dit : #9

Glad it's useful.

RedoX

lundi 23 mai 2011 @ 02:24 jasonldf a dit : #10

Thanks, these steps reserrected my dockstar. I had to vary the color code as I was using SeeedStudio Bus Pirate cable and I did a nand erase as my problem was a corrupted uboot environment but the steps worked for me as well

dimanche 10 avril 2011 @ 11:49 RedoX a dit : #11

I think you have this problem because your buspirate.cfg is not correct (should be in /usr/share/openocd/scripts/interface).Check your parameters.

I have the same problem if I remove the line buspirate_port in my config file.

Else, without being connected to the dockstar, you should have this kind of result:

[redox@RedoX JTAG]$ openocd -f ./dockstar.cfg
Open On-Chip Debugger 0.5.0-dev-00746-g177fe9d (2011-02-11-20:57)
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
Error: Error reading data
Error: Buspirate error. Is is binary//OpenOCD support enabled?

dimanche 10 avril 2011 @ 10:21 md a dit : #12

thank you for this excellent tutorial, I have hit a bump though, when I try to run the last "openocd -f ./dockstar.cfg" it appears to run but stops with


Warn : use 'feroceon.cpu' as target identifier, not '0'
dockstar_reset_cpu
Error: You need to specify port !
in procedure 'init'


does this mean my buspirate.cfg is wrong? I'm not sure what it's catching on

Écrire un commentaire

 Se rappeler de moi sur ce site

Capcha
Entrez le code de l'image : 

Derniers articles

Derniers commentaires

Archives

Mots clés

RSS