STM 32 Development Board and applications
STM32 is a 32-bit microcontroller and microprocessor integrated circuit, manufactured by
STMicroelectronics. It is commonly used for evaluation, learning, prototyping, and product
development. It has multiple key features and typical applications. STM32 boards are based on the STM32 family of 32-bit ARM microcontrollers from STMicroelectronics.
STM32 Family
STMicroelectronics has introduced microcontrollers Cortex-M0, Cortex-M0+, Cortex-M3, etc.
and microcompressors MP1, MP2 series. Each STM32 microcontroller is designed for
specific performance, power efficiency, and feature requirements. So we can make them
suitable for a wide range of embedded application STM32 boards come in many variants because STMicroelectronics and third-party makers support a wide range
of MCU families. Official figures include:
ST Nucleo boards:
Over 70 variations across Nucleo-32, Nucleo-64, and Nucleo-144 formats. Nucleoboards are affordable prototyping boards designed to help you get started with STM32
microcontrollers. They support many STM32 variants and are great for general embedded
projects where you design your own circuits or add external modules.
Key Features:
Arduino compatibility: Most have Arduino headers (Nano or Uno), so you can use shields.
ST Morpho headers: Expose full I/O for complex connections.
Support for popular IDEs: STM32CubeIDE, Keil, IAR, Mbed, GCC.
Multiple sizes: Nucleo-32, Nucleo-64, Nucleo-144 (refers to the number of MCU pins).
Ideal For: Learning STM32 basics, prototyping custom hardware, projects needingflexible I/O.
Discovery boards:
Many different Discovery kits exist (with sensors, displays, etc.). While there’s no exact
count published, dozens have been released over time, covering different MCU series.
Discovery boards have onboard peripherals like sensors, displays, audio interfaces, and more.
They’re excellent for exploring what specific STM32 chips can do with real peripheral examples.
Key Features:
It has an Integrated ST-LINK debugger/programmer built-in function.
Having onboard sensors (e.g., gyros, accelerometers), LCDs, touch, or wireless modules, depending on model. It's very useful for small projects for hobbyists.
STM32F429 Discovery – Cortex-M4F, color TFT display.
The discovery board is very useful for interactive demos, signal processing, and graphics applications.
STM32L4 Discovery IoT kits – low-power + wireless.
Ideal For: Learning peripherals, demos, interactive UI, sensor fusion, wireless IoT.
STM32 Eval Boards - Full Feature Reference Platforms:
Eval (evaluation) boards are designed as reference designs. They expose almostall MCU pins and include external transceivers, sensors, memory interfaces, and more.
They offer the closest experience to real product hardware.
Key Features:
Complete hardware setups showcasing full STM32 capabilities.
Suitable for complex applications needing advanced connectivity or performance.
Often more expensive and less “plug-and-play” than Discovery or Nucleo boards.
Ideal For: Product prototyping, performance evaluation, and advanced embedded design.
Community & Third-Party Boards:
Hundreds of low-cost “core boards” exist on global marketplaces (e.g., Alibaba/Amazon) with
different MCUs and feature sets.
While not official ST boards, there are many popular STM32-based boards from the community:
Blue Pill Low-cost board (e.g., STM32F103) with Arduino–style headers - great for
breadboarding.
Black Pill – Similar but typically with faster MCUs (e.g., STM32F401).
Note: Always verify authenticity- some cheap boards use cloned chips.
Comparison of STM32 Boards
Most Popular STM32 Boards (Based on Projects & Sales):
Popularity depends on the project type (learning vs advanced prototyping), but some clear favorites emerge based on sales data and community trends:
Top Popular / Best-Selling Models:
These boards show up most often on marketplaces and hobbyist purchases:
STM32F103C8T6 core board (“Blue Pill”)
Extremely cheap and widely available - great for basic MCU tasks and learning.
STM32F407VET6 / F407 Discovery
Powerful Cortex-M4 board with lots of peripherals - popular in embedded projects.
NUCLEO-F103RB (ST Nucleo)
Easy prototyping + Arduino shields + built-in ST-LINK debugger.
NUCLEO-F446RE / similar Nucleo boards:
Balanced performance and ecosystem support - widely used in learning and projects.
The STM32F103C8T6 board appears consistently as best-selling/hot-sellingon marketplaces (For hobbyist and industrial applications).
Most Famous or Widely Used According to Project Type:
Learning & Beginner Projects:
STM32 Nucleo boards (e.g., NUCLEO-F103RB, NUCLEO-F401RE)
are very easy to start for many projects, have a built-in ST-LINK debugger, having a lot of examples.
STM32F103C8T6 minimum board (Blue Pill):
It is very cheap and the same as an Arduino because it looks like an Arduino board.
Recommended for: basic embedded learning, GPIO/I2C/SPI timers, PWM, small robotics,
LED/sensor interfacing.
Intermediate / Advanced Projects:
Discovery boards (e.g., F407, F429, H7 series): Onboard features like displays, sensors, USB, etc.
High-performance Nucleo (e.g., NUCLEO-H743ZI2): Great for DSP, RTOS, heavy interfaces.
Recommended for: RTOS systems, advanced peripheral control, graphics, audio processing,
and complex communication protocols.
Cheapest & Easiest Boards:
Lowest-Cost Boards
STM32F103C8T6 boards – often ~$1–$5 wholesale, ~$7–$15 retail.
Small MCU boards (STM32F030, F401, F411) – available around $1–$3.
ST-LINK or compatible programmer.
Most Beginner-Friendly (Easy to Start):
Official ST Nucleo boards – built-in ST-LINK debugger means the easiest setup.
Boards with Arduino-style headers also make breadboarding easy.
Typically, prices start at ~$10–$20 for official boards.
Quick Summary:
If we take a quick summary to categorize and as per ranking between many modules,
Tips for Choosing:
Just learning MCU basics? → Start with a NUCLEO board with ST-LINK built in.
Want the lowest price per unit? → Go for cheap STM32F103/STM32F401 core boards.
Advanced/peripheral-heavy project? → Discovery kits or high-performance Nucleo boards.
STM32 Programming Methods:
To program STM32 development boards, you need:
Firmware libraries (what runs on the MCU)
Development software / IDE (where you write code)
Programmer/debugger tools
Programming languages
Below is a clear breakdown regarding software and integrated development environments.
1. Firmware & Software Frameworks (Libraries)
These are provided mainly by STMicroelectronics.
STM32 Cube Ecosystem (Most Used Today)
STM32 CubeMX:
Graphical configuration tool
Configure GPIO, I2C, SPI, ADC, USB, CAN, etc.
Generates initialization code
Saves huge setup time
STM32 HAL (Hardware Abstraction Layer):
High-level driver library
Easier for beginners
Slightly slower than low-level drivers
LL (Low Layer) Drivers:
Faster and more optimized
Closer to hardware registers
Preferred for performance-critical applications
Standard Peripheral Library (Old):
Used in older STM32 projects
Mostly replaced by HAL/LL
Still seen in legacy STM32F1 projects
CMSIS:
ARM Cortex standard library
Low-level core access (NVIC, SysTick, etc.)
Used internally by most STM32 libraries
Middleware (Optional Add-ons):
Available through STM32Cube:
FreeRTOS (Real-time OS)
USB Device/Host stack
TCP/IP (LWIP)
FATFS (SD card)
TouchGFX (GUI framework)
Bluetooth / LoRa / WiFi stacks (depending on board)
2. Software / IDEs Used to Program STM32
Most Popular (Official & Free)
STM32CubeIDE
Official IDE from ST
Based on Eclipse + GCC
Integrated CubeMX + Debugger
Free
Most recommended for beginners
Professional IDEs:
Keil MDK
Very popular in the industry
Excellent debugger
Free limited version (code size limit)
Paid for the full version
IAR Embedded Workbench:
Highly optimized compiler
Used in professional embedded systems
Paid license (trial available)
Open-Source Options:
PlatformIO
Works inside VS Code
Supports STM32 + Arduino + ESP
Very popular with makers
VS Code + GCC + OpenOCD:
Fully customizable
Advanced users
3. Programmer / Debugger Tools
Most official boards include a built-in debugger:
ST-LINK
Built into Nucleo & Discovery boards
Programs via SWD
Supports debugging
If using cheap boards (e.g., Blue Pill), you may need:
External ST-LINK
USB-to-Serial (for UART flashing)
4. Programming Languages Used:
C (Most Common)
Main language for STM32
Fast, efficient
Used with HAL/LL libraries
Industry standard
C++
Used in advanced applications
Supported by STM32CubeIDE
Used with RTOS or OOP designs
MicroPython
Python for microcontrollers
Easy for beginners
Slower than C
Not supported on all STM32 chips
Arduino (C++ Based)
Some STM32 boards support the Arduino core
Easier for hobby projects
Assembly
Rarely used
Only for ultra-critical optimization
What Is Most Used?
What Industry Uses?
C language
HAL or LL
Keil / IAR
Often with FreeRTOS
Beginner Recommendation:
If you're starting:
Install STM32CubeIDE
Use HAL drivers
Start with the C language
Use a Nucleo board (built-in ST-LINK)
Simple STM32 LED Blink Program:
Let’s start with a simple STM32 LED Blink example in C using:
STM32CubeIDE
HAL library
Any STM32 board (example: Nucleo or Blue Pill)
I’ll show:
CubeMX configuration idea
Full main.c example
Explanation
Example: LED Blink Using HAL (C Language)
Assumption
LED connected to GPIO Pin PA5
(On many Nucleo boards, PA5 is connected to the onboard LED.)
Step 1 – CubeMX Configuration:
Inside STM32CubeIDE:
Create a new STM32 project
Select your MCU or board
In Pinout view:
Set PA5 → GPIO_Output
Go to Clock Configuration → leave default
Generate code
CubeMX will create initialization code automatically.
Step 2 – main.c Code (LED Blink):
Below is the important part inside while(1):
#include "main.h"
int main(void)
{
HAL_Init(); // Initialize HAL library
SystemClock_Config(); // Configure system clock
MX_GPIO_Init(); // Initialize GPIO
while (1)
{
HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_5); // Toggle LED
HAL_Delay(500); // 500ms delay
}
}
What Each Line Does:
What Happens?
LED ON → 0.5 sec
LED OFF → 0.5 sec
Repeats forever
Blink frequency = 1 Hz
What CubeMX Generates for GPIO:
Inside gpio.c:
GPIO_InitTypeDef GPIO_InitStruct = {0};
__HAL_RCC_GPIOA_CLK_ENABLE();
GPIO_InitStruct.Pin = GPIO_PIN_5;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
This sets:
Output mode
Push-pull
No pull-up/down
Low speed
If You Are Using Blue Pill (STM32F103)
Usually LED is on:
PC13
So change this:
HAL_GPIO_TogglePin(GPIOC, GPIO_PIN_13);
How To Flash Program
If using:
Nucleo / Discovery → Built-in ST-LINK
Cheap board → External ST-LINK
Steps:
Connect USB
Click Run → Debug
Code uploads automatically
FreeRTOS LED Blink Task
Let’s move to a FreeRTOS LED Blink Task example on STM32.
We’ll use:
C language
HAL drivers
FreeRTOS (via STM32CubeIDE)
Any STM32 board (example: Nucleo with LED on PA5)
What is FreeRTOS?
FreeRTOS is a small Real-Time Operating System used in embedded systems.
Instead of:
while(1) { }
You create tasks (threads) that run independently.
Step 1 – Enable FreeRTOS in STM32CubeIDE:
Create a new STM32 project
Open .ioc file
Go to:
Middleware → FreeRTOS → Enabled
Leave default settings
Set:
PA5 → GPIO_Output
Generate code
CubeIDE automatically includes FreeRTOS files.
Step 2 – Create LED Task
Inside freertos.c, add:
void StartLedTask(void *argument)
{
for(;;)
{
HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_5);
osDelay(500); // 500ms delay (RTOS safe delay)
}
}
Step 3 – Create the Task in Initialization:
In MX_FREERTOS_Init():
osThreadId_t ledTaskHandle;
const osThreadAttr_t ledTask_attributes = {
.name = "ledTask",
.stack_size = 128 * 4,
.priority = (osPriority_t) osPriorityNormal,
};
ledTaskHandle = osThreadNew(StartLedTask, NULL, &ledTask_attributes);
CubeMX can also generate this automatically if you create a new task in the GUI.
What Happens Now?
Instead of:
HAL_Delay(500);
We use:
osDelay(500);
Why?
How It Runs Internally:
After main() initializes everything:
osKernelStart();
FreeRTOS scheduler starts.
From then:
LED Task runs
CPU switches between tasks automatically
You can add more tasks easily
Example: Two Tasks (Better Demo)
void StartLedTask(void *argument)
{
for(;;)
{
HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_5);
osDelay(500);
}
}
void StartPrintTask(void *argument)
{
for(;;)
{
printf("Hello from FreeRTOS!\r\n");
osDelay(1000);
}
}
Now:
LED blinks every 500ms
UART prints every 1 second
Both run independently
Why Use FreeRTOS?
✔ Multitasking
✔ Real-time scheduling
✔ Task priorities
✔ Semaphores & mutex
✔ Queues for communication
✔ Industry standard
Where It’s Used
Industrial automation
IoT devices
Motor control
Robotics
Medical devices
Bare Metal vs FreeRTOS:
When Should YOU Use FreeRTOS?
Use it if:
You have 3+ independent modules
Need communication between tasks
Want a professional embedded design
Don’t use it if:
Only blinking LED
Very small MCU (low RAM)
Ultra simple project
