This repository provides the Codal library for the STM32 family of microcontrollers. It contains the drivers and core functionalities necessary to work with STM32-based boards, enabling developers to create applications using the Codal runtime.
Codal STM32 is part of the Codal (Component-oriented Device Abstraction Layer) project, which aims to simplify embedded software development by providing a uniform interface for different microcontrollers. This library specifically targets the STM32 family, making it possible to leverage the full capabilities of these popular microcontrollers through Codal's high-level APIs.
This porting is based on:
- STM32Cube MCU Packages including:
- The HAL hardware abstraction layer, enabling portability between different STM32 devices via standardized API calls
- The Low-Layer (LL) APIs, a light-weight, optimized, expert oriented set of APIs designed for both performance and runtime efficiency
- CMSIS device defintion for STM32
- CMSIS: Cortex Microcontroller Software Interface Standard (CMSIS) is a vendor-independent hardware abstraction layer for the Cortex®-M processor series and defines generic tool interfaces. It has been packaged as a module for Arduino IDE: https://github.com/stm32duino/ArduinoModule-CMSIS
- GNU Arm Embedded Toolchain: Arm Embedded GCC compiler, libraries and other GNU tools necessary for bare-metal software development on devices based on the Arm Cortex-M. Packages are provided thanks The xPack GNU Arm Embedded GCC: https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack
- Unified Interface for STM32 Devices: The library provides a consistent API for STM32 devices, allowing easy integration with Codal's ecosystem.
- Hardware Abstraction: It abstracts the hardware details, allowing developers to focus on building applications without needing to manage low-level operations.
- Driver Support: Includes drivers for various peripherals and features specific to STM32 microcontrollers, such as GPIO, I2C, SPI, PWM, UART, and ADC.
- Compatibility: Supports a wide range of STM32 chips, providing flexibility for different hardware configurations.
- Toolchain: You will need a GCC ARM toolchain installed to compile the library.
- CMake: CMake is used to generate the build files needed for compilation.
-
Clone the Repository:
git clone https://github.com/letssteam/codal-stm32.git cd codal-stm32
-
Set Up Dependencies:
- Install the required toolchain and ensure it is accessible through your system's PATH.
-
Build the Library:
- Create a build directory:
mkdir build && cd build
- Run CMake to generate the build files:
cmake ..
- Compile the library:
make
- Create a build directory:
Once compiled, you can link the resulting library with your application project. The Codal STM32 library provides a simplified interface to interact with various peripherals of the STM32, making it ideal for educational projects, prototyping, and even complex embedded systems.
- Digital I/O: GPIO control for input and output.
- Analog I/O: ADC support for reading analog signals.
- Communication Protocols:
- I2C: Driver for communication with I2C devices.
- SPI: SPI protocol driver for fast data exchange.
- UART: Serial communication for debugging or data transfer.
- PWM: Pulse Width Modulation for motor control, LED dimming, and more.
- Timers: Various timers for event management and time tracking.
Status | MCU | Nucleo 64 | Release | Comment |
---|---|---|---|---|
💚 | STM32WB55RGV | P-Nucleo-WB55RG | 0.0.1 |
Status | MCU | Discovery | Release | Comment |
---|---|---|---|---|
💚 | STM32L475VGTx | B-L475E-IOT01A | 0.0.1 |
Status | MCU | Name | Release | Notes |
---|---|---|---|---|
💚 | STM32WB55RGV | STeaMi | 0.0.1 |
For question, support, ..., you could submit a topic on the gitter.
If you have any issue, you could file an issue on Github.
In any case, it always fine to search if your issue was not already existing before submit a new one.
We welcome contributions to improve the Codal STM32 library. Please feel free to open an issue for discussion or submit a pull request with your improvements.
This project is licensed under the MIT License. Please see the LICENSE file for more details.