Skip to main content
Associate II
December 15, 2023
Question

Issues with Data Transfer Rates Exceeding 2 Mbit/s on STM32L476RG Using USART

Hello STM32 Community,

I am working with the STM32L476RG microcontroller and encountering difficulties in achieving the expected data transfer rates through USART. According to the datasheet, the device should support a "common programmable transmit and receive baud rate of up to 10 Mbit/s when the clock frequency is 80 MHz and oversampling is by 8". I have configured the clock frequency at 80 MHz and set oversampling to 8, anticipating data transfer rates up to 10 Mbit/s. However, I'm experiencing issues with rates over 2 Mbit/s.

Experiment Setup:

  • Software: I am using the Pyserial Python library for data reception.
  • Hardware Connection: The STM32 board is connected to both a laptop and a desktop computer via an ST-Link.
  • Observation: Data is received without issues at baud rates up to 2 Mbit/s. Beyond this, data transfer fails.

This problem persists across both the laptop and desktop. I am curious if anyone else has faced similar challenges. Could the bottleneck be in my laptop and desktop's capacity to handle higher data rates? Any insights or suggestions would be greatly appreciated.

Thank you in advance for your assistance.

This topic has been closed for replies.

9 replies

Pavel A.
December 15, 2023

What is on the other side of the UART and the physical layer? (please don't tell it is an average TTL to USB adapter with a Windows PC on its end).

 

kmkooAuthor
Associate II
December 15, 2023

I simply used USB-A to mini USB B 2.0 cable, which can suppport up to 480Mbps. 

The cable is used to connect USB port of stm32 board and USB serial port of Windows computer. 

AScha.3
Super User
December 15, 2023

i cannot find my big blue glass ball...

so guessing: you have a

Nucleo Board STM32L476RG

right ?  this has a (very ancient) F103 as st-link (ST-LINK/V2-1) ...i am surprised, it works at more than 1 Mbit.

so..what you expect? 

your old VW Käfer overtakes a formula 1 car ?

use a st-linkV3 , then we see...(i use it at 3Mbit, no problem - but didnt test any higher rate (why?) )

+ try to speed up the VW with a USB3 cable - tell us, how it should get the snail faster :)

If you feel a post has answered your question, please click on " Best Answer ".
Tesla DeLorean
Guru
December 15, 2023

You need good integer division to get reliable / accurate rates at higher frequencies.

10 Mbaud, 5 Mbaud, 2.5 Mbaud, 1.25 Mbaud would probably be better targets

Not sure what ST-LINK/V2-1 performance and buffering look like at higher speeds.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..