Skip to content

Libraries

Benjamin Balogh edited this page Oct 12, 2019 · 27 revisions

Libraries using basic features like Serial, SPI, I2C,... should be fully compatible with STM32 core. Pin updates could be required in the sketch.

/img/Warning-icon.png Arduino boards provide ICSP connector used by several Arduino shields for SPI signal: MISO/MOSI/SCK. STM32 boards do not have this ICSP connector, so this requires to manually wire those SPI signals to the desired pin (mainly: D11 to D13)

/img/Note-icon.png 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)

  • EEPROM: follow the official EEPROM API
  • Servo: follow the official Servo API
  • SoftwareSerial: follow the official SoftwareSerial API.
    It uses an hardware timer. Interrupt is triggered at a frequency = 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 developped 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
  • STM32FreeRTOS: this is a port of FreeRTOS for STM32 as Arduino libraries

  • STM32LowPower: to support some STM32 low power mode. 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

  • 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

  • LPS22HB: to support the LPS22HB 260-1260 hPa absolute digital ouput barometer

  • LPS25HB: to support the LPS25HB 260-1260 hPa absolute digital ouput barometer

  • LPS22HH: to support the LPS22HH 260-1260 hPa absolute digital ouput 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

  • M24SR64-Y: to support the dynamic NFC/RFID Tag IC dual interface M24SR64-Y

  • MX25R6435F: to support the Quad-SPI NOR Flash memory MX25R6435F

  • Proximity Gesture: o support gesture-detection using proximity sensors (VL53L0X or VL53L1X or VL6180X). The APIs provide single swipe gesture detection, directional (left/right) swipe gesture detection and single tap gesture detection

  • SPBTLE-RF: to support the Bluetooth (V4.1 compliant) SPBTLE-RF

  • STTS751: to support the STTS751 digital temperature sensor

  • VL53L0X: to support the VL53L0X Time-of-Flight and gesture-detection sensor

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

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:

/img/Note-icon.png In order to perform the firmware upgrade, the following Java application should be used:

Other expansion board

  • I-NUCLEO-LRWAN1: to support I-NUCLEO-LRWAN1 LoRa® expansion board based on USI® LoRaWAN™ technology module

Herafter, a non exhaustive list of libraries known as compatible with the STM32 core.

Official from Arduino

Third party

ARDUINO_ARCH_STM32 must be used as differentiator.

Tested

Clone this wiki locally