USB speed test

srjasz
Posts: 46
Joined: Wed Apr 03, 2024 4:29 pm

USB speed test

Postby srjasz » Tue Sep 10, 2024 6:38 pm

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

MicroController
Posts: 1549
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: USB speed test

Postby MicroController » Tue Sep 10, 2024 8:00 pm

What happens when you run the CPU at its full 240MHz?

chegewara
Posts: 2306
Joined: Wed Jun 14, 2017 9:00 pm

Re: USB speed test

Postby chegewara » Tue Sep 10, 2024 8:10 pm

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.

srjasz
Posts: 46
Joined: Wed Apr 03, 2024 4:29 pm

Re: USB speed test

Postby srjasz » Wed Sep 11, 2024 2:04 pm

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.

chegewara
Posts: 2306
Joined: Wed Jun 14, 2017 9:00 pm

Re: USB speed test

Postby chegewara » Wed Sep 11, 2024 11:02 pm

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?

srjasz
Posts: 46
Joined: Wed Apr 03, 2024 4:29 pm

Re: USB speed test

Postby srjasz » Fri Sep 13, 2024 1:58 pm

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.

Who is online

Users browsing this forum: No registered users and 82 guests