OpenOCD compatibility [message #1772636]

For several years I have been using a ‘handmade’ build of Eclipse, Zylin, OpenOCD 0.7.0, arm-none-eabi-gdb (downloaded from CodeSourcery) and an Olimex ARM-USB-OCD interface. I created an External Tools Configuration (which I named Olimex OpenOCD) and the following OpenOCD.cfg file:

# Configuration file to initialise openocd for a Mega_Link target
# via an Olimex ARM-USB-OCD
#debug_level 3
# source interface
source [find interface/olimex-arm-usb-ocd.cfg]
# source target
source [find target/stm32f1x.cfg]
init
reset

This works as expected. When I run it the Console shows the following

Open On-Chip Debugger 0.7.0 (2013-05-05-10:41)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
cortex_m3 reset_config sysresetreq
Info : clock speed 1000 kHz
Info : JTAG tap: stm32f1x.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32f1x.bs tap/device found: 0x06430041 (mfg: 0x020, part: 0x6430, ver: 0x0)
Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : JTAG tap: stm32f1x.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32f1x.bs tap/device found: 0x06430041 (mfg: 0x020, part: 0x6430, ver: 0x0)

First Problem:

I tried to upgrade to OpenOCD 0.8.0, but it gives the following errors:

GNU ARM Eclipse 64-bits Open On-Chip Debugger 0.10.0-00113-g0f83948 (2017-01-24-18:48)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
openocd.cfg:8: Error: Can't find interface/olimex-arm-usb-ocd.cfg
in procedure 'script' 
at file "embedded:startup.tcl", line 60
at file "openocd.cfg", line 8
Error: Debug Adapter has to be specified, see "interface" command
openocd.cfg:8: Error: 
in procedure 'script' 
at file "embedded:startup.tcl", line 60
at file "openocd.cfg", line 8

It states that it couldn’t find the Olimex driver. I looked at the openocd/scripts/interface folder and realised that the driver is in the /ftdi sub-folder, so I modifying the cfg file as follows:

# source interface
source [find interface/ftdi/olimex-arm-usb-ocd.cfg]

This makes a difference (why isn’t it needed in OpenOCD 0.7.0?), but now gives the following error message:

GNU ARM Eclipse 64-bits Open On-Chip Debugger 0.10.0-00113-g0f83948 (2017-01-24-18:48)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
none separate
cortex_m reset_config sysresetreq
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Error: libusb_open() failed with LIBUSB_ERROR_NOT_FOUND
Error: no device found
Error: unable to open ftdi device with vid 15ba, pid 0003, description 'Olimex OpenOCD JTAG', serial '*' at bus location '*'

I then created a new instance of Eclipse Mars and ran GNU MCU Eclipse Plug-ins - http://gnu-mcu-eclipse.netlify.com/v4-neon-updates from the marketplace. This installs OpenOCD 0.10.0 in the folder C:\Program Files\GNU ARM Eclipse. It creates an External Tool Configuration named GDB OpenOCD which references this file. However, when I run it, it generates the same error message as above.

Can anyone explain how I overcome this?

Second Problem

In my original instance of Eclipse I created an instance of Zylin to run the arm-none-eabi-gdb debugger that I downloaded from CodeSourcery. I created a file named Target.ini and defined it as the GDB command file:

target remote localhost:3333
mon reset init
load
mon reset init
#mon cortex_m vector_catch
#info registers
#define hook-continue
#mon cortex_m maskisr off
#end
#define hook-stop
#mon cortex_m maskisr on
#end
#define hookpost-stop
#mon cortex_m maskisr off
#end
define hook-step
mon cortex_m maskisr on
end
define hookpost-step
mon cortex_m maskisr off
end
define hook-stepi
mon cortex_m maskisr on
end
define hookpost-stepi
mon cortex_m maskisr off
end
define hook-next
mon cortex_m maskisr on
end
define hookpost-next
mon cortex_m maskisr off
end
define hook-nexti
mon cortex_m maskisr on
end
define hookpost-nexti
mon cortex_m maskisr off
end
define hook-run
mon cortex_m maskisr on
end
define hookpost-run
mon cortex_m maskisr off
end
#mon reset run

I can debug my project and everything works as expected.

The GNU MCU Eclipse Plug-ins version has already created an instance of GDB OpenOCD Debugger with the project name. The Debugger tab shows the Executable as ${openocd_path}/${openocd_executable} and the Actual Executable as C:/Program Files/GNU MCU Eclipse/OpenOCD/0.10.0-3-20170826-1813-dev/bin/openocd.exe. I have entered Target.ini in the Config options box. However, when I run it I get the message

Error while launching command: gdb --version

How should I configure GDB OpenOCD Debugger?