Page 1 of 1

USB speed test

Posted: Tue Sep 10, 2024 6:38 pm
by srjasz
Just sharing the results of my USB speed tests. I am using s3 at 160Mhz. I found that the fastest speed possible was about 500K Bytes per second. That's in the area that I have been seeing form other peoples posts. To get that speed the RTOS spends about 40% of its time running the USB code, so not enough left for my particular application, maybe enough for yours. 100K Bytes per second was where the USB code started to have an impact on how much processing time was left for other things. I would say a good Rule Of Thumb would be, if your going faster than 100K Bytes per second, keep an eye on how much time is spent doing the USB. If you are thinking "the spec says it can go to 12Mbps" no, it can't.

Enjoy

Re: USB speed test

Posted: Tue Sep 10, 2024 8:00 pm
by MicroController
What happens when you run the CPU at its full 240MHz?

Re: USB speed test

Posted: Tue Sep 10, 2024 8:10 pm
by chegewara
https://community.st.com/t5/mems-sensor ... d-p/523996

Now you have to add flash read/write operations time, which is another overhead.
Couple years ago I performed USB MSC tests on S3, you can find results somewhere on the forum.

As far as I remember the read speed could reach even 900kB/s.

I am suggesting using 240MHz clock, which seems to have nice boost on DMA operations.

Re: USB speed test

Posted: Wed Sep 11, 2024 2:04 pm
by srjasz
I should have mentioned that this was transmitting only. The product I am designing will be transmitting continuous sensor data which is the critical path. It will only be receiving a small amount of configuration data at initialization so no simultaneous transmit and receive.

I should have also mentioned I am using CDC_ACM.

Re: USB speed test

Posted: Wed Sep 11, 2024 11:02 pm
by chegewara
https://developerhelp.microchip.com/xwi ... ull-speed/
In theory CDC ACM should reach transfer around 1MB/s, not sure if esp32 can reach such transfer speed, but it only theory.

To get highest throughput you have to make sure that:
- esp32 is sending data in tight loop without congestion
- your client app on PC can transfer data that fast

So, can you confirm somehow your client/test app can go that fast?

Re: USB speed test

Posted: Fri Sep 13, 2024 1:58 pm
by srjasz
The only thing the ESP32 was doing was sending USB, so yes, it was a very tight loop.

The PC application that was doing the receiving was written by my colleague. He has a lot of experience with USB communication, especially in high speed industrial control applications. We were able to verify that the application was indeed fast enough.