Stm8 again: gdb binurils still refers ro python 2.7

Hi, is anybody still on stm8 platform?

I had to reactivate some old projects but I also found that platform / tools did not evolve much.

Currently I can compile / flash and do currently not face issues with flash size (if you comment unness includes from stm8_conf.h)

But I do need debug. There still some problems reported but I can’t even verify, since stm8-gdb is 8ys old and does still refers to python 2.7 – latest release is from 2018.

I have build a libpython2.7.so.1.0 which could be integrated but still facing pytthon issues.

I don’t like the idea to put everything in Docker ro rollback the time to a debian version which comes with python 2.7, so I need to build tool-stm8binutils, but how?

Can you open a new issue for this in platform-ststm8? This is currently only noted inside another issue

https://github.com/platformio/platform-ststm8/issues/48#issuecomment-904626800

which references

https://github.com/espressif/esp-idf/issues/5284#issuecomment-632754358

i.e. “do apt-get install libpython2.7-dev” , but that package might not even be available anymore on newer distributions. The GDB build should have included that library or linked it in statically.

There also seem to be genuine newer versions of stm8-gdb available at https://github.com/spseol/STM8-binutils-GDB, although they seem a bit vibecoded.

The latest version of the original stm8-gdb is from 2021, while the one in the reigstry is the 2018 version. https://sourceforge.net/projects/stm8-binutils-gdb/files/. It apparently uses Python 3.9.

Can you try doing this in your Python installation

sudo apt install libreadline-dev libncurses6 libncursesw6 libtinfo6

Then add this to your platformio.ini, assuming you’re on Linux

platform_packages =
   tool-stm8binutils@https://github.com/maxgerhardt/tool-stm8binutils/raw/refs/heads/main/tool-stm8binutils-linux_x86_64.tar.gz

That binary only has these dependencies

$ ldd stm8-gdb
	linux-vdso.so.1 (0x00007eb2dafed000)
	libreadline.so.8 => /usr/lib/x86_64-linux-gnu/libreadline.so.8 (0x00007eb2da9a6000)
	libncursesw.so.6 => /usr/lib/x86_64-linux-gnu/libncursesw.so.6 (0x00007eb2daf96000)
	libtinfo.so.6 => /usr/lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007eb2da971000)
	libm.so.6 => /usr/lib/x86_64-linux-gnu/libm.so.6 (0x00007eb2da84b000)
	libc.so.6 => /usr/lib/x86_64-linux-gnu/libc.so.6 (0x00007eb2da600000)
	/lib64/ld-linux-x86-64.so.2 (0x00007eb2dafef000)

Hi Max,

tried your binary, unfortunately my libc is too old:

stm8-gdb: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.42' not found (required by stm8-gdb)

My pio is docker based but based on debian trixie which is glibc 2.41 and ubuntu 24.04 is still on 2.39. ubuntu 25.05 seems to do the job but I need to rebuild my contatners…

But with the provided link I should manage to build stm8-gdb on my own…

I can also try to integrate python 2,7 again. I just added the .so and forgot the platform independent libs, so exact error with 2.7 was

Could not find platform independent libraries

fixable but just need more time :slight_smile: