PlatformIO - STM32 -库未加载:/opt/local/lib/libusb-1.0.0.dylib [



我正试图通过PlatformIO编程STM32。我使用内置眨眼的例子,所以我知道;我的代码不是导致问题的原因。我使用的是macOS - M1 Max - Monterey(12.13.1)。

这是我使用的板:https://ubld.it/products/stm32-midi-dev

程序构建正常,但是当尝试上传时,我得到以下错误:

dyld[54244]: Library not loaded: /opt/local/lib/libusb-1.0.0.dylib
Referenced from: /Users/***/.platformio/packages/tool-stm32duino/dfu-util/dfu-util
Reason: tried: '/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)
/Users/***/.platformio/packages/tool-stm32duino/maple_upload: line 53: 54244 Abort trap: 6           ${DFU_UTIL} -d ${usbID} -a ${altID} -D ${binfile} -R ${dfuse_addr} -R
*** [upload] Error 134

我的platformio.ini文件如下所示:

[env:genericSTM32F103CB]
platform = ststm32
board = genericSTM32F103CB
framework = arduino
board_build.core = maple
upload_protocol = dfu

我已经试过了:

  1. brew install libusb-但是已经安装了
  2. brew uninstall libusb- then -brew install libusb
  3. 库未加载:/opt/local/lib/libssl.1.0.0。dylib (LoadError) -这似乎更SSL相关,但无论如何尝试

我已经阅读了错误信息,并理解它似乎是一个文件不存在,但不确定下一步该怎么做,因为我试图重新安装上面的libusb。

如果有帮助,这里是我完整的上传输出:

CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/genericSTM32F103CB.html
PLATFORM: ST STM32 (15.3.0) > STM32F103CB (20k RAM. 128k Flash)
HARDWARE: STM32F103CBT6 72MHz, 20KB RAM, 128KB Flash
DEBUG: Current (blackmagic) External (blackmagic, cmsis-dap, jlink, stlink)
PACKAGES: 
- framework-arduinoststm32-maple @ 3.10000.201129 (1.0.0) 
- tool-dfuutil @ 1.9.211020 
- tool-openocd @ 2.1100.211028 (11.0) 
- tool-stm32duino @ 1.0.1 
- toolchain-gccarmnoneeabi @ 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> https://docs.platformio.org/en/latest/librarymanager/ldf.html
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 30 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Checking size .pio/build/genericSTM32F103CB/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [==        ]  21.1% (used 4312 bytes from 20480 bytes)
Flash: [=         ]  14.3% (used 18712 bytes from 131072 bytes)
Configuring upload protocol...
AVAILABLE: blackmagic, cmsis-dap, dfu, jlink, serial, stlink
CURRENT: upload_protocol = dfu
Looking for upload port...
Auto-detected: /dev/cu.usbmodem1101
Uploading .pio/build/genericSTM32F103CB/firmware.bin
Failed to open serial device.
dyld[54773]: Library not loaded: /opt/local/lib/libusb-1.0.0.dylib
Referenced from: /Users/***/.platformio/packages/tool-stm32duino/dfu-util/dfu-util
Reason: tried: '/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)
/Users/***/.platformio/packages/tool-stm32duino/maple_upload: line 53: 54773 Abort trap: 6           ${DFU_UTIL} -d ${usbID} -a ${altID} -D ${binfile} -R ${dfuse_addr} -R
*** [upload] Error 134

提前感谢您的帮助。

===编辑===随着我继续研究,我认为这与自制程序没有安装在libusb的正常位置有关。Homebrew Mac M1不能't find install

好的。感谢PlatformIO的Ivan,他能够给我以下的解决方案。

没有新的STM32Duino/dfu-binaries for macOS:

  • https://github.com/stm32duino/Arduino_Tools/tree/main/macosx/dfu-util

我能请你试试下面的东西吗?

  1. Edit~/.platformio/packages/tool-stm32duino/maple_upload
  2. 注释第43行,并在
  3. 下面添加一个新行
DFU_UTIL=~/.platformio/packages/tool-dfuutil/bin/dfu-util

相关内容

  • 没有找到相关文章

最新更新