-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESP32S3 USB MSC speed lower than expected (IDFGH-9776) #11110
Comments
Hello @zhongpang , Thanks for the bug report and letting us know about this. I'll need some more information in order to help you debug this Could you please share what Flash chip you used, how is it connected to ESP32s3 and how do you access it from the user code? |
Any update? I am also getting slow speed(0.155 MBytes/s) instead of 1.5MBytes/S. I used this example(esp-idf/examples/peripherals/usb/device/tusb_msc/) on esp32s3. |
Sorry this has sat around for an extraordinary long time without further feedback. We found the data throughput bottleneck and experimented with some improvements. However, we are now busy with USB support for upcoming ESP32-P4 and HUB support for USB Host. This improvement request is next in line. We'll keep this ticket updated |
Another raised hand for improved MSC speed. Max I can get is 120kB/sec, average is 90kB/sec |
I have the same Issue, with the ESP32-S3-DevkitC-1 and the example tusb_msc code from V5.4. using internal flash. |
Hi there :) |
Hi everyone, We’ve been investigating the slow write issues, and here are our initial findings: When implementing a Mass Storage Class (MSC) device on ESP32 chips, using the internal flash as the storage medium is strongly discouraged. Our example uses internal flash only to demonstrate the functionality without requiring extra components. The core limitation is that the program memory and storage reside on the same flash chip. During a flash write operation, program execution from flash is suspended, and interrupts that are not loaded into IRAM cannot run. As a result, USB transfers are severely slowed down. Our recommended approach is to use a dedicated storage medium (e.g., an external SD card or flash) for the MSC disk. This setup can achieve write speeds of around 1 MB/s. We will update both the example and our official documentation to better reflect this recommendation. If you have any further questions or feedback, please let us know. |
Thank you very much for your investigation! |
…P32S3 Cached `get_sector_size` and `get_sector_count` to improve performance and avoid redundant calls. Ping-pong buffering mechanism is enabled only for ESP32S3 targets since it negatively impacts SD card write speed on other platforms. Closes espressif/esp-idf#11110
…P32S3 Cached `get_sector_size` and `get_sector_count` to improve performance and avoid redundant calls. Ping-pong buffering mechanism is enabled only for ESP32S3 targets since it negatively impacts SD card write speed on other platforms. Closes espressif/esp-idf#11110
…P32S3 Cached `get_sector_size` and `get_sector_count` to improve performance and avoid redundant calls. Ping-pong buffering mechanism is enabled only for ESP32S3 targets since it negatively impacts SD card write speed on other platforms. Closes espressif/esp-idf#11110
Cached `get_sector_size` and `get_sector_count` to improve performance and avoid redundant calls. Storage buffering mechanism is enabled only for ESP32S3 targets since it negatively impacts SD card write speed on other platforms. Closes espressif/esp-idf#11110
Cached `get_sector_size` and `get_sector_count` to improve performance and avoid redundant calls. Storage buffering mechanism is enabled only for ESP32S3 targets since it negatively impacts SD card write speed on other platforms. Closes espressif/esp-idf#11110
Answers checklist.
General issue report
Chip: ESP32S3
IDF version: 5.0.1
USB Stack: TinyUSB from example folder
We implemented a usb mass storage on ESP32S3, the storage backend is a Nand Flash, everything works fine now except the copy speed of file is lower than expected: around 8KBytes/S on Mac and Windows.
We logged the tud_msc_read10_cb() function, and found Nand Flash read operation only cost less than 1MS/4096 Bytes, but the tud_msc_read10_cb() been called every 5MS, which close to the data copy speed we tested: 8KBytes/S = 4K * 1000/5.
From the document, it says S3 USB 2.0 speed could be 12Mbit/S, which means 1.5MBytes/S.
Is there any way to enhance the copy speed from 8KBytes/S to close to 1.5MBytes/S? Thanks very much!
The text was updated successfully, but these errors were encountered: