platformio / platform-atmelavr

Atmel AVR: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/atmelavr
Apache License 2.0
139 stars 105 forks source link

The avrdude_bin is 32bit on linux_aarch64 #208

Closed arrys closed 3 years ago

arrys commented 4 years ago

The version of avrdude_bin downloaded on linux_aarch64 platform is a 32-bit executable. This will cause the following cryptic error when trying to upload: $HOME/.platformio/packages/tool-avrdude/avrdude: line 6: $HOME/.platformio/packages/tool-avrdude/avrdude_bin: No such file or directory.

I have verified the problem can be solved by cp /usr/bin/avrdude $HOME/.platformio/packages/tool-avrdude.

Running file /usr/bin/avrdude produces:

/usr/bin/avrdude: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, BuildID[sha1]=967332b7c7feb152f66fda428fe703a23c10a71c, for GNU/Linux 3.7.0, stripped

Running file $HOME/.platformio/packages/tool-avrdude produces:

avrdude_bin: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.26, BuildID[sha1]=2c221883fff0793562ae8b0bfb0800d7bca87254, stripped

The avrdude tool is downloaded from https://github.com/platformio/platform-atmelavr/blob/a9b3d0fbe4e4c3a17db8d67d9cbdb4cd4a78e6a7/platform.json#L23. This points to a manifest.json where the different versions of the tool are defined. For some reason the 32bit and 64bit versions are grouped and a 32bit zip is provided.

This excerpt shows the linux_aarch64 and a 32bit zip.

    {
      "sha1": "d021f051550f0cc06a1fbc371125fa171b2dbcae",
      "system": [
        "linux_armv6l",
        "linux_armv7l",
        "linux_armv8l",
        "linux_aarch64"
      ],
      "url": "https://dl.bintray.com/platformio/dl-packages/tool-avrdude-linux_armv6l-1.60001.1.tar.gz",
      "version": "1.60001.1"
    },

I am aware that linux_aarch64 does not necessarily mean the OS is 64bit. So some kind of check would be needed.

valeros commented 3 years ago

Hi @arrys ! Thanks for reporting, should be fixed now. Please run pio update.