Using the latest code, git revision 334e94, compiled and running under Ubuntu 16.04, an Olimex ARM-USB-OCD-H adapter is correctly identified by the "cable probe" command but fails to detect the jtag chain of a connected STM32F4 device. The returned message indicates TDO is stuck at 0.
The exact same hardware setup is working using OpenOCD git revision (2b47de). In both cases the frequency is set to 1MHz. Using an oscilloscope to monitor the signals, TCK and TDI have activity but TMS and TDO remain low. It appears that TMS is not enabled properly which could be a problem with initialization.
By following the initialization sequence, differences were observed between OpenOCD and UrJTAG. We were able to get UrJTAG working with the ARM-USB-OCD-H adapter by applying the following code changes. However, this may not be optimal so hopefully someone with a better understanding of the FT2232H can implement an appropriate correction.
diff --git a/urjtag/src/tap/cable/ft2232.c b/urjtag/src/tap/cable/ft2232.c
index 4710737..a6298f0 100644
--- a/urjtag/src/tap/cable/ft2232.c
+++ b/urjtag/src/tap/cable/ft2232.c
@@ -480,7 +480,7 @@ ft2232_armusbocd_init_common (urj_cable_t cable, int is_ft2232h)
TSRST = 1
RED LED on /
params->high_byte_value = BITMASK_ARMUSBOCD_nTRST
- | BITMASK_ARMUSBOCD_nTSRST | BITMASK_ARMUSBOCD_RED_LED;
+ | BITMASK_ARMUSBOCD_RED_LED;
params->high_byte_dir = BITMASK_ARMUSBOCD_nTRST
| BITMASK_ARMUSBOCD_nTRST_nOE
| BITMASK_ARMUSBOCD_nTSRST | BITMASK_ARMUSBOCD_RED_LED;
@@ -490,6 +490,10 @@ ft2232_armusbocd_init_common (urj_cable_t *cable, int is_ft2232h)
urj_tap_cable_cx_cmd_push (cmd_root, SET_BITS_HIGH);
urj_tap_cable_cx_cmd_push (cmd_root, params->high_byte_value);
urj_tap_cable_cx_cmd_push (cmd_root, params->high_byte_dir);
+ // from openOCD
+ urj_tap_cable_cx_cmd_push (cmd_root, 0x85); // no loop back
+ urj_tap_cable_cx_cmd_push (cmd_root, 0x97); // no adaptive
+ urj_tap_cable_cx_cmd_push (cmd_root, 0x8a); // no div by 5
if (is_ft2232h)
ft2232h_set_frequency (cable, FT2232H_MAX_TCK_FREQ);
The above patch with white space manually re-inserted
It is also available in git branch bug128