akashkapashia / stm8_arduino

GNU Lesser General Public License v2.1
3 stars 2 forks source link

libusb not found on M1 chip #1

Open kokospalme opened 7 months ago

kokospalme commented 7 months ago

Hello, I tried to upload the blink-sketch onto an STM8S103 chip, but my Mac M1 won't find libusb. Libusb is already installed via homebrew. Reinstalling libusb has no effect. The ArduioIDE throws this error:

dyld[2571]: Library not loaded: /opt/local/lib/libusb-1.0.0.dylib
  Referenced from: <4829C09D-0477-3B63-8F35-266FB4161AF0> /Users/chris/Library/Arduino15/packages/sduino/tools/STM8Tools/2019.02.05/macosx/stm8flash
  Reason: tried: '/opt/local/lib/libusb-1.0.0.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/libusb-1.0.0.dylib' (no such file), '/opt/local/lib/libusb-1.0.0.dylib' (no such file), '/usr/local/lib/libusb-1.0.0.dylib' (no such file), '/usr/lib/libusb-1.0.0.dylib' (no such file, not in dyld cache)
Failed uploading: uploading error: signal: abort trap

When I type brew list libusbI get:

/opt/homebrew/Cellar/libusb/1.0.26/include/libusb-1.0/libusb.h
/opt/homebrew/Cellar/libusb/1.0.26/lib/libusb-1.0.0.dylib
/opt/homebrew/Cellar/libusb/1.0.26/lib/pkgconfig/libusb-1.0.pc
/opt/homebrew/Cellar/libusb/1.0.26/lib/ (2 other files)
/opt/homebrew/Cellar/libusb/1.0.26/share/libusb/ (9 files)

Why is libusb installed at a different path?

Is this a problem of homebrew, a problem of this board-repository or a problem of libusb? I can't really find out where to ask about this issue. Thank you!

kokospalme commented 7 months ago

this workaround did the magic. I asume that it's an issue with the tool-dfuutil when using an M1/M2 chip.