This is the development repository of the CMSIS-Driver interface to STM32Cube HAL (called Driver API Shim Interface below).
Note: This is currently Work in Progress. Final release is expected in Q3'2024.
User applications and middleware components use CMSIS-Driver to achieve better code reuse and simplify integration in various ecosystems. CMSIS-Driver are generic and independent of a specific RTOS making it reusable across a wide range of supported microcontroller devices.
STM32 microcontrollers already provide powerful drivers, however with a different API interface, call STM32Cube HAL. With this Driver API Shim Interface the CMSIS standards can be used by the software ecosystem and application developers.
The diagram below outlines the software architecture that is used for example by Reference Applications and the MDK middleware examples. Refer to the CMSIS-Toolbox documentation Reference Applications - Header File Structure for a description of the various components in this diagram. The Driver API Shim Interface is configured using STM32CubeMX (CubeMX) that generates via the CMSIS tool integration the file MX_Device.h
.
Driver API Shim Source | Description |
---|---|
ETH_MAC_STM32.c | Ethernet MAC Interface; Can be combined with generic Ethernet PHY Drivers. |
GPIO_STM32.c | GPIO Interface; used for control lines (i.e. SPI) and Virtual I/O interface. |
I2C_STM32.c | I2C Interface that supports Master and Slave modes. |
MCI_STM32.c | MCI Interface that supports SDMMC and SDIO peripherals. |
SPI_STM32.c | SPI Interface that supports Master and Slave modes. |
USART_STM32.c | USART Interface in asynchronous mode without control lines. |
USBD_STM32.c | USB Device Interface supports high-speed and and full-speed mode. |
USBH_STM32.c | USB Host Interface supports high-speed and and full-speed mode. |
The Driver API Shim implementations are validated using the CMSIS-Driver_Validation tests.
Add the following packs and components to your project.
packs:
- pack: Keil::STM32U5xx_DFP@>=3.0.0 # choose the DFP that matches your device
- pack: ARM::CMSIS@>=6.0.0
- pack: ARM::CMSIS-Driver_STM32
components:
- component: CMSIS:CORE # CMSIS-Core component is required
- component: Device:CubeMX # Component that connects to CubeMX
- component: CMSIS Driver:USART # Add Driver API shim interface
The drivers require configuration with STM32CubeMX. The configuration settings are exemplified in the Driver API Shim Source, but depend on the actual device that is used.
For additional information refer to:
CMSIS-Toolbox - Configure STM32 Devices with CubeMX for usage information of STM32CubeMX with CMSIS projects. In µVision start CubeMX in dialog Manage Run-Time Environment from the component Device:CubeMX
.
CMSIS-Driver - Theory of Operation describes the usage of CMSIS-Drivers in your application code via an access struct. The driver instances available depend on the CubeMX device configuration as explained in the Driver API Shim Source.
The Driver API Shim Interface is released as CMSIS software pack and therefore accessible by CMSIS-Pack enabled software development tools. The pack is compatible with tools such as µVision 5.40 and the CMSIS-Toolbox.
This development repository can be used in a local directory and mapped as software pack using for example cpackget
with:
cpackget add <path>/ARM.CMSIS-Driver_STM32.pdsc
The software pack is generated using bash shell scripts.
./gen_pack.sh
(provided via Open-CMSIS-Pack/gen-pack) generates the software pack. Run this script locally with:
CMSIS-Driver_STM32 $ ./gen_pack.sh
./Documentation/Doxygen/gen_doc.sh
generates the HTML documentation from the input in the folder /Documentation/Doxygen/
. Run this script locally with:
CMSIS-Driver_STM32 $ ./Documentation/Doxygen/gen_doc.sh
The repository uses GitHub Actions to generate the pack, publish documentation, and verify reference applications:
.github/workflows/pack.yml
based on Open-CMSIS-Pack/gen-pack-action generates pack and documentation using the Generate software pack scripts.
.github/workflows/gh-pages.yml
publishes the documentation to open-cmsis-pack.github.io/CMSIS-Driver_STM32.
Directory | Description |
---|---|
.github/workflows | GitHub Actions. |
Documentation | Doxygen source of the documentation. |
Drivers | Source code of the Driver API Shim Interfaces. |
The CMSIS-Driver shim interfaces to STM32HAL are licensed under .
Contributions are accepted under . Only submit contributions where you have authored all of the code.
Please feel free to raise an issue on GitHub to report misbehavior (i.e. bugs) or start discussions about enhancements. This is your best way to interact directly with the maintenance team and the community. We encourage you to append implementation suggestions as this helps to decrease the workload of the very limited maintenance team.
We will be monitoring and responding to issues as best we can. Please attempt to avoid filing duplicates of open or closed items when possible. In the spirit of openness we will be tagging issues with the following: