Wrong linux binaries in STM8 upload tools

Hi,
While trying example application for STM8S-DISCOVERY board i had encounter this error while trying to upload:
./stm8flash: No such file or directory

The version of the tool-stm8tools is 0.40.181218.
Running on Linux Mint 19.3 Tricia 64 bit.
After compiling from sources provided from: https://platformio.org/platforms/ststm8/packages i was able to upload to the board.
Please update the package with correct binary files.

Strange… there is both a x86_64 and i686 version of that package for linux, so it should work everywhere, unless there is some dependency change on newer systems (as this was compiled around Dec '18). I don’t suppose you have the old stm8flash binary still, so you could run file and ldd on it to see if it’s the right architecture and check the dependencies? I’ll give it a try on my system and see if I can reproduce it.

Hi @pfeerick
Thank you for quick response on a weekend day.
Here is the output of file stm8flash from the 64 bit package

stm8flash: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=5521f54ad026b438276cdc0c504a4f112b37a84c, stripped

Also here is the output from the 32 bit package:

stm8flash: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=eb0294f02c0029df557ac0602f7e50419ed2e666, stripped

So it is a 32bit binary in the 64bit package, and 64bit binary in the 32 bit package.
Can you check on your side if i am not missing something.

Thanks and have a great week-end.
Nicu.

I can confirm this.

tool-stm8tools-linux_i686-0.40.181218.tar.gz

➜  i686 cat package.json 
{
    "description": "STM8 upload tools",
    "name": "tool-stm8tools",
    "system": [
        "linux_i686"
    ],
    "url": "https://github.com/vdudouyt/stm8flash",
    "version": "0.40.181218"
}
➜  i686 file stm8*
stm8flash: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=eb0294f02c0029df557ac0602f7e50419ed2e666, stripped
stm8gal:   ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=15d2e5ce4b8c8a41ff8f5e46935894d656c8ba03, stripped

tool-stm8tools-linux_x86_64-0.40.181218.tar.gz

➜  x86_64 cat package.json 
{
    "description": "STM8 upload tools",
    "name": "tool-stm8tools",
    "system": [
        "linux_x86_64"
    ],
    "url": "https://github.com/vdudouyt/stm8flash",
    "version": "0.40.181218"
}
➜  x86_64 file stm8*                          
stm8flash: ELF 32-bit LSB pie executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=5521f54ad026b438276cdc0c504a4f112b37a84c, stripped
stm8gal:   ELF 32-bit LSB pie executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=da530f989d4b4c7e31459c075ddad5159c37338a, stripped

Having said that, it’s odd that it didn’t work for you, since even on a x64 kernel 32 bit code will often run… i.e I’m running 5.6.11-1-MANJARO x86_64 and have no problem running either version of stm8flash. Then again, I might have enabled something at some point as I do run legacy stuff at times.


Anyho… @ivankravets or @valeros Can we get the binaries of the two linux packages in Service End for Bintray, JCenter, GoCenter, and ChartCenter | JFrog swapped around, so the 32 bit code is in the i686 package, and the 64bit code is the in x86_64 package… :slight_smile:

Thanks! :blush: Fixed. Please re-run $ pio update.

1 Like