cancel
Showing results for 
Search instead for 
Did you mean: 

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

kmkoo
Associate III

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.

9 REPLIES 9
Pavel A.
Evangelist III

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

 

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
Up vote any posts that you find helpful, it shows what's working..

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. 

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 "Accept as Solution".

Thank you for the reply. Yes, my board is nucleo board stm32L476RG and I think st-link is the problem. Is there any way that I can upgrade st-link of my board to st-linkV3? Or should I buy another board?

The ST-LINK/V3 is an entirely different implementation using a STM32F723 part which supports USB High Speed modes.

You should be able to use a SiLabs, FTDI, Prolific type USB-to-CMOS Serial at relatively high rates.

RS232 level shifters tend to hit a bandwidth ceiling at around 1 Mbps

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

1. if you want just using the stm32L476RG , buy an st-linkV3 , you can use for other boards also.

but you have to solder an adapter for swd, if you choose a (not expensive) v3-miniE or v3-mods. see:

https://www.mouser.de/c/?q=stlinkv3

AScha3_0-1702727594465.png

 

2. if you want just a ready board with high usb speed, buy a NUCLEO-H563ZI (has ethernet + full speed usb on H563) or a NUCLEO-U5A5ZJ-Q (has hi speed usb on U5A5 ) ; with onboard stlinkV3 .

btw the NUCLEO-H563ZI i use also;

but on these boards you cannot separate the stlinkV3 to use for other boards!

 

If you feel a post has answered your question, please click "Accept as Solution".

Thank you!! I will try the solution

Thank you! I will try the solution