HAL Library 07- USART for STM32Fxxx

Here it is. UART library for HAL based libraries. If you don’t know, how UART work on STM32Fxxx devices, then you might take a look at my first library, where I also explained how to used it.

This library works successfully on F4 and F7 based devices for now. I will add support for F0 too as soon as possible.

Library

Read more about new HAL libraries

Features

  • Supports up to 8 UART peripherals at a time
  • Interrupt driven RX
  • Support for different UART omdes
  • Support for receiveing string
  • Support for sending string/character/array
  • Supports multiple predefined GPIO pins for specific UART or custom based pin initialization

Dependencies

  • HAL
  • TM
    • STM32Fxxx HAL
    • defines.h
    • GPIO
    • BUFFER

Pinouts

Below are possible USART pins. You select them on USART initialization.

Pins pack 1 Pins pack 2 Pins pack 3
U(S)ARTx TX RX TX RX TX RX
USART1 PA9 PA10 PB6 PB7
USART2 PA2 PA3 PD5 PD6
USART3 PB10 PB11 PC10 PC11 PD8 PD9
UART4 PA0 PA1 PC10 PC11
UART5 PC12 PD2
USART6 PC6 PC7 PG14 PG9
UART7 PE8 PE7 PF7 PF6
UART8 PE1 PE0

Functions and enumerations

Example 1

Example 2

Example 3

Projects are available on Github, download all libraries below.

tilz0R

Owner of this site. Application engineer, currently employed by STMicroelectronics. Exploring latest technologies and owner of different libraries posted on Github.

You may also like...