Goals
- Generic implementation using
STM32 HAL API
to compile onto every STM32 board. - For the most used boards, optimize code paths using direct register access.
- Make adding boards easy
- Make as compatible with default libraries as possible
Project structure
Director | Description |
---|---|
system/CMSIS |
CMSIS header files from ARM for cortex-M0/M3/M4/M7 microcontrollers |
system/STM32XX/CMSIS_Inc |
CMSIS header files specific STM32 chips, contains memory layout and register access for every chip |
system/STM32XX/CMSIS_Src |
CMSIS startup assembly files specific STM32 chips, contains ISR vector for interrupt handlers and reset handler default implementation |
system/STM32XX/HAL_Inc |
STM32 Hardware Abstraction Layer headers for every chip series |
system/STM32XX/HAL_Src |
STM32 Hardware Abstraction Layer implementation for every chip series |
system/STM32XX/stm32_chip |
For every chip, default and alternate pins, clock frequencies, cannels for peripherals: SPI, I2C, ADC... autogenerated from CubeMX db/*.xml files with tools/script/generate_build_define.py. |
cores/arduino/ |
Arduino API definitions and Arduino-utility functions. |
cores/arduino/stm32_HAL |
Select (compile) the specific files from system/STM32XX/HAL_Src , based on boards.txt *.build.series value |
cores/arduino/usb |
STM32 USB Middleware |
cores/arduino/stm32 |
STM32 implementation of the Arduino API. First implementation is a light wrapper around HAL |
libraries/[SPI|Wire|...] |
STM32 implementation of the Arduino libraries API. First implementation is a light wrapper around HAL |
variants/.../* |
Variant specific files: ldscript.ld for memory layout, systemclock_config.c for clock setup, generated by STM32CubeMX, variant.* for variant pin layout and pin definitions (pin layout can be copy/pasted from system/STM32XX/stm32_chip/* ). |
General development direction
- Self-test code to run on a board to check if the API works for that variant.
- Automatic unit test compilation. This ensures that a code change does not break other boards.
- Automatic library compilation, to be as arduino-compatible as possible.
- Benchmarks to pinpoint bottlenecks.
- Hacker-friendly: Enable to use HAL/CMSIS; enable overriding of every IRQ handler.
- Add DFU/MSC/HID/MIDI to USB. Rewrite USB to PluggableUSB to be more arduino-compatible.
- Create SDIO library
- Create I2S library
- Create CAN library