platformio / platform-ststm32

ST STM32: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/ststm32
Apache License 2.0
405 stars 312 forks source link

can't upload (stlink, raspi 32-bit) #660

Closed jcw closed 1 year ago

jcw commented 2 years ago

What kind of issue is this?


Configuration

Operating system: Linux piodev 5.15.76-v7+ platformio/platformio-core#1597 SMP Fri Nov 4 12:13:17 GMT 2022 armv7l GNU/Linux

PlatformIO Version (platformio --version): 6.1.6a3

Description of problem

This looks like a regression. I've started using my RasPi build farm again for PIO. I get this error:

Processing f413 (board: nucleo_f413zh; platform: ststm32; framework: cmsis)
-------------------------------------------------------------------------------------
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'

Steps to Reproduce

  1. build & upload any STM32 project w/ latest PIO on RasPi, I suppose ...

Expected Results

When I remove a few lines from platforms/ststm32/platform.json, things work as expected again. I.e. proper openocd upload.

The lines removed were:

"tool-dfuutil": { ... }

It's not clear why there is this dependency on dfu-util (which does not provide an ARM build on SourceForge, btw).

Additional info

Note that this build setup is still using 32-bit Linux. I can supply more info if needed, of course.

ivankravets commented 2 years ago

Could you navigate to https://sourceforge.net/p/dfu-util/dfu-util/ci/v0.11/tree/ , click on "Download Snapshot" , and compile it on armv7l target? Next step. please pack binaries with zip or tar.gz (if there are symbolic links), and share an archive somewhere. We will publish the package to the registry.

Thanks!

jcw commented 2 years ago

This is what I get, builds out of the box with default ./configure:

$ du -sch
2.1M    .
2.1M    total
$ file src/dfu-util
src/dfu-util: ELF 32-bit LSB pie executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, BuildID[sha1]=5acfe6d10caace51e707d036fc6faeb6c56af284, for GNU/Linux 3.2.0, with debug_info, not stripped

Do you want that entire tree tarred? I only did make, not make install (which defaults to /usr/local/).

jcw commented 2 years ago

https://wippler.nl/s/ee2sniQ9wB9W6FF

ivankravets commented 2 years ago

Could you align the archive to this structure? Where could we get libusb.so?

jcw commented 1 year ago

Ok, I've manually replaced the 4 binaries in your package structure, including the libusb grabbed from my 32-bit DietPi RasPi3 setup at /usr/lib/arm-linux-gnueabihf/libusb-1.0.so.0.3.0.

https://wippler.nl/s/zqnCMeDRXmps6cz

ivankravets commented 1 year ago

Thanks! Uploaded! https://registry.platformio.org/tools/platformio/tool-dfuutil/compatibility

Could you remove this package from ~/.platformio/packages folder and try to flash a board?

jcw commented 1 year ago
Tool Manager: Installing platformio/tool-dfuutil @ ~1.11.0
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Tool Manager: tool-dfuutil@1.11.0 has been installed!

jcw@piodev:blink$ uname -a
Linux piodev 5.15.76-v7+ #1597 SMP Fri Nov 4 12:13:17 GMT 2022 armv7l GNU/Linux
jcw@piodev:blink$ ls -l ~/.platformio/packages/tool-dfuutil/
total 64
-rw-r--r-- 1 jcw jcw   744 Jul  5  2021 AUTHORS
-rw-r--r-- 1 jcw jcw 17992 Oct 25  2010 COPYING
-rw-r--r-- 1 jcw jcw  5690 Sep  5  2021 ChangeLog
-rw-r--r-- 1 jcw jcw   702 Jul  5  2021 README
drwxr-xr-x 2 jcw jcw  4096 Dec  4 20:40 bin
-rwxr-xr-x 1 jcw jcw  9747 Jul  5  2021 dfuse-pack.py
drwxr-xr-x 2 jcw jcw  4096 Dec  4 20:40 lib
-rw-r--r-- 1 jcw jcw   431 Dec  4 19:36 package.json
drwxr-xr-x 3 jcw jcw  4096 Dec  4 20:40 share
jcw@piodev:blink$

\o/

ivankravets commented 1 year ago

Great! Thank you so much for the help with binaries! 🙏🤗