Get Started with STM32 Microcontroller Blockset
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.
Tutorials
- Get Started with STMicroelectronics STM32 Processor Based Boards
Run a Simulink model on STM32 processor.
- Read Analog Voltages from External Sensors on an STM32 Processor
Measure analog signals on an STM32 processor by using the Analog to Digital Converter (ADC) block.
- Send and Receive CAN or FDCAN Messages on a STM32 processor
Exchange data between STM32 processor based boards using CAN or FDCAN communication.
- Model DAC and ADC for Signal Conversion on STM32 Processor
Model Signal and Voltage Conversion using DAC and ADC blocks. (Since R2026a)
- Compare DAC Converter Output Signals to Reference Signals on an STM32 Microcontroller Using Comparator Block
Evaluate DAC outputs against reference signals on STM32. (Since R2026a)
STM32 Modeling Basics
- Set Up Scheduling Options for STM32 Processor-Based Boards
Configure single-rate or multi-rate scheduling on an STM32 processor.
- Configure STM32CubeMX with Simulink
Configure STM32 processor-based boards using an STM32CubeMX project in Simulink.
- Serial Configuration for Monitor & Tune and PIL for STM32 Processor-Based Boards
Configure serial communication for External mode and PIL on an STM32 processor.