embedawayz
The STM32F103C8 is a good example. If you buy a few dozen off of AliExpress or TaoBao, "blue pill" boards containing them and a microUSB connector cost less than $3 each.
They only run at 72MHz, and they don't have floating-point hardware, but the price point means that you can give them away without a second thought. When someone has an idea for a Halloween decoration, or a garden sensor, or a proof-of-concept, it's usually my first choice because it costs less than a coffee.
Once it stops getting rained on, and corroded, and coated in dust, and submerged, and fried by a squirrel who thought wires were edible...then you can reach for the top of the line.
STM32F030F4 ($0.55@2500) -> STM32G030F6 ($0.49@2500):
* Clock speed: 48MHz -> 64MHz
* Flash memory: 16KiB -> 32KiB
* SRAM: 4KiB -> 8KiB
* CPU core: Cortex-M0 -> Cortex-M0+
The newer chips are also on a smaller process node, so they can run off of slightly lower voltages and use a bit less power.
They're incremental improvements, but time is starting to march on...
https://developer.arm.com/tools-and-software/open-source-sof...
But when you write a program for a microcontroller, you don't have an OS kernel, so your code needs to include drivers for anything that you want to communicate with.
It's a little outdated, but I like this introduction to STM8 chips (which this article also mentions) as a quick crash course on embedded C:
https://zeptobars.com/en/read/GD32F103CBT6-mcm-serial-flash-...
I haven't tried anything complicated with the peripherals though, and the thing is, STM32F103 chips are so cheap already. The design is over 10 years old, and ST is so good at making them that most "64KB" chips actually have 128KB of Flash.
The GD32V chips are very cool, though; they keep the STM32-alike peripherals, but they use a faster RISC-V CPU core (rv32imac).