2025-08-26 10:37 PM - last edited on 2025-12-22 9:50 AM by Andrew Neil
I have experience with PIC and AVR microcontrollers, but they lack the good debug features of the STM8 series. Furthermore, these microcontrollers aren't cheap. While looking for simple and inexpensive chips, I keep coming across the STM8 series.
Mastering a new microcontroller takes time. I'm confused about learning the STM8 because STMicroelectronics is recommending their STM32 series, which uses the ARM Cortex-M core. This recommendation makes me wonder if investing time in the STM8 is a good idea, or if it would be better to learn the more widely-supported and future-proof STM32 family.
Solved! Go to Solution.
2025-12-09 5:04 AM
So, in that light, I don't follow the reasoning here:
@whitehorsesoft wrote:But for a hobby/training project, I would recommend STM8 for the "bare metal" experience. .
Surely, something like AVR would be more appropriate here - as it has far wider support ?
That may be. Sorry, I was thinking in scope of ST products.
2025-12-11 11:09 AM
Thank you, @Peter BENSCH !
I'm sorry that I did not have enough time to answer.
Your offer to use modern MCUs is good, but I work with assembled boards, and I see that these MCUs are not popular. Therefore, I found just a board with one from your list.
2025-12-15 6:39 AM
2025-12-15 1:39 PM
Thank you, @DarekR, very much!
It is what I need. Will read with satisfaction!
2025-12-15 11:47 PM
Both the STM32 and the STM8 have good support in current FOSS tools. For the STM32, the FOSS toolchain is based around the GCC or clang compilers, for STM8 around the SDCC compiler.
While the non-free Cosmic/IAR/Raisonance have been stagnating, SDCC keeps improving, including support for current and future C standards, and improved optimizations (to a lesser degree - after all the code generated by SDCC is already quite good).
A comparison of compilers targeting the STM8 from 2024: http://www.colecovision.eu/stm8/compilers.shtml
2025-12-16 2:46 AM - edited 2025-12-16 2:47 AM
Well, that's just compilers - what about other tools ... ?
Remembering that the specific audience here is beginners.
2025-12-16 2:52 AM - edited 2025-12-16 3:22 AM
Depends on what tools they are looking for, and what kind of beginner they are.
E.g. a beginner to STM8 that has worked with IAR before likely would prefer the IAR suite for STM8. A beginner to STM8 that previously used GCC with Code::Blocks or Visual Studio would likely prefer to use SDCC with Code::Blocks or Visual Studio.
P.S.: OP stated previous experience with PIC and AVR. PIC is likely SDCC (older 8-bit ones) or GCC (newer ARM-based ones) or XC8. AVR is most likely GCC or XC8. SDCC should be relatively easy to get started with for someone with GCC experience. Also, someone with IAR or GCC experience would likely feel limited by the gaps in C standard support in the Cosmic and Raisonance compilers.
P.S.: Earlier I had made a mistake here, an listed Keil, which was wrong; my edit to fixy it apparently overlapped with a reply stating that I was wrong, so the reply below stating that I wam wrong is correct and fixed a mistake in an earlier version of the P.S. text above.
2025-12-16 2:59 AM - edited 2025-12-16 3:00 AM
And all of those are more than just compilers.
@Philipp Krause wrote:PIC is most likely Keil
No, Keil never supported PIC - before ARM, the focus was 8051 (and derivatives).
(although, recently, Microchip seem to be putting the "PIC" label onto their Cortex products)
2025-12-16 3:30 AM - edited 2025-12-16 3:34 AM
OK, but what other tools would you be looking for beside the compiler?
An IDE? As stated, AFAIK, Code::Blocks and Visual Studio work fine with SDCC.
A tool to write and read the flash on the STM8? stm8flash will do.
On-target debugging? That apparently is still slightly more involved using free tools, but it can be made to work with the ELF/DWARF output from SDCC using a GDB fork and OpenOCD.
2025-12-16 3:48 AM
@Philipp Krause wrote:On-target debugging? That apparently is still slightly more involved using free tools
Indeed. I remember the grief of getting Eclipse to work for STM32 debug before ST came out with a ready-to-go version.
The point is, for PIC and AVR, the manufacturer (now Microchip for both) provides good, free, ready-to-use tools.
But I don't understand what @rabbi141 meant by, "they lack the good debug features" - certainly for AVR.