cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L053 and STM32L062 USB speed differences - updated

Gabriele Gorla
Associate

Hello,

I have a very weird issue and I am looking for ideas on how to root cause it.

My goal is to maximize the USB transfer speed in CDC mode.

I started with the NUCLEO-L053

I created a project with STM32CUBEIDE and added the USB CDC middleware.

This results in a very slow CDC (about 100-150KB/s). I modified the code and after many hours of reading the docs, debugging and scoping out interrupt firing I was able to achieve 890KB/s

This number seems to be limited by my buffer management and the interrupt latency.

Adding a specific piece of code in the critical path slows down the communication to 800KB/s

So far so good.

Then I transferred the code to my target system (STM32L062)

Created new project in STM32CUBEIDE and copied the same source files from the L053 project above.

Everything work as expected and the max speed is the same 890KB/s.

However, when I add the same piece of code in the critical path I get 700KB/s (100KB/s less than the L053).

4/7 update

Flashing the L053 binary on the L062 work as expected and achieves 800KB/s with the extra code in the critical loop. Given the source is the same for both builds, it must be some build setting in the STM32CubeIDE.

Is there a good way to compare all the settings?

Any suggestions how to root cause this issue?

What is the maximum speed achievable on the USB in CDC mode?

thanks in advance

0 REPLIES 0