# JTAG



## balanga (Dec 6, 2017)

?Anyone familiar with JTAG?

I appear to have bricked my GoFlexHome unit and read somewhere that I may be able to diagnose the problem using JTAG...  If that is the case where would I start?


----------



## SirDice (Dec 6, 2017)

JTAG debugging requires specific hardware to connect to the JTAG ports on the board.

https://en.wikipedia.org/wiki/JTAG


----------



## chrbr (Dec 6, 2017)

Regarding the software please have a look at the output as

```
$ psearch jtag
devel/avarice             Atmel AVR JTAG programmer and debugging interface for avr-gdb
devel/stlink              STM32 ST-Link JTAG variant tools
devel/urjtag              Extended utility to work with JTAG-aware boards
```
May be the ports include information about the required or recommended interface hardware, too.

If not you could have a look at JTAG adaptors for FPGA. As far as I know there are schematics in the net. There is no need for an ultra high-speed clock since it is controlled from the host. Dig for stuff which is useful to configure Xilinx or Altera devices. Äh(tm) you might want to use something to interface the good old parallel port or so.


----------



## balanga (Dec 7, 2017)

SirDice said:


> JTAG debugging requires specific hardware to connect to the JTAG ports on the board.
> 
> https://en.wikipedia.org/wiki/JTAG



I found this intriguing article - Repair Pogo E02 with Raspberry PI (1,2 or 3) JTAG and OpenOCD

Seems fairly complicated, but since I already have an RPi, I'll see if I can make any sense of the instructions...


----------



## balanga (Jun 28, 2018)

So I've got my Bus Pirate, bricked GoFlex Home dock, JTAG cable,  a FreeBSD system with OpenOCD installed, what I can't figure out is how to wire it up...

I found the following diagram here :-https://wiki.openwrt.org/toh/seagate/goflexnet#recovery_bricked_uboot_of_goflexnet_buspirate_cygwin 


```
(Seeed Studio BusPirate - GoFlex.net)  (GoFlex.net - Seeed Studio BusPirate)
(            nc         -   1  nc   )  ( 10  GND   -    serial cable GND   )
(     6  blue   (aux)   -   2  IN   )  (  9  RxD   -    serial cable TxD   )
(     8  gray   (mosi)  -   3  TDI  )  (  8  TxD   -    serial cable RxD   )
(     9  white  (cs)    -   4  TMS  )  (  7  CN    -           nc          )
(     7  purple (clk)   -   5  TCK  )  (  6  DOT   -    10  black (miso)   )
power on goflex.net, serial, buspirate
```

And whilst the GoFlex side of things looks quite clear, the BusPirate side does match up with the labels on the board.... 

I can see where pins 2 3 4 5 6 10 on the GoFlex are connected to, but what about pins 1 7 8 9 ? No pins are labelled RxD or TxD on the BP, the missing labels are +5V VPU 3V3 ADC. I take it that pins 1 7 on GoFlex are not connected. 

How are the TxD and RxD pins labelled on the BP? 

Apologies for the dumb question but I'm a real novice when it comes to electronics.

I notice that when you install OpenOCD there is a warning that this software can damage your hardware, so I'm a bit hesitant in 
trying it...


----------



## tingo (Jun 28, 2018)

You need a usb to serial adapter too(for the console on the GoFlex). In this configuration, the Bus Pirate acts as the JTAG adapter.


----------



## balanga (Jun 29, 2018)

So I need to use two USB ports.... the serial adapter connects to three pins on the GoFlex Home and the Bus Pirate connects to five leaving two not connected.  I wouldn't have been able to figure that out myself....

Wonder how far I'll get with this tomorrow.


----------

