This is a HAL layer targeting my favourite STM32 series processors. Currently only the STM32L0's and STM32F0's are supported. Other series may be added in future, but I will prioritise the smaller processors.
- A clean API for all peripheral functions
- 'Opt in' design philosophy. Modules only need to be considered when required.
- Clock management and interrupts are internally handled within the modules.
- Expected features like UART circular buffers are built-in
- Much less bloat than a vanilla STM32Cube project. A project using many peripherals including USB-CDC can easily compile to under 16KB.
- Still compatible with the Cube if additional functionality needed (I still use some of it too)
- There is very little abstraction between the STM32X api and the hardware. This promotes efficiency and predictibilty.
- Low power is a key use case for this project: Low power modes are supported, and peripheral init/deinit is under user control.
- Create a new project using the STM32CubeIDE. STM32Cube should be the targeted project type.
- Ensure the complete STM32Cube Drivers are added to the project. This can be done by enabling all peripherals in the IOC editer. Alternately download them from ST.
- Remove junk source from the Core directory. Only
system_stm32*xx.c
, andstartup_stm32*.s
should remain. - Checkout the STM32X repo into your project. I recommend adding it as a git sub-module. Add
../STM32X/Lib
to your include paths. Change the resource configurations for the STM32X/Lib folder, so that it not excluded from the build. - Copy in the replacement
stm32*xx_hal_conf.h
,main.c
, andBoard.h
file from the STM32X/Templates folder into your Core/ folder. - Edit
Board.h
to configure your peripherals. Ensure the correct processor is defined at the top. - Build to confirm that the environment is set up correctly.
Documentation for each module can be found in Docs
The CORE module provides a lot of basic functionality, and should be your starting point. Next, GPIO and UART make for good examples of what to expect from this project.