Openocd OSX (M2) Fail

yes: I’ve uses brew to install libusb and the libusb-1.0.0.dylib is present.
could it be a USB device (similar to udev.rules in Linux) permission thing?

For what it’s worth, I recently ran into this same problem when using a USB-C to USB-B mini cable. I swapped the cable to use one of the standard usb ports and it worked fine. This is on a new M2 mac mini.

1 Like

I thought about this could be the issue… but what can I do? I’m on a MBP 14‘‘. I have only USB-C connections… :confused:

Ahh shoot, yeah I didn’t think about it being the only option… Maybe try another cable? It’s odd that usb-c ports would act differently in this case for sure. I only have one usb-c to usb-b mini cable and it was a cheap one from amazon. Though that same cable works fine for programming teensy, rp pico… :man_shrugging:

Do you have a cable or adapter?

Cable, no adapter, you should try an adapter maybe. Though it seems like maybe it’s a problem with libusb and m2 mac usb c ports.

1 Like

This makes it even worse… I’m trying it with an adapter… so cable is also useless… :cry:

Yes I think it’s a major M2 usblib problem.
Hope this gets fixed, one day :slight_smile:

so, any news on this? I’m still struggling with that issue…

I did see one community member on Discord who got ST LINK V3 mini debugger to work on their M2 (posted on 8/26/23). If you search “M2”, you should be able to find that post. It may be worth asking directly. And please feel free to report back here if you get it working. Good luck!

Thanks, but I wonder how he did it (and he doesn’t really know also why), because STLINK support for osx has being dropped…
This would be also nice to be mentioned in the homepage/ store that OSX (so it’s not a M2 problem) is excluded from the debugging chain.
Or you could supply another solution, wich would be best.
cheers…

STLINK works on my MacBook Air M1.
Where did you see that Mac support is being dropped?

I’d like to know how and why it is working for you. can you pls post you working conf files and versions?

I see in stlink source that Mac OS support is dropped in 1.8

My M1 MacBook Air has stlink v1.7.0 installed, via Homebrew.

But - does this matter? Does OpenOCD use the stlink software, or directly access the stlink hardware?

I think I see what has caused my confusion. Daisy Makefile uses OpenOCD to upload to the Daisy. This works on my Intel and M1 Macs.
But, STLINK v1.7.0 doesn’t recognize the VID:PID for the stlink Mini-E, which is the USB-C version.

what happens if you remove stlink via homebrew? does openocd still work?
I have also stlink 1.7.0.
And I’ve tried both: STLINK V3 MINI and STLINK V3 MINIE (usb-c).

this works on my linux, but not on my mac…

On M1 MacBook Air-

Removed stlink with:
brew remove stlink

Verified this really removed it. Yes, it’s gone.

Ran ‘make program’ in Seed/Blink, it correctly uploaded to Seed.

My OpenOCD version is 0.12.0

1 Like

yes so I’ve tested it also on linux. there is no stlink either… uploading on linux is no problem at all…
so you where right, there is no relation to stlink and openocd in this manner…
so I’m completely lost now with getting it to work on my m2 machine… :confused:

FWIW, I have a M2 Max MacBook pro. I had STLINK v3mini working just fine (using an USB A → USB C adapter).

I’m using the OpenOCD 0.12.0 from xPacks, not BREW.

After a few weeks, it just stopped working. Not sure what’s up… My config didn’t change at all. Maybe the debugger broke? It mounts the little drive on my desktop and the lights are green, but when I try to use the debugger in VSCODE it just spins and spins and never connects.

I decided to order one of the new USB C STLINKs, I haven’t tried it yet, but I’m hopeful this one works, will report back once I have a chance to try it.

1 Like

yes please, report back, since you have the same mbp m2 .
I’ll try the xPacks thing out.

EDIT: Tried out xPacks openocd but with no success…

on which OSX version are you ?