platform-ststm32 icon indicating copy to clipboard operation
platform-ststm32 copied to clipboard

Dfuutil missing for arm64

Open dolfandringa opened this issue 4 years ago • 6 comments

The ststm32 core for platformio defines a dependency on tool-dfuutil, but that package does not seem to be available for linux_aarch64 so installing the platform fails. I am not actually using dfu for uploading code (I am using the stlinkv2 programmer), so for me a workaround is to manually remove the dependency from ~/.platformio/platforms/ststm32/platform.json. For me that works, but it is definitely not an ideal workaround, and others might actually use dfu. So would it be possible to release an arm64 linux package for it?

dolfandringa avatar Oct 01 '20 06:10 dolfandringa

Also, we need a Darwin arm_64 version of tool-dfuutil for the M1 Mac system. If a set of binaries is needed, maybe I can cobble them together.

thinkyhead avatar Sep 09 '21 08:09 thinkyhead

It would be nice if the latest dfu-util would be added to the tool-dfuutil package. At this moment only an old revision is used and the latest 0.11 only seems available for Macos Arm64. The dfu-util project has released 0.11 and it's not integrated in platformio for other platforms. As you can see here: https://registry.platformio.org/tools/platformio/tool-dfuutil/compatibility

See also this issue. https://github.com/sipeed/platform-gd32v/issues/17 Although this points to a Sipeed archive, this tool is owned by Platformio and in the top 100 of used packages.

jhaand avatar May 31 '22 14:05 jhaand

Today a new version of dfu-util 0.11 was introduced in the registry. Unfortunately not for linux_aarch64.

jhaand avatar Jun 01 '22 21:06 jhaand

It's not helping me either. The chart on their page says arm64 is supported, but we're still not picking up a universal binary.

> pio --version
PlatformIO Core, version 6.0.2

> pio pkg install -g --tool "platformio/tool-dfuutil@^1.11.0"

> pio run -e Opulo_Lumen_REV3

dyld[91452]: Library not loaded: '/usr/local/opt/libusb/lib/libusb-1.0.0.dylib'
  Referenced from: '/u/t/.platformio/packages/tool-dfuutil/bin/dfu-suffix'
  Reason: tried: '/usr/local/opt/libusb/lib/libusb-1.0.0.dylib' (no such file), '/usr/local/lib/libusb-1.0.0.dylib' (mach-o file, but is an incompatible architecture (have (arm64), need (x86_64))), '/usr/lib/libusb-1.0.0.dylib' (no such file)

> find ~/.platformio -name "dfu-*" -type f
/u/t/.platformio/packages/tool-dfuutil/bin/dfu-util
/u/t/.platformio/packages/tool-dfuutil/bin/dfu-prefix
/u/t/.platformio/packages/tool-dfuutil/bin/dfu-suffix

> file ~/.platformio/packages/tool-dfuutil/bin/*
/u/t/.platformio/packages/tool-dfuutil/bin/dfu-prefix: Mach-O 64-bit executable x86_64
/u/t/.platformio/packages/tool-dfuutil/bin/dfu-suffix: Mach-O 64-bit executable x86_64
/u/t/.platformio/packages/tool-dfuutil/bin/dfu-util:   Mach-O 64-bit executable x86_64

thinkyhead avatar Jun 30 '22 02:06 thinkyhead

Same on issue on Raspberry Pi 3b+:

$ pio --version
PlatformIO Core, version 6.1.1

$ pio pkg install -g --tool "platformio/tool-dfuutil@^1.11.0"
Tool Manager: Installing platformio/tool-dfuutil @ ^1.11.0
Error: Could not find the package with 'platformio/tool-dfuutil @ ^1.11.0' requirements for your system 'linux_armv7l'

$ uname -a
Linux mpcnc 5.10.103-v7+ #1529 SMP Tue Mar 8 12:21:37 GMT 2022 armv7l GNU/Linux

Unable to compile Marlin 2.1.x, sigh.

Update: Marlin fixed this literally 2 hrs ago and all seems to work again 🥳 when applying this patch: https://github.com/MarlinFirmware/Marlin/commit/068624a726213dc91f485db4d4eda1d89f656025

thijstriemstra avatar Jul 12 '22 20:07 thijstriemstra