cancel
Showing results for 
Search instead for 
Did you mean: 

How do I start developing for ST8 Microcontrollers

Alex Fedoseev
Associate II

Hi,

I was thinking of developing a small project using ST8 processors, but I did not find information on what do I start from.

The link https://www.st.com/en/microcontrollers-microprocessors/stm8-8-bit-mcus.html#

lists commercial compilers. Are there free compilers for ST8, same as for STM32?

Thank you,

1 ACCEPTED SOLUTION

Accepted Solutions
Patrice HAMARD
Associate II

​Hello

First thing is your MCU selection. It is going to depend on the nature of your project

Automotive (STM8AF/AL)- NonAutomotive (STM8S/L)

Mainstream or Low power (STM8S or STM8L)

Then I suggest you to start with STM8CubeMX and select the appropriate P/N, and configure the device according to your needs.

https://www.st.com/content/st_com/en/products/microcontrollers-microprocessors/stm8-8-bit-mcus/stm8s-series/stm8s103-105.html#tools-software

Several IDE are available (depending on your preference), offering Free C compilers

https://www.st.com/content/st_com/en/products/microcontrollers-microprocessors/stm8-8-bit-mcus/stm8s-series/stm8s103-105.html#tools-software

https://www.st.com/en/microcontrollers-microprocessors/stm8s-series.html#tools-software

Ordering the 64pin Nucleo for the Hardware is a good start as it comes with different exemples. it is a quick hands-on solution.

https://www.st.com/en/microcontrollers-microprocessors/stm8s-series.html#tools-software

For programming the STlink-V3 will be useful for STM8 and STM32.

I hope this will help you to initiate your development.

Kind regards

View solution in original post

7 REPLIES 7
Vyacheslav Azarov
Associate III

If you mean STM8 MCU then Yes. It is SDCC with GDB. https://stm8-binutils-gdb.sourceforge.io/ This is C only compiler by GNU public license.

Patrice HAMARD
Associate II

​Hello

First thing is your MCU selection. It is going to depend on the nature of your project

Automotive (STM8AF/AL)- NonAutomotive (STM8S/L)

Mainstream or Low power (STM8S or STM8L)

Then I suggest you to start with STM8CubeMX and select the appropriate P/N, and configure the device according to your needs.

https://www.st.com/content/st_com/en/products/microcontrollers-microprocessors/stm8-8-bit-mcus/stm8s-series/stm8s103-105.html#tools-software

Several IDE are available (depending on your preference), offering Free C compilers

https://www.st.com/content/st_com/en/products/microcontrollers-microprocessors/stm8-8-bit-mcus/stm8s-series/stm8s103-105.html#tools-software

https://www.st.com/en/microcontrollers-microprocessors/stm8s-series.html#tools-software

Ordering the 64pin Nucleo for the Hardware is a good start as it comes with different exemples. it is a quick hands-on solution.

https://www.st.com/en/microcontrollers-microprocessors/stm8s-series.html#tools-software

For programming the STlink-V3 will be useful for STM8 and STM32.

I hope this will help you to initiate your development.

Kind regards

Willunen
Associate III

You can get the IDE: ST Visual Develop for free from ST.

I use it with the (free) compiler: CSSTM8 from Cosmic.

You need to register your pc (via email, their webinterface doesn't work) to get a license.

This license is for one year, but after that you can simply ask for another license.

Also download the Standard Peripheral Library from ST.

I use partly this library, partly I do direct register configuration.

Succes,

Wilko

The ST-Link V2 works fine as well.

About STM8CubeMX, is it still under active development or is it abandoned? And will errors (see other posts here) in the Standard Peripheral Library be fixed?

Wilko

Xavi92
Associate II

@AlexFjedoseev​ @Community member​ Ake and I have implemented link-time unused code elimination and better GNU binutils support for SDCC. Thanks to these modifications, SDCC can now be considered a serious alternative to propietary compilers such as CXSTM8 or IAR.

See the following link for a small working code example showing these new features:

https://github.com/XaviDCR92/stm8-dce-example

STM8 port of GNU binutils:

https://github.com/XaviDCR92/stm8-binutils-gdb

Fork of SDCC featuring GNU assembler support and bugfixes:

https://github.com/XaviDCR92/sdcc-gas

Also, build OpenOCD 0.10 for ST-Linkv2 support:

https://sourceforge.net/projects/openocd/files/openocd/0.10.0/openocd-0.10.0.tar.bz2/download

Philipp Krause
Senior II

For a large number of evaluation boards,

http://www.colecovision.eu/stm8/

has tutorials for getting started using hte free tools (i.e. the Small Device C Compiler and stm8flash).

Thank you, Wilko