leiradel
Posts: 32
Joined: Wed Feb 13, 2019 10:38 pm

JTAG with the FT232H

Tue Jun 25, 2019 10:28 pm

Hi All,

I'm trying to use a FT232H board to debug baremetal code running on a Raspberry Pi 3 A+ using OpenOCD.

I've compiled OpenOCD from source using ./configure --enable-ftdi, and I've copied the supplied contrib/60-openocd.rules to /etc/udev/rules.d.

I've created the following configuration file for FT323H:

Code: Select all

interface ftdi
ftdi_vid_pid 0x0403 0x6014

# https://forum.sparkfun.com/viewtopic.php?t=46655
ftdi_layout_init 0x0008 0x400b

# https://lb.raspberrypi.org/forums/viewtopic.php?t=209463
#ftdi_layout_init 0xfff8 0xfffb
#ftdi_layout_init 0x0818 0x0cfb
#ftdi_layout_init 0x0008 0x00fb
#ftdi_layout_init 0x0018 0x00fb

The vendor and product IDs match what appears in dmesg when I plug in the board:

Code: Select all

[367996.658816] usb 1-2.3: new high-speed USB device number 17 using xhci_hcd
[367996.875155] usb 1-2.3: New USB device found, idVendor=0403, idProduct=6014
[367996.875162] usb 1-2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[367996.880884] ftdi_sio 1-2.3:1.0: FTDI USB Serial Device converter detected
[367996.881055] usb 1-2.3: Detected FT232H
[367996.881404] usb 1-2.3: FTDI USB Serial Device converter now attached to ttyUSB0

I'm using this file to configure the board. I've wired the FT232H board to the RPi using this document and this document like this:

  • 5V to physical pin 4
  • Gnd to physical pin 6
  • D0 to physical pin 22 (TCK)
  • D1 to physical pin 37 (TDI)
  • D2 to physical pin 18 (TDO)
  • D3 to physical pin 13 (TMS)
My SD card has this config.txt file, which as far as I know will pre-configure the JTAG pins using the ALT4 group:

Code: Select all

enable_jtag_gpio=1

I've tried all the different ftdi_layout_init values but the result is always the same:

Code: Select all

$ src/openocd -f ../barebones-rpi/barebones09/openocd/ft232h.cfg -f ../barebones-rpi/barebones09/openocd/raspberry.cfg 
Open On-Chip Debugger 0.10.0+dev-00920-g6ea43726 (2019-06-25-20:17)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 1000 kHz
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: rpi3.tap: IR capture error; saw 0x0f not 0x01
Warn : Bypassing JTAG setup events due to errors
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR

I've searched around to no avail. Does anyone know what the problem could be?

Thanks in advance,

Andre

Bakul Shah
Posts: 320
Joined: Sun Sep 25, 2011 1:25 am

Re: JTAG with the FT232H

Wed Jul 10, 2019 9:54 pm

Perhaps this page may help you? BARE METAL RASPBERRY PI 3B+: JTAG

welford
Posts: 20
Joined: Fri Jun 29, 2012 12:05 am

Re: JTAG with the FT232H

Sun Jul 28, 2019 2:57 pm

Hi Andre,

Have you had any luck with this? I've spent a little time trying to get the adafruit FT232H working, using the guide Bakul linked to as well as the many helpful posts dwelch67 has made (e.g. https://www.raspberrypi.org/forums/view ... 1#p1298657 ) but not had any luck so far.

where i am now i have

Code: Select all

Error: JTAG scan chain interrogation failed: all zeroes
(and "all ones" if the jtag is not plugged in)

Code: Select all

\OpenOCD-20190715-0.10.0\bin\openocd.exe -f .\scripts\ft232h.cfg -f .\scripts\rpi.cfg
Open On-Chip Debugger 0.10.0 (2019-07-15) [https://github.com/sysprogs/openocd]
Licensed under GNU GPL v2
For bug reports, read  http://openocd.org/doc/doxygen/bugs.html
jtag
raspi.arm
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 1000 kHz
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: raspi.arm: IR capture error; saw 0x1f not 0x01
Warn : Bypassing JTAG setup events due to errors
Error: 'arm11 target' JTAG error SCREG OUT 0x1f
Error: unexpected ARM11 ID code
Some places suggest that this is a wiring issue, but i can connect the same wires to my j-link and it works with no problems. The j-link edu is so much less hassle when compared to this - it just works with either the basic segger tools or openocd.

Return to “Bare metal, Assembly language”