Architecture overview

The STM32Cube embedded software architecture is the continuity of the HAL1-based offer.

  • It is designed to be modular, scalable, and maintainable, with a focus on ease of use and integration for developers.

  • It is built on a layered architecture model that separates hardware abstraction, middleware, and application code, promoting code reuse and simplifying the integration of new features.

  • It is designed to be handled by the STM32CubeMX2 tool for components configuration, platform migration, and code generation based on predefined initialization scenarios (templates) for supported MCUs and boards.

STM32 peripheral drivers

The HAL and LL drivers architecture is similar to the HAL1-based one. These drivers integrate with STM32CubeMX2 for graphical configuration and code generation.

Device Family Packs

Each STM32 series comes with a dedicated Device Family Pack (DFP) to ease the device integration in the projects.

Middleware and utilities

The middleware components leverage standardized APIs and low-level ready-to-use interfaces to ease integration and reduce development time. They are designed to be portable across different STM32 devices, supporting efficient product evolution and maintenance. A set of utilities is also provided to support common tasks such as logging, scheduling, and many more.

Board part drivers

The HAL1-based board support packages (BSP) are now called part drivers. They provide a set of independent ready-to-use drivers for STM32 boards. This is a change compared to the HAL1-based offer where BSPs were monolithic and tightly coupled with the examples.

Examples

The examples are board and IDE agnostic, and grouped by layer and features. This is a change compared to the HAL1-based offer where examples were grouped by board.

Folder structure

The STM32Cube embedded software exists with two nominal folder structures depending on the deliverable. Still, the software components are meant to be reusable across any folder structure, as per the user’s convenience and needs.

STM32Cube MCU package

The STM32Cube MCU packages organize the various software layers in a way that facilitates the discovery of the STM32Cube embedded software.

Refer to each package documentation for more details on the folder structure and content organization (see STM32Cube MCU Packages).

In this model, the example projects are provided as linked projects :

  • A linked project includes references to files or folders outside its own main folder.

  • Linked projects are efficient for development environments with shared code,

  • but are less portable and harder to manage in version control, since not all dependencies are inside the project folder.

Standalone project

STM32CubeMX2 and STM32CubeIDE for Visual Studio Code generate projects with a standalone folder structure, where all source code, dependencies, and resources are located within the project’s main folder.

Standalone projects are easy to move, share, or place under version control, since all required files are included in one main directory.

Note

These two folder structures, and their usage, are further described in the STM32Cube Software Examples documentation.