STM32 Microcontroller Blockset enables you to model and deploy motor control and digital power conversion algorithms on STM32 microcontrollers (MCUs) for industrial and automotive applications.
The blockset includes device driver blocks specific to STM32 MCUs, such as ADC, PWM, and timers, and interfaces with the STM32CubeMX tool to configure these peripherals. You can generate optimized C code that calls CMSIS-DSP and CMSIS-NN library functions and deploy generated code directly to STM32 MCUs (with Embedded Coder). You can also integrate machine learning and deep learning models, such as SVMs, FC layers, and LSTMs, for virtual sensors in motor control applications.
The blockset enables you to perform processor-in-the-loop (PIL) testing to assess code execution performance and optimize code across STM32 MCUs. You can connect Simulink models to STM32 hardware for real-time signal monitoring, parameter tuning, and data logging.
Reference Applications
Product Highlights
Single-Click Deployment
Generate code and deploy to STM32 MCUs with a single click. Generated code automatically calls CMSIS-DSP for optimized signal processing and CMSIS-NN for neural network inference on Cortex-M processors.
Peripheral Support
Use driver blocks for ADC, PWM, digital I/O, UART, I2C, SPI, and FDCAN to configure STM32 MCU peripherals directly in your Simulink model.
Signal Monitoring and Parameter Tuning
Monitor signals and tune parameters in models running on STM32 devices without recompiling model.
PIL Testing
Run PIL tests from MATLAB and Simulink to verify numerical equivalence and profile execution time.
Connected I/O Simulation
Stream peripheral data from STM32 hardware into Simulink during simulation. Supported peripherals include ADC, PWM, GPIO, I2C, and SPI.
STM32Cube Integration
Import existing STM32CubeMX project (.ioc) files or create new STM32CubeMX projects in Simulink. Optionally, generate STM32CubeIDE-compatible projects.
Supported Hardware
All Nucleo, discovery, evaluation, and custom boards based on the following processor series are supported.
High Performance
- STM32H7xx (dual-core)
- STM32H7xx (single-core)
- STM32H5xx
- STM32F7xx
- STM32F4xx
- STM32F2xx
Mainstream
- STM32G4xx
- STM32G0xx
- STM32F3xx
- STM32F1xx
Ultra-Low-Power
- STM32U5xx
- STM32L5xx
- STM32L4xx
Wireless
- STM32WBxx
Product Resources:
STM32 Microcontroller FAQs
STM32 Microcontroller Blockset is a MathWorks product that lets you design, simulate, and deploy motor control, digital power conversion and signal processing algorithms on STMicroelectronics STM32 microcontrollers.
The blockset supports motor control, digital power conversion, and signal processing applications, with reference examples available for each of these domains.
The blockset supports all Nucleo, discovery, evaluation, and custom boards based on STM32 processor series including High Performance (STM32H7xx, STM32H5xx, STM32F7xx, STM32F4xx, STM32F2xx), Mainstream (STM32G4xx, STM32G0xx, STM32F3xx, STM32F1xx), Ultra-Low-Power (STM32U5xx, STM32L5xx, STM32L4xx), and Wireless (STM32WBxx) families.
The blockset includes driver blocks for ADC, PWM, digital I/O, UART, Hardware interrupt, Timer, I2C, SPI, MODBUS and CAN, which you can use to configure STM32 MCU peripherals directly in your Simulink model.
Yes, the blockset supports single-click deployment, and the generated code automatically calls CMSIS-DSP for optimized signal processing and CMSIS-NN for neural network inference on Cortex-M processors (requires Embedded Coder).
Yes, you can integrate machine learning and deep learning models such as SVMs, FC layers, and LSTMs, which are particularly useful for virtual sensors in motor control applications.
Yes, you can monitor signals and tune parameters in models running on STM32 devices in real time without recompiling.
Connected I/O Simulation lets you stream peripheral data from STM32 hardware directly into Simulink during simulation, with support for ADC, PWM, GPIO, I2C, and SPI peripherals.
You can import existing STM32CubeMX project (.ioc) files or create new STM32CubeMX projects directly in Simulink, and optionally generate STM32CubeIDE-compatible projects for further development and debugging.
You can run processor-in-the-loop (PIL) tests from MATLAB and Simulink to verify numerical equivalence between your model and the generated code, and to profile code execution time on the target hardware. You can also use the execution profiler block to perform real-time execution profiling of algorithms.