Libraries
This page lists libraries included with the STM32 core, STM32duino libraries, expansion-board libraries, and community libraries that are known to work with the core. Compatibility depends on the library, board, and STM32 device, so check each library's requirements and examples before use. Install libraries through the Arduino Library Manager when available; see each library's documentation for required dependencies and board-specific setup.
Warning
Some Arduino shields route SPI through an ICSP connector, which may not be present on an STM32 board. Check the board pinout and connect MISO, MOSI, and SCK to the appropriate pins when needed.
Note
All dedicated STM32 libraries are available through the "Library Manager" or have a look hereafter to see which one is available:
Built-in (delivered with the core package)
- CMSIS_DSP: see usage example here
- EEPROM: follow the official EEPROM API
- IWatchdog: see here
- Servo: follow the official Servo API
- SoftwareSerial: follow the official SoftwareSerial API.
It uses an hardware timer. Interrupt is triggered at afrequency = Baudrate * OVERSAMPLE(by default 3*baudrate) to handle RX as well as TX transmissions. This impacts CPU load specially at high baudrate. - SPI: follow the official SPI API
- Wire (I2C): follow the official Wire API
Dedicated
Some libraries have been developed to support specific features (hardware or not):
-
STM32Ethernet: for on board Ethernet port (ex: Nucleo-F429ZI). This library is fully compatible with Arduino Ethernet API. It depends on the following libraries:
-
LwIP: lightweight TCP/IP stack (LwIP) is a small independent implementation of the TCP/IP protocol suite
Dedicated STM32Ethernet
-
STM32FreeRTOS: this is a port of FreeRTOS for STM32 as Arduino libraries
-
STM32LoRaWAN: LoRaWAN support for STM32WL55, currently documented for the NUCLEO-WL55JC1. See the hosted API documentation for API details and examples.
-
STM32LowPower: supports STM32 low-power modes. It depends on the following libraries:
-
STM32RTC: to support the real-time clock (RTC) controller embedded in the STM32 microcontrollers. It is based on the Arduino RTCZero library
-
STM32SD: to support SDIO or SDMMC controller for board with SD card slot (ex: Disco-F746). This library is fully compatible with Arduino SD API. It depends on the following libraries:
-
FatFS: FatFs is a generic FAT file system module for small embedded systems. The FatFs is written in compliance with ANSI C and completely separated from the disk I/O layer. Therefore it is independent of hardware architecture
-
HTS221: to support the HTS221 capacitive digital sensor for relative humidity and temperature. Dedicated HTS221
- IIS2MDC: to support the IIS2MDC high-performance 3-axis magnetometer
- ISM330DLC: to support the ISM330DLC 3D accelerometer and 3D gyroscope
- LIS2DW12: to support the LIS2DW12 3D accelerometer
- LIS2MDL: to support the LIS2MDL high-performance 3-axis magnetometer
- LIS3DHH: to support the LIS3DHH 3D accelerometer
- LIS3MDL: to support the LIS3MDL high-performance 3-axis magnetometer. Dedicated LIS3MDL
- LPS22HB: to support the LPS22HB 260-1260 hPa absolute digital output barometer. Dedicated LPS22HB
- LPS25HB: to support the LPS25HB 260-1260 hPa absolute digital output barometer
- LPS22HH: to support the LPS22HH 260-1260 hPa absolute digital output barometer
- LSM303AGR: to support the LSM303AGR 3D accelerometer and 3D magnetometer
- LSM6DSO: to support the LSM6DSO 3D accelerometer and 3D gyroscope
- LSM6DSOX: to support the LSM6DSOX 3D accelerometer and 3D gyroscope
- LSM6DS0: to support the LSM6DS0 3D accelerometer and 3D gyroscope
- LSM6DS3 : to support the LSM6DS3 3D accelerometer and 3D gyroscope
- LSM6DSL: to support the LSM6DSL 3D accelerometer and 3D gyroscope. Dedicated LSM6DSL
- M24SR64-Y: to support the dynamic NFC/RFID Tag IC dual interface M24SR64-Y. Dedicated M24SR64-Y
- MX25R6435F: to support the Quad-SPI NOR Flash memory MX25R6435F. Dedicated MX25R6435F
- Proximity Gesture: supports gesture detection using proximity sensors (VL53L0X, VL53L1X, or VL6180X), including swipe and tap detection
- SPBTLE-RF: to support the Bluetooth (V4.1 compliant) SPBTLE-RF. Dedicated SPBTLE-RF
- ST25DV: to support the ST25DV components
- STTS22H: to support the STTS22H digital temperature sensor
- STTS751: to support the STTS751 digital temperature sensor
- VL53L0X: to support the VL53L0X Time-of-Flight and gesture-detection sensor. Dedicated VL53L0X
- VL53L1X: to support the VL53L1X Time-of-Flight and gesture-detection sensor
- VL6180X: to support the VL6180X proximity and ambient light sensing (ALS) sensor
- WiFi-ISM43362-M3G-L44: to support the Wi-Fi module Inventek ISM43362-M3G-L44 (802.11 b/g/n)
- S2-LP: to support the S2-LP sub-1GHz transceiver
- VL53L1: to support the VL53L1 Time-of-Flight ranging sensor with advanced multi-zone and multi-object detection
- VL53L3CX: to support the VL53L3CX Time-of-Flight ranging sensor with multi target detection
Expansion boards
X-NUCLEO Expansion Boards
Hereafter, an exhaustive list of Arduino libraries to support X-NUCLEO Expansion Boards. These libraries are guaranteed to work fine with all NUCLEO boards supported in the STM32 Core. They could also work with standard Arduino boards but I suggest to check before electrical and pinout compatibility of X-NUCLEO Expansion Boards with standard Arduino boards.
-
X-NUCLEO-53L0A1: it is an expansion board for the STM32 Nucleo based on VL53L0X Time-of-Flight and gesture-detection sensor. It depends on the following libraries:
-
X-NUCLEO-53L1A1: it is an expansion board for the STM32 Nucleo based on VL53L1X Time-of-Flight and gesture-detection sensor. It depends on the following libraries:
-
X-NUCLEO-6180XA1: it is an expansion board for the STM32 Nucleo based on VL6180X proximity sensor, gesture and ambient light sensing (ALS) module. It depends on the following libraries:
-
X-NUCLEO-GNSS1A1: to support the X-NUCLEO-GNSS1A1 expansion board using the TESEO-LIV3F module. It depends on the following libraries:
- MicroNMEA
Note
In order to perform the firmware upgrade, the following Java application should be used:
-
X-NUCLEO-IDB05A1: it is a Bluetooth Low Energy evaluation board based on the SPBTLE-RF BlueNRG-MS RF module. It depends on the following library:
-
X-NUCLEO-IKA01A1: it is a multifunctional expansion board based on operational amplifiers.
-
X-NUCLEO-IKS01A1: it is a motion MEMS and environmental sensor expansion board for the STM32 Nucleo. It depends on the following libraries:
- LSM6DS3
- LIS3MDL
- LPS25HB
-
X-NUCLEO-IKS01A2: it is a motion MEMS and environmental sensor expansion board for the STM32 Nucleo. It depends on the following libraries:
- LSM303AGR
- LPS22HB
-
X-NUCLEO-IKS01A3: it is a motion MEMS and environmental sensor expansion board for the STM32 Nucleo. It depends on the following libraries:
- LIS2DW12
- LIS2MDL
- HTS221
- LPS22HH
- STTS751
-
X-NUCLEO-IHM02A1: it is a two axis stepper motor driver expansion board based on the L6470 component.
- X-NUCLEO-IHM12A1: it is a low voltage dual brush DC motor driver expansion board based on the STSPIN240.
- X-NUCLEO-LED61A1: it is an expansion board based on the LED6001 component.
-
X-NUCLEO-NFC01A1: it is a Dynamic NFC tag evaluation board based on the M24SR64-Y NFC Type 4/RFID tag IC. It depends on the following library:
-
X-NUCLEO-NFC03A1: it is an NFC card reader evaluation board based on CR95HF-VMD5T that supports the detection, reading and writing of NFC Forum Type 1, 2, 3 and 4 tags.
-
X-NUCLEO-NFC04A1: it is a dynamic NFC/RFID tag IC expansion board based on the ST25DV04K NFC Type V/RFID tag IC. It depends on the following library:
-
X-NUCLEO-S2868A1: it is a wireless sub-1 GHz expansion board based on S2-LP radio and operates in the 868 MHz ISM frequency band. It depends on the following libraries:
-
X-NUCLEO-S2868A2: it is a wireless sub-1 GHz expansion board based on S2-LP radio and operates in the 868 MHz ISM frequency band. It depends on the following libraries:
-
X-NUCLEO-S2915A1: it is a wireless sub-1 GHz expansion board based on S2-LP radio and operates in the 915 MHz ISM frequency band. It depends on the following libraries:
-
X-NUCLEO-53L1A2: it is an expansion board for the STM32 Nucleo based on VL53L1 Time-of-Flight ranging sensor with advanced multi object detection. It depends on the following libraries:
-
X-NUCLEO-53L3A2: it is an expansion board for the STM32 Nucleo based on VL53L3CX Time-of-Flight ranging sensor with multi target detection. It depends on the following libraries:
-
X-NUCLEO-IHM05A1: it is a bipolar stepper motor driver expansion board based on the L6208 component.
Other expansion board
- I-NUCLEO-LRWAN1: to support I-NUCLEO-LRWAN1 LoRa® expansion board based on USI® LoRaWAN™ technology module
The following libraries are known to be compatible with the STM32 core. Check the linked project documentation for current compatibility details.
Official from Arduino
- TFT: since release 1.0.6 else use Ucglib_Arduino
- LiquidCrystal
- Ethernet
- WiFi
Third party
ARDUINO_ARCH_STM32 must be used as differentiator.
Tested
- arduino-LoRa: tested with B-L072Z-LRWAN1
- Firmata: since release 2.5.7
- OneWire: Library for Dallas/Maxim 1-Wire Chips
- PubSubClient: tested using L475 disco IOT using WiFi
- RTClib: tested with Adafruit module 3296
- Ucglib_Arduino: tested with ST7735
- UIPEthernet: tested with ENC28j60 module