主要内容

Hardware Setup for STM32 Microcontroller Blockset

To develop and deploy applications on supported STM32 hardware using MATLAB® and Simulink®, you must install the required versions of STM32CubeMX, third-party tools, firmware packages, and toolchains. Completing the setup ensures seamless integration between your model and the target hardware.

Hardware Setup for Third-Party Tools

The hardware setup for STM32™ Microcontroller Blockset installs and configures essential third-party tools that enhance modeling and deployment capabilities.

ToolPurpose
STM32CubeMXGenerates peripheral initialization C code for STM32 microcontrollers.
Armclang Compiler (Optional)Builds C/C++ applications for ARM® processors using an optimized compiler toolchain.
STM32CubeProgrammer (Optional)Downloads the generated executable to the STM32 microcontroller.
STM32CubeCLT (Optional)Uses CMSIS SVD files to display register information.
GNU ToolsProvides a suite of open-source development utilities for building embedded applications.
CMSISDefines a standardized interface for Arm-based microcontrollers to improve software portability.
CMSIS-DSPOffers optimized digital signal processing functions for real-time embedded applications.
CMSIS-NNProvides highly efficient neural network kernels for embedded machine learning applications.
Legacy Libraries (as required)Some legacy STM32 MBED-based boards require MBED OS, LWIP Source, or Arduino Modbus Library, depending on the selected processor.

Run Hardware Setup

To enable all STM32 Microcontroller Blockset features, run the hardware setup using one of the following methods.

Run from MATLAB Command Window

  1. At the MATLAB command prompt, enter:

    stm32setup

    This command opens the STM32 Hardware Setup wizard.

    stm32setup

  2. If the setup screen appears distorted or scaled incorrectly, set Display Text Scaling to 100% in your system display settings.

  3. Follow the on-screen instructions to configure STM32 hardware and third-party tools.

  4. After completing the setup, open the provided examples to get started with STM32 hardware workflows.

Run from MATLAB Add-On Manager

  1. In MATLAB, on the Home tab, in the Environment section, select Add-Ons > Manage Add-Ons.

  2. In the Installed Add-Ons list, click the Options button next to STM32 Microcontroller Blockset , and select Setup.

    STM32 Setup

  3. Follow the guided steps in the Hardware Setup window.

Verify Setup and Explore Examples

After completing the setup:

  • Explore example models in the STM32 Microcontroller Blockset to learn hardware-specific workflows.

  • Verify connections and test communication between your host and target hardware.

See Also

| |