Skip to main content

First Step

STM32 board is a powerful microcontroller board that can be used for various applications. In this tutorial, we will learn how to set up the STM32 board.

GitHub

Why STM32?

STM32 is a great choice for beginners because:

  • More powerful than Arduino
  • Debuggers are cheap
  • More peripherals

If you need WiFi or Bluetooth, you should use ESP32, but if you need more power, you should use STM32. We will not talk about ESP32 in this tutorial.

esp32 vs stm32: which microcontroller is better for you?

What you'll need

In order to get started with STM32, you will need the following:

  • Blackpill/Bluepill STM32 board:
    • You can purchase a cheap clone Blackpill STM32 board under $4.
  • ST-LINK V2/V3:
    • You need this to upload the firmware to the board.
    • You can purchase a cheap clone ST-LINK V2 under $5.
  • VScode with PlatformIO or Arduino IDE:
    • You can download VSCode from here.
    • You can install PlatformIO from the VSCode extension marketplace.
  • STM32CubeProgrammer

Blackpill board
Blackpill STM32 board

DFU upload

While Blackpill STM32 board supports DFU, which means you can upload the firmware with USB, you should have a ST-LINK to use useful features like debugging.

We recommend the following stack for STM32 development:

  • VSCode with PlatformIO
    • You can use GitHub Copilot for code suggestions, which help you write code faster.
  • ST-LINK V2 Clone
    • Very cheap (< $5)
  • Blackpill STM32 board
    • Very cheap (< $4)
    • DFU support
      • You can upload the firmware using USB as well.
    • More powerful than Bluepill
  • Arduino framework
    • Easy to use
    • Good for beginners

ST-LINK V2 Clone