-
Notifications
You must be signed in to change notification settings - Fork 450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
M1 OpenOCD Upload Issues #703
Comments
You need to install the X86 version of libhidapi.so. Your symlink isn't going to work because the OpenOCD.exe file is an x86-64 version. Try something like: (warning, I don't own or use a Mac)
|
Can we package libhidapi with the Mac OS package? Because looking at https://dl.registry.platformio.org/download/platformio/tool/tool-openocd/2.1100.211028/tool-openocd-darwin_x86_64-2.1100.211028.tar.gz, it has it does it like that too. Or, link it statically into the binary. |
I don't build anything on the Mac, and I don't think the cross-compiler can actually do a static link. For the |
@ivankravets do you know how this works with the Mac's OpenOCD' package, are the dynlibs in |
PlatformIO handles this automatically if compiled libraries are located in the But! This issue has another root. The package is marked compatible with x86/ARM, where sources are compiled for the x86. It means users should have Rosetta installed on their machine. The alternative is to compile separate packages for x86 and ARM. |
This also just appeared on a Intel-based Mac book, the binary fails to run because of non-installed dependencies. I guess I'll try and modify https://github.com/earlephilhower/pico-quick-toolchain/ to package OpenOCD with the libexec folder and dylibs like PlatformIO does and hope this problem goes away, with the help of someone with a MacBook to test it.. |
@maxgerhardt it's actually easier than that. The MacOSX OpenOCD binary is a prebuilt blob because the USB dependencies were difficult to get working in a cross -compiled environment. I can pull down the working official OpenOCD and copy its |
If you can get the PIO-packaged platform_packages = tool-openocd-rp2040-earlephilhower@file://<path to .tar.gz> (and an uninstall of the previous dependencies of course). |
I've added in the libexec from the darwin-x86 official openocd, attached below (GH doesn't allow .tgz, only .zip): |
I've tested the zip and above with PIO (in VSCode) on OS X on M1 without success:
......
Relevant platform.ini lines:
Running openocd from the command line with the libexec path of the package added to DYLD_LIBRARY_PATH works. So all the libraries are there but they are not found automatically. This can be made dynamic with:
I don't know how to set this in platformio to get it all working. |
Well PlatformIO adds |
I tried did and it doesn't work. I noticed the error message doesn't claim to have searched the
So I tried the following (/nowhere is deliberately not existing):
Now the path is shown in the error message. I'm on OS X 12.5.1 on an M1 and it seems the LYLD_LIBRARY_PATH is not a normal environment variable. E.g.:
This is not a 'normal' variable behaviour to me. The OS has some 'feature' here. |
Well, if you just want to get a working environment for now and no experimenting, better use that posted command to install the missing lib, maybe we'll figure something out later. |
I installed the library in /usr/local/... and am in business for now. Feel free to ask if I need to test something. |
I'm using PlatformIO as described here on an M1 MacBook and run into an issue when trying to upload using the
picoprobe
option. It first cannot findlibhidapi
:I have
libhidapi
installed using brew, which installs to /opt/homebrew. So to link it to a place where OpenOCD will look for it, I ransudo ln -s /opt/homebrew/lib/libhidapi.0.dylib /usr/local/lib/libhidapi.0.dylib
. Now, a different error, this time about architecture:Finally, when I replace the openocd bin in
~/.platformio/packages/tool-openocd-rp2040-earlephilhower/bin/openocd
with the bin that I compiled separately, it works properly.I've also found that by only doing the OpenOCD swap (and not having the
libhidapi
link) everything works as expected. So it looks like the packaged version of OpenOCD is the culprit since using a properly compiled one resolves thelibhidapi
issue.The text was updated successfully, but these errors were encountered: