Setting up development and programming for STM8 on Linux

STM8 Series of micro-controllers by ST Microelectronics are dirt cheap and powerful at the same time. Their processing power is nothing short as of Arduino, while at the same time their power consumption is much less. These properties makes STM8 micros a great choice for many hobby and serious projects. I this tutorial you will learn how to setup a developing and programming environment for STM8 on Linux based systems.

A while ago I stated a mini-tutorial series of programming for STM8, which are based on ST Visual Develop IDE and COSMIC C Comiler on Microsoft Windows platform. In the very first tutorial I promised to talk about setting up environment and programming on Linux. And here I am with the video tutorial on my YouTube channel.

Here are the required links (for easy copy-paste) that I used in the video:

  1. SDCC Compiler v3.5.0 or higher for Linux-x86 (works fine with x64 if you have multiarch enabled!).
  2. STM8FLASH (should be easy to compile using GCC).
  3. STM8 Example Project.

Please note that I used Ubuntu x64 14.04 LTS (which is a Debian based distro). I have not tested the procedure on other Linux architectures or distros, but I strongly beleive it should make no difference which architecture (as long is it is x86 or x64) or distro of linux you are using.

As a side note, if the SDCC complained about libstd6 or libglx, the solutions is as follow:

See the full instruction in the video:

As always, if you faced any problems just comment on the video or use the comment system below (needs registration)

Saeid Yazdani

An Electronics Engineer with passion in Embedded Systems, Wireless Sensor Networks, Assembly, Desktop and Mobile Development, Web Development and generally anything that has to do with hardware and software of any kind!

9 Comments:

  1. Warning! Most Linux distros are 64bit. The SBCC compiler is 32bit.

    If you try to run sbcc you will receive the illogical error “File not found”.

    See http://askubuntu.com/questions/133389/no-such-file-or-directory-but-the-file-exists to enable 32bit executables.

    • Actually, is SDCC and is available also in 64bit package on most 64bit Linux distros. If not, you can compile it from sources, as is an open source project. So, not really a problem here.

  2. Luis Kunzler

    I have the following problem:

    root@dell5437:/home/luis.kunzler/stm8_teste/sdcc-examples-stm8# stm8flash -c stlinkv2 -p stm8s003?3 -w blinky.ihx
    Determine FLASH area
    Could not open USB device.

    Do you know what’s going on?

  3. Pham Tuan Kiet

    I have a problem:
    pham@pham-laptop:~/stm8flash$ ./stm8flash -cstlinkv2 -pstm8s003?3 -s flash -w ../sdcc-examples-stm8/blinky.ihx
    Determine FLASH area
    Due to its file extension (or lack thereof), “../sdcc-examples-stm8/blinky.ihx” is considered as INTEL HEX format!
    196 bytes at 0x8000… Tries exceeded

    Do you know what’s going on?

  4. Hauke Walden

    Check out this thread, it helped me with the “tries exceeded” error. https://github.com/vdudouyt/stm8flash/issues/38

  5. Hello, thanks for the updated comparison.

    I want to install sdcc+stm32cubeide(or eclipse) in windows10.

    I installed sdcc of:

    https://sourceforge.net/projects/sdcc/

    and installed :

    https://github.com/gnu-mcu-eclipse/windows-build-tools/releases

    I worked the GPIO,But I couldn’t work with the etc.

    makefile downloaded of internet.

    I think it’s possible to add sdcc because STIDE is based on eclipse,Of course I did this to some extent for gpio.

    (Software IAR-stm8 has a boring environment)

    (please create video for this)

    I’ll send you the files

    http://8upload.ir/uploads/f880377312.jpg

    http://8upload.ir/uploads/f156972770.rar
    please help me

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.