platformio / platform-ststm32

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

upload-reset is not a dynamic executable #225

Open nopnop2002 opened 5 years ago

nopnop2002 commented 5 years ago
$ uname -a
Linux HP-Laptop 4.15.0-46-generic #49-Ubuntu SMP Wed Feb 6 09:33:07 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

$ pio update
Updating tool-scons                      @ 2.20501.7      [Up-to-date]

Platform Manager
================
Platform ST STM32
--------
Updating ststm32                         @ a1c78e0        [Up-to-date]
Updating tool-stm32duino                 @ 1.0.1          [Up-to-date]
Updating framework-arduinoststm32-maple  @ 1.10000.190228 [Up-to-date]
Updating tool-openocd                    @ 2.1000.190118  [Up-to-date]
Updating framework-arduinoststm32        @ 3.10500.190225 [Up-to-date]
Updating toolchain-gccarmnoneeabi        @ 1.70201.0      [Up-to-date]

Library Manager

$ ldd .platformio/packages/tool-stm32duino/upload-reset not a dynamic executable

$ .platformio/packages/tool-stm32duino/upload-reset -bash: .platformio/packages/tool-stm32duino/upload-reset: No such file or directory

$ cat platformio.ini
; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:bluepill_f103c8]
platform = https://github.com/platformio/platform-ststm32.git
framework = arduino
board = bluepill_f103c8
board_build.core = maple
upload_protocol = dfu
upload_port = /dev/ttyACM0
pfeerick commented 5 years ago

Reproducible on

Platform ST STM32
--------
Updating ststm32                         @ 5.4.3          [Up-to-date]
Updating tool-stm32duino                 @ 1.0.1          [Up-to-date]
Updating framework-arduinoststm32-maple  @ 1.10000.190516 [Up-to-date]
Updating tool-openocd                    @ 2.1000.190422  [Up-to-date]
Updating framework-arduinoststm32        @ 3.10500.190327 [Up-to-date]
Updating toolchain-gccarmnoneeabi        @ 1.70201.0      [Up-to-date]

I think the underlying issue is that the wrong flavour binaries are being installed. (edit: lack of 32bit libraries) On a 64bit Ubuntu 18.04 VM,

uname -a
Linux ubuntu-hyperv 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

file ~/.platformio/packages/tool-stm32duino/upload-reset 
/home/pfeerick/.platformio/packages/tool-stm32duino/upload-reset: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-, for GNU/Linux 2.6.24, BuildID[sha1]=dc8dc5ad6de94179a9d534b1a34aeb6d906640b1, not stripped

ldd ~/.platformio/packages/tool-stm32duino/upload-reset 
    not a dynamic executable

Forum ref: https://community.platformio.org/t/upload-reset-no-such-file-or-directory/8656

pfeerick commented 5 years ago

I was able to resolve this issue by running sudo apt-get install lib32z1 on the Ubuntu 18.04 LTS VM, but you may need a different command if you are running a different version.