---

**[tickets:#455] Unable to launch OpenOCD with st-link (nucleo) on Mac OS**

**Status:** new
**Milestone:** 0.10.0
**Created:** Wed Apr 09, 2025 05:01 AM UTC by Dario Muller
**Last Updated:** Wed Apr 09, 2025 05:01 AM UTC
**Owner:** nobody


Hi all,

So far I have been able to get OpenOCD up and running with an st-link debugger 
(from a nucleo deb-board) on macOS (Sequoia 15.3.2 (24D81)). 

The debuggers I am using are broken off from:
- stm8s-discovery
-NUCLEO-F446RE

I've had good success on my linux devices (RPi/with busybox and a system 
running Fedora Workstation) so long as I made sure the debugger did not load 
it's mass-storage device driver. On the other hand on macOS I get the error:
    `stlink_usb_usb_open(): claim interface failed` 
This is the same error I get on the RPi when I don't make sure to unbind the 
mass-storage driver (although it has never showed up on my other linux system).

I'm not the most familiar with macOS, does anyone have some suggestions on how 
I can dig deeper into this?

```
>>> openocd --version
Open On-Chip Debugger 0.12.0
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
>>> cat scripts/stm8s.cfg 

source [find interface/stlink-dap.cfg]
source [find target/stm8s105.cfg]

>>> openocd -d -f ./scripts/stm8s.cfg
Open On-Chip Debugger 0.12.0
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
User : 3 5 options.c:52 configuration_output_handler(): debug_level: 3
User : 4 5 options.c:52 configuration_output_handler(): 
Debug: 5 5 options.c:233 add_default_dirs(): 
bindir=/opt/homebrew/Cellar/open-ocd/0.12.0_1/bin
Debug: 6 5 options.c:234 add_default_dirs(): 
pkgdatadir=/opt/homebrew/Cellar/open-ocd/0.12.0_1/share/openocd
Debug: 7 5 options.c:235 add_default_dirs(): 
exepath=/opt/homebrew/Cellar/open-ocd/0.12.0_1/bin
Debug: 8 5 options.c:236 add_default_dirs(): bin2data=../share/openocd
Debug: 9 5 configuration.c:33 add_script_search_dir(): adding 
/Users/dariomuller/Library/Preferences/org.openocd
Debug: 10 5 configuration.c:33 add_script_search_dir(): adding 
/Users/dariomuller/.config/openocd
Debug: 11 5 configuration.c:33 add_script_search_dir(): adding 
/Users/dariomuller/.openocd
Debug: 12 5 configuration.c:33 add_script_search_dir(): adding 
/opt/homebrew/Cellar/open-ocd/0.12.0_1/bin/../share/openocd/site
Debug: 13 5 configuration.c:33 add_script_search_dir(): adding 
/opt/homebrew/Cellar/open-ocd/0.12.0_1/bin/../share/openocd/scripts
Debug: 14 5 command.c:155 script_debug(): command - ocd_find ./scripts/stm8s.cfg
Debug: 15 5 configuration.c:88 find_file(): found ./scripts/stm8s.cfg
Debug: 16 6 command.c:155 script_debug(): command - ocd_find 
interface/stlink-dap.cfg
Debug: 17 6 configuration.c:88 find_file(): found 
/opt/homebrew/Cellar/open-ocd/0.12.0_1/bin/../share/openocd/scripts/interface/stlink-dap.cfg
Debug: 18 6 command.c:155 script_debug(): command - adapter driver st-link
Debug: 19 6 command.c:155 script_debug(): command - st-link vid_pid 0x0483 
0x3744 0x0483 0x3748 0x0483 0x374b 0x0483 0x374d 0x0483 0x374e 0x0483 0x374f 
0x0483 0x3752 0x0483 0x3753 0x0483 0x3754
Debug: 20 6 command.c:155 script_debug(): command - ocd_find target/stm8s105.cfg
Debug: 21 6 configuration.c:88 find_file(): found 
/opt/homebrew/Cellar/open-ocd/0.12.0_1/bin/../share/openocd/scripts/target/stm8s105.cfg
Debug: 22 7 command.c:155 script_debug(): command - ocd_find target/stm8s.cfg
Debug: 23 7 configuration.c:88 find_file(): found 
/opt/homebrew/Cellar/open-ocd/0.12.0_1/bin/../share/openocd/scripts/target/stm8s.cfg
Debug: 24 7 command.c:155 script_debug(): command - transport select swim
Debug: 25 7 swim.c:116 swim_transport_select(): swim_transport_select
Debug: 26 7 command.c:155 script_debug(): command - swim newtap stm8s cpu
Debug: 27 7 swim.c:82 handle_swim_newtap_command(): Creating new SWIM "tap", 
Chip: stm8s, Tap: cpu, Dotted: stm8s.cpu
Debug: 28 7 core.c:1478 jtag_tap_init(): Created Tap: stm8s.cpu @ abs position 
0, irlen 0, capture: 0x0 mask: 0x0
Debug: 29 7 command.c:155 script_debug(): command - target create stm8s.cpu 
stm8 -chain-position stm8s.cpu
Debug: 30 7 target.c:2199 target_free_all_working_areas_restore(): freeing all 
working areas
Debug: 31 7 stm8.c:419 stm8_configure_break_unit(): hw breakpoints: numinst 2 
numdata 2
Debug: 32 7 command.c:155 script_debug(): command - stm8s.cpu configure 
-work-area-phys 0x0 -work-area-size 0x400 -work-area-backup 1
Debug: 33 7 target.c:2199 target_free_all_working_areas_restore(): freeing all 
working areas
Debug: 34 7 target.c:2199 target_free_all_working_areas_restore(): freeing all 
working areas
Debug: 35 7 target.c:2199 target_free_all_working_areas_restore(): freeing all 
working areas
Debug: 36 7 command.c:155 script_debug(): command - stm8s.cpu configure 
-flashstart 0x8000 -flashend 0xffff -eepromstart 0x4000 -eepromend 0x43ff
Debug: 37 7 stm8.c:1978 stm8_jim_configure(): flashstart=00008000
Debug: 38 7 stm8.c:1997 stm8_jim_configure(): flashend=0000ffff
Debug: 39 7 stm8.c:2016 stm8_jim_configure(): eepromstart=00004000
Debug: 40 7 stm8.c:2035 stm8_jim_configure(): eepromend=000043ff
Debug: 41 7 command.c:155 script_debug(): command - stm8s.cpu configure 
-optionstart 0x4800 -optionend 0x487f -blocksize 0x80
Debug: 42 7 stm8.c:2054 stm8_jim_configure(): optionstart=00004800
Debug: 43 7 stm8.c:2073 stm8_jim_configure(): optionend=0000487f
Debug: 44 7 stm8.c:1959 stm8_jim_configure(): blocksize=00000080
Debug: 45 7 command.c:155 script_debug(): command - adapter speed 800
Debug: 46 7 adapter.c:251 adapter_config_khz(): handle adapter khz
Debug: 47 7 adapter.c:215 adapter_khz_to_speed(): convert khz to adapter 
specific speed value
Debug: 48 7 adapter.c:215 adapter_khz_to_speed(): convert khz to adapter 
specific speed value
Debug: 49 7 command.c:155 script_debug(): command - reset_config srst_only
User : 50 7 options.c:52 configuration_output_handler(): set_option_bytesUser : 
51 7 options.c:52 configuration_output_handler(): 
Info : 52 7 server.c:298 add_service(): Listening on port 6666 for tcl 
connections
Info : 53 7 server.c:298 add_service(): Listening on port 4444 for telnet 
connections
Debug: 54 7 command.c:155 script_debug(): command - init
Debug: 55 7 command.c:155 script_debug(): command - target init
Debug: 56 7 command.c:155 script_debug(): command - target names
Debug: 57 7 command.c:155 script_debug(): command - stm8s.cpu cget -event 
gdb-flash-erase-start
Debug: 58 7 command.c:155 script_debug(): command - stm8s.cpu configure -event 
gdb-flash-erase-start reset init
Debug: 59 7 command.c:155 script_debug(): command - stm8s.cpu cget -event 
gdb-flash-write-end
Debug: 60 7 command.c:155 script_debug(): command - stm8s.cpu configure -event 
gdb-flash-write-end reset halt
Debug: 61 7 command.c:155 script_debug(): command - stm8s.cpu cget -event 
gdb-attach
Debug: 62 7 command.c:155 script_debug(): command - stm8s.cpu configure -event 
gdb-attach halt 1000
Debug: 63 7 target.c:1657 handle_target_init_command(): Initializing targets...
Debug: 64 7 stlink_usb.c:5081 stlink_dap_init(): stlink_dap_init()
Debug: 65 7 stlink_usb.c:3693 stlink_open(): stlink_open
Debug: 66 7 stlink_usb.c:3707 stlink_open(): transport: 5 vid: 0x0483 pid: 
0x3744 serial: 
Debug: 67 7 stlink_usb.c:3707 stlink_open(): transport: 5 vid: 0x0483 pid: 
0x3748 serial: 
Debug: 68 7 stlink_usb.c:3707 stlink_open(): transport: 5 vid: 0x0483 pid: 
0x374b serial: 
Debug: 69 7 stlink_usb.c:3707 stlink_open(): transport: 5 vid: 0x0483 pid: 
0x374d serial: 
Debug: 70 7 stlink_usb.c:3707 stlink_open(): transport: 5 vid: 0x0483 pid: 
0x374e serial: 
Debug: 71 7 stlink_usb.c:3707 stlink_open(): transport: 5 vid: 0x0483 pid: 
0x374f serial: 
Debug: 72 7 stlink_usb.c:3707 stlink_open(): transport: 5 vid: 0x0483 pid: 
0x3752 serial: 
Debug: 73 7 stlink_usb.c:3707 stlink_open(): transport: 5 vid: 0x0483 pid: 
0x3753 serial: 
Debug: 74 7 stlink_usb.c:3707 stlink_open(): transport: 5 vid: 0x0483 pid: 
0x3754 serial: 
Debug: 75 13 stlink_usb.c:3381 stlink_usb_usb_open(): claim interface failed
Debug: 76 13 stlink_usb.c:684 jtag_libusb_bulk_transfer_n(): ERROR, failed to 
submit transfer 0, error -5
Debug: 77 13 command.c:545 run_command(): Command 'init' failed with error code 
-4
User : 78 13 command.c:608 command_run_line(): 
Debug: 79 13 target.c:2199 target_free_all_working_areas_restore(): freeing all 
working areas
```


---

Sent from sourceforge.net because openocd-devel@lists.sourceforge.net is 
subscribed to https://sourceforge.net/p/openocd/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/openocd/admin/tickets/options.  Or, if this is a 
mailing list, you can unsubscribe from the mailing list.


Reply via email to