Some people love tiny houses, but I’m fascinated by tiny computers. My house is littered with Raspberry Pi’s, but recently my friend Andy Selle introduced me to Blue Pill single-board computers. These are ARM M3 CPUs running at 72MHz, available for $2 or less on Ebay and Aliexpress, even when priced individually. These are complete computers with 20KB of RAM and 64KB of Flash for programs, and while that may not sound like much memory, their computing power as 32-bit ARM CPUs running at a fast clock-rate make them very attractive for applications like machine learning that rely more on arithmetic than memory. Even better, they can run for weeks or months on a single battery thanks to their ultra-low energy usage.
This makes them interesting platforms to explore the emerging world of smart sensors; they may not quite be fifty cents each, but they’re in the same ballpark. Unfortunately I’m a complete novice when it comes to microcontrollers, but luckily Andy was able to give me a few pointers to help me get started. After I struggled through a few hurdles, I managed to get a workflow laid out that I like, and ran some basic examples. To leave a trail of breadcrumbs for anyone else who’s fascinated by the possibilities of these devices, I’ve open-sourced stm32_bare_lib on GitHub. It includes step by step instructions designed for a newbie like me, especially on the wiring (which doesn’t require soldering or any special tools, thankfully), and has some examples written in plain C to play with. I hope you have as much fun playing with these tiny computers as I have!
I’ve done a lot of bare bones ARM programming and they are awesome beasts. The hassle is getting started with all the configuration of clock chain pins devices etc at startup. Once you are past that you are cherry. The manufacture often provides their libraries but I’ve found them over complete and riddled with bugs. It’s good to learn the standard ARM interface libs and have a mental separation from the branded ones. Arduino like environments exist which make everything simple but you don’t have much control over the many complex peripherals.
Hi! There is a great book for someone learning STM32 https://www.cs.indiana.edu/~geobrown/book.pdf you should read the first chapters.
It’s also great because it works well with Rust, for people like me who are afraid of raw pointers, thanks to japaric’s work