2023-12-15 01:55 PM
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:
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.
2023-12-15 02:34 PM - edited 2023-12-15 02:35 PM
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).
2023-12-15 02:47 PM - edited 2023-12-15 03:48 PM
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.
2023-12-15 02:54 PM
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.
2023-12-15 03:07 PM - edited 2023-12-15 03:11 PM
i cannot find my big blue glass ball...
so guessing: you have a
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 :)
2023-12-15 03:15 PM
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?
2023-12-15 03:47 PM
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
2023-12-16 02:27 AM - edited 2023-12-16 03:53 AM
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
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!
2023-12-16 07:25 AM
Thank you!! I will try the solution
2023-12-16 07:25 AM
Thank you! I will try the solution