April 29, 2024, 03:00:15 AM

ARM-USB-OCD-H Driver Issue

Started by Redwing, July 13, 2023, 05:43:52 PM

Previous topic - Next topic

Redwing

I have recently purchased an Olimex ARM-USB-OCD-U debugger but am experiencing a driver issue. I used Zadig to install WinUSB (v6.1.7600.16385) drivers for ARM-USB-OCD-H (both interfaces 0 and 1).
https://imgur.com/a/Rjl58i3
https://imgur.com/a/eb11sSZ

After restarting my computer (Windows 10 Enterprise - x64), and connecting the ARM-USB-OCD-H (USB-C <-> USB-C), the yellow light turns solid, and it appears as a USB device:
https://imgur.com/a/BPue8wJ

Using the precompiled OpenOCD 0.9.0 found here: 0.9.0Freddiechoppin.info, I navigated to the bin-x64 folder and added the olimex-arm-usb-ocd-h ftdi interface config file, after adding the following two lines to the end, for auto probing:
reset_config trst_and_srst
jtag_rclk 8 

The config file (olimex-arm-usb-ocd-h-autprobe.cfg) looks like this:
#
# Olimex ARM-USB-OCD-H
#
# http://www.olimex.com/dev/arm-usb-ocd-h.html
#
interface ftdi
ftdi_device_desc "Olimex OpenOCD JTAG ARM-USB-OCD-H"
ftdi_vid_pid 0x15ba 0x002b
ftdi_layout_init 0x0908 0x0b1b
ftdi_layout_signal nSRST -oe 0x0200
ftdi_layout_signal nTRST -data 0x0100
ftdi_layout_signal LED -data 0x0800
reset_config trst_and_srst
jtag_rclk 8

I am connected to a target at this point (20-pin ICE JTAG).
From a GIT bash MINGW terminal in the bin-x64 folder, I run:
$ ./openocd -f olimex-arm-usb-ocd-h-autprobe.cfg

Which yields:
Open On-Chip Debugger 0.9.0-rc1 (2015-04-24-22:09)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain connect_deassert_srst
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
RCLK - adaptive
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Info : RCLK (adaptive clock speed)
Warn : There are no enabled taps.  AUTO PROBING MIGHT NOT WORK!!

For a more verbose output, I re-ran with the -d3 debug flag, which yielded:
Open On-Chip Debugger 0.9.0-rc1 (2015-04-24-22:09)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
User : 13 0 command.c:546 command_print(): debug_level: 3
Debug: 14 0 options.c:98 add_default_dirs(): bindir=bin-x64
Debug: 15 0 options.c:99 add_default_dirs(): pkgdatadir=
Debug: 16 0 options.c:100 add_default_dirs(): run_prefix=C:/Users/dhaymes/Desktop/o/openocd-0.9.0-rc1/
Debug: 17 0 configuration.c:44 add_script_search_dir(): adding C:\Users\dhaymes/.openocd
Debug: 18 0 configuration.c:44 add_script_search_dir(): adding C:\Users\dhaymes\AppData\Roaming/OpenOCD
Debug: 19 0 configuration.c:44 add_script_search_dir(): adding C:/Users/dhaymes/Desktop/o/openocd-0.9.0-rc1//site
Debug: 20 0 configuration.c:44 add_script_search_dir(): adding C:/Users/dhaymes/Desktop/o/openocd-0.9.0-rc1//scripts
Debug: 21 0 configuration.c:84 find_file(): found olimex-arm-usb-ocd-h-autprobe.cfg
Debug: 22 0 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_interface ftdi
Debug: 23 0 command.c:145 script_debug(): command - interface ocd_interface ftdi
Debug: 25 0 command.c:366 register_command_handler(): registering 'ocd_ftdi_device_desc'...
Debug: 26 0 command.c:366 register_command_handler(): registering 'ocd_ftdi_serial'...
Debug: 27 16 command.c:366 register_command_handler(): registering 'ocd_ftdi_channel'...
Debug: 28 16 command.c:366 register_command_handler(): registering 'ocd_ftdi_layout_init'...
Debug: 29 16 command.c:366 register_command_handler(): registering 'ocd_ftdi_layout_signal'...
Debug: 30 16 command.c:366 register_command_handler(): registering 'ocd_ftdi_set_signal'...
Debug: 31 16 command.c:366 register_command_handler(): registering 'ocd_ftdi_vid_pid'...
Debug: 32 16 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_ftdi_device_desc Olimex OpenOCD JTAG ARM-USB-OCD-H
Debug: 33 16 command.c:145 script_debug(): command - ftdi_device_desc ocd_ftdi_device_desc Olimex OpenOCD JTAG ARM-USB-OCD-H
Debug: 35 16 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_ftdi_vid_pid 0x15ba 0x002b
Debug: 36 16 command.c:145 script_debug(): command - ftdi_vid_pid ocd_ftdi_vid_pid 0x15ba 0x002b
Debug: 38 16 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_ftdi_layout_init 0x0908 0x0b1b
Debug: 39 16 command.c:145 script_debug(): command - ftdi_layout_init ocd_ftdi_layout_init 0x0908 0x0b1b
Debug: 41 16 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_ftdi_layout_signal nSRST -oe 0x0200
Debug: 42 16 command.c:145 script_debug(): command - ftdi_layout_signal ocd_ftdi_layout_signal nSRST -oe 0x0200
Debug: 44 16 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_ftdi_layout_signal nTRST -data 0x0100
Debug: 45 16 command.c:145 script_debug(): command - ftdi_layout_signal ocd_ftdi_layout_signal nTRST -data 0x0100
Debug: 47 16 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_ftdi_layout_signal LED -data 0x0800
Debug: 48 16 command.c:145 script_debug(): command - ftdi_layout_signal ocd_ftdi_layout_signal LED -data 0x0800
Debug: 50 16 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_reset_config trst_and_srst
Debug: 51 16 command.c:145 script_debug(): command - reset_config ocd_reset_config trst_and_srst
User : 53 16 command.c:546 command_print(): trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain connect_deassert_srst
Debug: 54 16 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_transport select
Debug: 55 16 command.c:145 script_debug(): command - ocd_transport ocd_transport select
Info : 56 16 transport.c:287 jim_transport_select(): auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
Debug: 57 16 command.c:366 register_command_handler(): registering 'ocd_jtag_flush_queue_sleep'...
Debug: 58 16 command.c:366 register_command_handler(): registering 'ocd_jtag_rclk'...
Debug: 59 16 command.c:366 register_command_handler(): registering 'ocd_jtag_ntrst_delay'...
Debug: 60 16 command.c:366 register_command_handler(): registering 'ocd_jtag_ntrst_assert_width'...
Debug: 61 16 command.c:366 register_command_handler(): registering 'ocd_scan_chain'...
Debug: 62 28 command.c:366 register_command_handler(): registering 'ocd_jtag_reset'...
Debug: 63 28 command.c:366 register_command_handler(): registering 'ocd_runtest'...
Debug: 64 28 command.c:366 register_command_handler(): registering 'ocd_irscan'...
Debug: 65 28 command.c:366 register_command_handler(): registering 'ocd_verify_ircapture'...
Debug: 66 28 command.c:366 register_command_handler(): registering 'ocd_verify_jtag'...
Debug: 67 28 command.c:366 register_command_handler(): registering 'ocd_tms_sequence'...
Debug: 68 28 command.c:366 register_command_handler(): registering 'ocd_wait_srst_deassert'...
Debug: 69 28 command.c:366 register_command_handler(): registering 'ocd_jtag'...
Debug: 70 28 command.c:366 register_command_handler(): registering 'ocd_jtag'...
Debug: 71 28 command.c:366 register_command_handler(): registering 'ocd_jtag'...
Debug: 72 28 command.c:366 register_command_handler(): registering 'ocd_jtag'...
Debug: 73 28 command.c:366 register_command_handler(): registering 'ocd_jtag'...
Debug: 74 28 command.c:366 register_command_handler(): registering 'ocd_jtag'...
Debug: 75 28 command.c:366 register_command_handler(): registering 'ocd_jtag'...
Debug: 76 28 command.c:366 register_command_handler(): registering 'ocd_jtag'...
Debug: 77 28 command.c:366 register_command_handler(): registering 'ocd_jtag'...
Debug: 78 28 command.c:366 register_command_handler(): registering 'ocd_jtag'...
Debug: 79 28 command.c:366 register_command_handler(): registering 'ocd_jtag'...
Debug: 80 28 command.c:366 register_command_handler(): registering 'ocd_jtag'...
Debug: 81 28 command.c:366 register_command_handler(): registering 'ocd_jtag'...
Debug: 82 28 command.c:366 register_command_handler(): registering 'ocd_svf'...
Debug: 83 28 command.c:366 register_command_handler(): registering 'ocd_xsvf'...
Debug: 84 28 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_transport select
Debug: 85 28 command.c:145 script_debug(): command - ocd_transport ocd_transport select
Debug: 86 28 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_jtag_rclk 8
Debug: 87 28 command.c:145 script_debug(): command - jtag_rclk ocd_jtag_rclk 8
Debug: 89 28 core.c:1638 jtag_config_rclk(): handle jtag rclk
Debug: 90 28 core.c:1596 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 91 28 core.c:1596 adapter_khz_to_speed(): convert khz to interface specific speed value
User : 92 28 command.c:546 command_print(): RCLK - adaptive
Debug: 93 28 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_init
Debug: 94 28 command.c:145 script_debug(): command - init ocd_init
Debug: 96 28 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_target init
Debug: 97 28 command.c:145 script_debug(): command - ocd_target ocd_target init
Debug: 99 28 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_target names
Debug: 100 28 command.c:145 script_debug(): command - ocd_target ocd_target names
Debug: 101 28 target.c:1313 handle_target_init_command(): Initializing targets...
Debug: 102 28 ftdi.c:625 ftdi_initialize(): ftdi interface using shortest path jtag state transitions
Error: 103 60 mpsse.c:140 open_matching_device(): libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Debug: 104 65 mpsse.c:363 mpsse_purge(): -
Debug: 105 65 mpsse.c:644 mpsse_loopback_config(): off
Debug: 106 65 mpsse.c:689 mpsse_set_frequency(): target 0 Hz
Debug: 107 65 mpsse.c:681 mpsse_rtck_config(): on
Debug: 108 65 core.c:1596 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 109 65 core.c:1599 adapter_khz_to_speed(): have interface set up
Debug: 110 65 mpsse.c:689 mpsse_set_frequency(): target 0 Hz
Debug: 111 65 mpsse.c:681 mpsse_rtck_config(): on
Debug: 112 65 core.c:1596 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 113 65 core.c:1599 adapter_khz_to_speed(): have interface set up
Info : 114 65 core.c:1386 adapter_init(): RCLK (adaptive clock speed)
Debug: 115 65 openocd.c:137 handle_init_command(): Debug Adapter init complete
Debug: 116 65 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_transport init
Debug: 117 65 command.c:145 script_debug(): command - ocd_transport ocd_transport init
Debug: 119 65 transport.c:240 handle_transport_init(): handle_transport_init
Debug: 120 65 core.c:730 jtag_add_reset(): SRST line released
Debug: 121 65 core.c:754 jtag_add_reset(): TRST line released
Debug: 122 65 core.c:328 jtag_call_event_callbacks(): jtag event: TAP reset
Debug: 123 65 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_jtag arp_init
Debug: 124 65 command.c:145 script_debug(): command - ocd_jtag ocd_jtag arp_init
Debug: 125 65 core.c:1397 jtag_init_inner(): Init JTAG chain
Warn : 126 65 core.c:1413 jtag_init_inner(): There are no enabled taps.  AUTO PROBING MIGHT NOT WORK!!
Debug: 127 65 core.c:328 jtag_call_event_callbacks(): jtag event: TAP reset
Debug: 128 65 core.c:1058 jtag_examine_chain(): DR scan interrogation for IDCODE/BYPASS
Debug: 129 65 core.c:328 jtag_call_event_callbacks(): jtag event: TAP reset

Both times, the light on the debugger would go from yellow to red as soon as I ran OpenOCD.
While I don't have a fully formed target configuration file yet, if I'm understanding correctly, there is a problem (libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED) connecting to my Olimex device.

I do not think this is a cable issue, as I have tried this with a USB-C to USB-C as well as a USB-A to USB-C, both with the same result.

Is this a driver issue?

Thank you,

JohnS

The maintainers of libusb broke it (by making the kind of API change you are supposed never to make for such a thing (so/dll)) for a while and have I believe unbroken it.

You probably need a different libusb and/or openocd if it came with it.

You may do better posting on / reading the oocd mailing list.

John

Redwing

Thank you for that information.

Since this was a tested FreddieChoppin opencd release, I'm guessing it isn't the openOCD version. I noticed that my driver date appears as being from 2012, would that have been the version that Zadig installed? If so, wouldn't that have been before libusb broke? And how would that be compatible with windows 10?

https://imgur.com/a/Ba9Py3X

JohnS

I don't know (& am not a Windows user).

John

Redwing

I was able to manually update my Olimex drivers to current libusbK releases, which seems to have quieted the LIBUSB error. Now I am getting another error:
Error: JTAG scan chain interrogation failed: all ones
When I run:
$ ./openocd -f olimex-arm-usb-ocd-h.cfg -f ks869x.cfg
olimex-arm-usb-ocd-h.cfg:
interface ftdi
ftdi_device_desc "Olimex OpenOCD JTAG ARM-USB-OCD-H"
ftdi_vid_pid 0x15ba 0x002b

ftdi_layout_init 0x0908 0x0b1b
ftdi_layout_signal nSRST -oe 0x0200
ftdi_layout_signal nTRST -data 0x0100
ftdi_layout_signal LED -data 0x0800


ks869x.cfg:
# ARM920T CPU

if { [info exists CHIPNAME] } {
   set  _CHIPNAME $CHIPNAME
} else {
   set  _CHIPNAME ks869x
}

adapter_khz 6000

# jtag scan chain
jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0xf -irmask 0xf -expected-id 0xe

set _TARGETNAME $_CHIPNAME.cpu

target create $_TARGETNAME arm920t -endian little -chain-position $_TARGETNAME

$_TARGETNAME configure -work-area-phys 0x10000 -work-area-size 0x40000 -work-area-backup 0

# speed up memory downloads
arm7_9 fast_memory_access enable
arm7_9 dcc_downloads enable

output:
$ ./openocd -f olimex-arm-usb-ocd-h.cfg -f ks869x.cfg
Open On-Chip Debugger 0.9.0-rc1 (2015-04-24-22:09)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
adapter speed: 6000 kHz
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
Warn : ks869x.cpu: nonstandard IR value
fast memory access is enabled
dcc downloads are enabled
Info : clock speed 6000 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...
Warn : Bypassing JTAG setup events due to errors
Info : Embedded ICE version 15
Error: unknown EmbeddedICE version (comms ctrl: 0xffffffff)
Info : ks869x.cpu: hardware has 2 breakpoint/watchpoint units
Warn : ThumbEE -- incomplete support

verbose output (-d3):
Exceeds comment character count, but can post to git if need be.

The Olimex ARM-USB-OCD-H debugger light remains solid green/yellow when the openOCD command is run. The same error is shown when I unplug the debugger from the target chip and run again. The config file is an adaptation of a legacy config file / olimex debugger / openocd version for the same chip: see this thread. Any idea what's going on here?

LubOlimex

#5
This seems like it work somehow, yes it throws errors first but it ends up with:

Info : ks869x.cpu: hardware has 2 breakpoint/watchpoint units

Usually unrecoverable errors drop you out of everything.

You don't need to add custom interface for Olimex debuggers usually. They are already present.

Instead of olimex-arm-usb-ocd-h.cfg try with the config in the FTDI sub-folder like interface/ftdi/olimex-arm-usb-ocd-h.cfg

Try with different versions of OpenOCD but best get the latest ones like 0.11.0 or 0.12.0.

Edit: Notice that I also use Windows 10 x64 and ARM-USB-OCD-H works fine here but sometimes you need to force the drivers. Drivers required depend on the OpenOCD version and with what drivers in mind it was compiled for. The description for driver installation and usage in the manual is good starting point also: https://www.olimex.com/Products/ARM/JTAG/_resources/ARM-USB-OCD_and_OCD_H_manual.pdf
Technical support and documentation manager at Olimex

Redwing

Thank you for that information. I've updated my drivers to the most recent libusb releases and am now using the xpack openocd 0.12 release, as well as the ftdi interface. The same error is persisting, however. Could it be my target configuration file?

if { [info exists CHIPNAME] } {
   set  _CHIPNAME $CHIPNAME
} else {
   set  _CHIPNAME ks869x
}

adapter speed 6000

# jtag scan chain
jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id 0xe

set _TARGETNAME $_CHIPNAME.cpu

target create $_TARGETNAME arm920t -endian little -chain-position $_TARGETNAME

$_TARGETNAME configure -work-area-phys 0x10000 -work-area-size 0x40000 -work-area-backup 0

LubOlimex

Could be. Unfortunately, only the OpenOCD community can help you if this is the case. Still my advice is to test with another, simpler target, just to confirm if the issue is related to the chip in question or its config. I usually test my setup with some popular STM32 chip like STM32F107, STM32F207, or STM32F407, ST chips have good support in OpenOCD so if you have a board like that laying around I will first test with it. But even if you don't any lower density ARM chip is a good target to test.
Technical support and documentation manager at Olimex