Getting Started With STM8

There are so many different CPUs today and often the hardest thing about using any of them is getting started and gathering the right software tools. If you’ve ever eyed up the very inexpensive STM8 processor, you’ll want to check out [Shane Burrell’s] video (see below) about how to get started with the STM8.

The STM8 isn’t a 32-bit processor — you could probably guess that from the name. [Shane] uses SDCC (small device C compiler) to target the little chip. He also shows how he manages a fairly substantial piece of code and how he controls the build process.

The good thing is, this isn’t a blinking LED example. The code he shows uses interrupts and reads analog values. He doesn’t get into a lot of details, but he does talk about the motivation for some of the code. You’ll also pick up some tips like storing firmware with hardware designs in Git.

We think the example has something to do with the vehicle you can see in the video. We’ve seen the STM8 doing duty inside a soldering iron recently. If you want to pick a processor beyond the obvious, check out [Jay Carlson’s] comparison of 21 microcontrollers that cost under a buck.

17 thoughts on “Getting Started With STM8

    1. .. and if that lot is tl;dr, this particular post might whet your appetite … http://www.stm32duino.com/viewtopic.php?f=52&t=2682&start=20#p39498
      … in particular the remark …
      “For example the W1209 thermostat as a “development board” is under $2.00 complete with 3 digit display, 3 user defined buttons, a relay, a NTC sensor, and STLink programming pins brought out on the PCB (through holes to the left of the display in this case). “

        1. Beware! Now they come with nuvoton N76E003AT20 (8051 core) chips. The sucker is pin compatible except for pin 8, VCAP, so C5 is open on the otherwise identical board…

  1. STM8 dev boards are almost impossibly cheap on Aliexpress, even cheaper than the STM32 “Blue Pill”. $0.74 with shipping:

    > https://www.aliexpress.com/item/ARM-STM8S103F3P6-STM8-Minimum-System-Development-Board-Module-For-Arduino/32313575368.html

    You need an ST-Link to program it, but that’s only another $2 and they can be used to program/debug other STM micros.

    > https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180212201608&SearchText=st-link

    Yes these boards and the programmers actually work. As long as you know what you are getting into they are great. They are fairly easy to use, but not quite as friendly and idiot proof as an Arduino, so maybe not for beginners.

  2. I am currently in the process of writing a new firmware for my PC Speaker. I opened it to check the mains PSU inside only to find a debug interface behind a easy to access cover in front and a STM8 controlling everything.

  3. If you want to use ST’s StdPeriph library with SDCC on that chips, you should know that compiler is unable to reduce an unneeded code – all written functions (not ever used) will be in your binary file. The workaround is to split all your libs on separate files (single function at each file).
    So if you do not want to deal with registers and want to use StdPeriph, check this: https://github.com/grytole/stm8builder

Leave a Reply to blkhawkCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

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