PlatformIO Community

Mac OS - v.10.14.5 Mojave - Error downloading to board - Library not loaded: /usr/local/opt/libusb-compat/lib/libusb-0.1.4.dylib

This just started occurring - was downloading fine - but now I have this error:

verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/protrinket5ftdi.html
PLATFORM: Atmel AVR > Adafruit Pro Trinket 5V/16MHz (FTDI)
HARDWARE: ATMEGA328P 16MHz 2KB RAM (28KB Flash)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 5 compatible libraries
Scanning dependencies...
No dependencies
Checking size .pioenvs/protrinket5ftdi/firmware.elf
Memory Usage -> http://bit.ly/pio-memory-usage
DATA:    [=         ]  11.6% (used 237 bytes from 2048 bytes)
PROGRAM: [=         ]  12.1% (used 3470 bytes from 28672 bytes)
Configuring upload protocol...
AVAILABLE: arduino
CURRENT: upload_protocol = arduino
Looking for upload port...
Auto-detected: /dev/cu.usbserial-AI055WAW
Uploading .pioenvs/protrinket5ftdi/firmware.hex
dyld: Library not loaded: /usr/local/opt/libusb-compat/lib/libusb-0.1.4.dylib
Referenced from: /Users/craigdetter/.platformio/packages/tool-avrdude/bin/avrdude
Reason: image not found
*** [upload] Error -6
=============================================================== [ERROR] Took 0.95 seconds ===============================================================
The terminal process terminated with exit code: 1

++++ END LOGS +++++++++++++++++++++++++++++++++++++++++++++++++
When I check my drive, there is no (/usr/local/opt/libusb-compat/lib/libusb-0.1.4.dylib), however there is this:
$ ls -al  /usr/local/opt/libusb
lrwxr-xr-x  1 craigdetter  admin  23 Jun  7 11:07 /usr/local/opt/libusb -> ../Cellar/libusb/1.0.22
1 Like

I fixed it by:

brew reinstall openocd

3 Likes

Thank you so much for sharing your solution, this finally fixed my libusb issue

1 Like

Fixed for me too, thank you very much.

1 Like

Hello everyone. Please can somebody explain me what exactly should I do to reinstall openocd on my mac… I’m trying to solve the same problem with *** [upload] Error -6 when uploading to my Arduino Nano board…

Ok, I’d found how to reinstall openocd, and this solved the problem, thanks for this solution!

1 Like

Please open PlatformIO IDE Terminal and update all packages via pio update.