STM32 development

Tips and tricks for developing with STM32 microcontrollers.

Context

I have a couple of projects in mind that require microcontrollers, but my knowledge and tools are slowly becoming outdated. I’m familiar with MSP430, PIC, and other less-known microcontrollers, but their relevance is fading away to the point that it is better to use other technologies in new projects. I chose the STM32 family because it offers a wide variety of microcontrollers, from basic and inexpensive to the most advanced, with many peripherals and high speed. Focusing on a single platform will simplify maintenance of development tools and enable more code reuse.

In this project, I will collect lessons, tips, and tricks that appear from exploring STM32 microcontrollers.

Aim

Learn how to work with and program STM32 microcontrollers.

Plan

First, I will build the development kit necessary to start programming, then I will follow examples of how to use specific features, such as GPIOs, timers, analog IOs, PWM, etc. Later, I will build a small real project.

STM32 microcontrollers integrate with the Arduino framework, and some can even run Linux. My approach is different, though. I will be programming mainly in C, as close to the hardware as possible.

This is the roadmap:

  1. Building the toolchain
  2. Peripherals
  3. Project application

Developing framework

As the software development kit, I’m using the SMT32Cube toolchain. It just makes sense to use the official tools provided by ST. They are free and are available for Linux.

On the hardware side, I have an STM32 Nucleo board. The specific model is STM32G491RE. It seems versatile enough to build many projects, and it has its own integrated programmer on the board.