Open-CMSIS-Pack / CMSIS-Driver_STM32

CMSIS Software Pack repository for interface adapter mapping from CMSIS-Driver to STM32Cube HAL APIs
https://open-cmsis-pack.github.io/CMSIS-Driver_STM32/
Apache License 2.0
2 stars 3 forks source link

Version

CMSIS-Driver Interface to STM32 HAL

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.

Software Architecture

Useful Links

Available CMSIS-Drivers

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.

Supported STM32 Device Families

Driver Validation

The Driver API Shim implementations are validated using the CMSIS-Driver_Validation tests.

Usage

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:

Software Pack

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.

Using the development repository

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

Generate software pack

The software pack is generated using bash shell scripts.

GitHub Actions

The repository uses GitHub Actions to generate the pack, publish documentation, and verify reference applications:

Repository top-level structure

Directory Description
.github/workflows GitHub Actions.
Documentation Doxygen source of the documentation.
Drivers Source code of the Driver API Shim Interfaces.

License

The CMSIS-Driver shim interfaces to STM32HAL are licensed under License.

Contributions and Pull Requests

Contributions are accepted under License. Only submit contributions where you have authored all of the code.

Issues and Labels

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: