Skip to content

csrohit/stm32-uart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blue Pill UART communication

Build Passing GPLv3 License

Programming the UART1 peripheral in STM32F1 controller for bi-directional communication. Echo characters received from UART and transmit time elapsed since boot every 5 seconds.

Project Variant

STM32F1 Blue pill is a versatile board and can be programmed in various ways. I have created following variations of this project which differs in programming language, use of RTOS and framework. Clone the repository and follow steps mentioned in the respective variations for building and flashing.

  1. Polling
  2. DMA in Circular Mode
  3. DMA in 1 Shot Mode
  4. DMA in Echo Mode
  5. C++ project

USART

The controller has 3 USART peropherals with varying functionality. The peripheral registers can be accessed as half word (16 bit) as well as words (32 bit).
This project uses USART1 with pinc PA9 and PA10 for demonstration.

Hardware Setup

Connect the board with host through USB to TTL converter (FTDI board in our case). The connections are described as follows.

Pin on Blue Pill Pin on FTDI
PA9 Rx
PA10 Tx
Gnd Gnd

Connection diagram for USART1

Output

The application prints time elapsed since boot in interval of 5 seconds. Configure serial onitor on host for 9600 baudrate to be able to read and write to blue pill using uart. Following output can be observed on UART.
Output on Serial monitor

Debug

Click in Run and Debug option in VsCode sidebar. Then launch Cortex Debug target.

Happy debugging....

About

USART protocol implementation in STM32 using various methods and frameworks

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages