Skip to content

CMSIS Software Pack repository for interface adapter mapping from CMSIS-Driver to STM32Cube HAL APIs

License

Notifications You must be signed in to change notification settings

Open-CMSIS-Pack/CMSIS-Driver_STM32

Repository files navigation

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).

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

  • Documentation - access to CMSIS-Driver Interface to STM32 HAL user's manual.
  • Raise Issues - to provide feedback or report problems about the CMSIS-Driver Interface to STM32 HAL.
  • CMSIS-Driver - access to CMSIS-Driver documentation.
  • MDK-Middleware - development repository of the MDK-Middleware that uses these drivers.

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

The Driver API Shim implementations are using the STM32Cube HAL interface and therefore support a wide range of STM32 device families. Refer to the STM32 Device Family Packs for further details as some STM32Cube HAL implementations have inconsistencies.

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 Documentation, 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.

  • ./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
    

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 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:

  • bug – We consider this issue to be a bug that will be investigated.
  • wontfix - We appreciate this issue but decided not to change the current behavior.
  • enhancement – Denotes something that will be implemented soon.
  • future - Denotes something not yet schedule for implementation.
  • out-of-scope - We consider this issue loosely related to CMSIS. It might by implemented outside of CMSIS. Let us know about your work.
  • question – We have further questions to this issue. Please review and provide feedback.
  • documentation - This issue is a documentation flaw that will be improved in future.

About

CMSIS Software Pack repository for interface adapter mapping from CMSIS-Driver to STM32Cube HAL APIs

Resources

License

Stars

Watchers

Forks

Packages

No packages published