# OpenOCD and JTAG adapters?



## tingo (May 4, 2014)

Ok, so it seems like I bricked my Seagate Dockstar, just before I was starting to test crochet builds of FreeBSD on it. Now it doesn't even output anything to serial. 
I see that OpenOCD 0.7.0 is in ports devel/openocd, and I have a GoodFET42 adapter. But it doesn't appear to be supported by OpenOCD, at least not the version in ports.
Does anyone know about any other cheap JTAG adapters (preferably usb connected) that works with OpenOCD 0.7.0?


----------



## tingo (May 6, 2014)

Duh! I have a Stellaris LaunchPad (EK-LM4F120XL), it can be used as a JTAG adapter and it is supported in OpenOCD 0.7.0.
On a FreeBSD 10.0-release machine:

```
tingo@kg-v7$ uname -a
FreeBSD kg-v7.kg4.no 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014
     root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
root@kg-v7# openocd -f /usr/local/share/openocd/scripts/board/ek-lm4f120xl.cfg
Open On-Chip Debugger 0.7.0 (2014-05-04-20:48)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : This adapter doesn't support configurable speed
Info : ICDI Firmware version: 9270
Info : lm4f120h5qr.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting 'telnet' connection from 4444
```
Now I just need to solder some pins to the LaunchPad.


----------



## balanga (Dec 7, 2017)

Any progress - three years later? 

I've just bricked my GoFlexHome unit after re-installing U-Boot...

Initially, it appeared to be bricked but I was able to access it using `kwboot` which unfortunately doesn't work on FreeBSD. Then after a reboot, not even `kwboot` could wake it up, so now I'm investigating the 'joys' of JTAG.


----------



## tingo (Dec 8, 2017)

No, I haven't played with it any more. I still have that DockStar, and now I have even more possible JTAG adapters, perhaps I should try again.


----------



## balanga (Dec 9, 2017)

tingo said:


> No, I haven't played with it any more. I still have that DockStar, and now I have even more possible JTAG adapters, perhaps I should try again.



Perhaps you should . Just wondered how you connect a JTAG adapter to a Dockstar....


----------



## balanga (Dec 9, 2017)

tingo said:


> No, I haven't played with it any more. I still have that DockStar, and now I have even more possible JTAG adapters, perhaps I should try again.



I just came across this 

Maybe it's useful... Not sure if this would work under FreeBSD.


----------



## tingo (Dec 11, 2017)

You connect the JTAG adapter to the JTAG port on the DockStar 
Thanks for the link. The BusPirate should work with FreeBSD as long as as OpenOCD is recent enough and has been compiled with the right options.


----------



## balanga (Dec 12, 2017)

I've never seen a JTAG connector so didn't know what to look for, but it would appear that there isn't one on a GoFlexHome...

https://images.anandtech.com/doci/3955/baseunitinside_575px.jpg

so I guess my unit is well and truly bricked ...


----------



## chrbr (Dec 12, 2017)

If you have good luck the 2x5 pin connector on the right botton side is your candidate. But the hardware interface can be also realized as tiny pads on the PCB to save the money and the space for the connector. May be you find prints as* TDI, TDO, TMS, TCK* somewhere on the PCB. Good luck!


----------



## tingo (Dec 12, 2017)

FWIW, on the DockStar it is the same 10-pin connector / pin header where you connect the serial adapter. It looks like this (seen from the front of the DockStar, with the ethernet port pointing away from you)

```
TCK  TMS TDI -TRST VCC
  9    7    5    3  1
 10    8    6    4  2
TDO -SRST RX   TX  GND 3.3V!
```
Note: the signals on this adapter is 3.3 volts, not 5 volts.


----------



## balanga (Dec 12, 2017)

tingo said:


> FWIW, on the DockStar it is the same 10-pin connector / pin header where you connect the serial adapter. It looks like this (seen from the front of the DockStar, with the ethernet port pointing away from you)
> 
> ```
> TCK  TMS TDI -TRST VCC
> ...




Is this the sort of thing I need to connect to my GoFlexHome?


----------



## tingo (Dec 13, 2017)

It looks like it, but I can't be sure.
I used a home made adapter (some kind of hard drive adapter that I had and jumper wires with female connectors) that I connected to my Bus Pirate.
FWIW, I used this blog post for my DockStar. It has a nice schematic on how to connect the Bus Pirate to the JTAG connector on the DockStar.


----------

