Skip to content

Commit ea57c1b

Browse files
committed
Merge branch 'docs/usb_msc_perf' into 'master'
docs(usb_msc_device): Update documentation with performance optimization results Closes DOC-10816 See merge request espressif/esp-idf!36919
2 parents 1edf45e + 44b18ca commit ea57c1b

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

docs/en/api-reference/peripherals/usb_device.rst

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,86 @@ If the MSC ``CONFIG_TINYUSB_MSC_ENABLED`` option is enabled in Menuconfig, the E
266266
};
267267
tinyusb_msc_storage_init_sdmmc(&config_sdmmc);
268268
269+
MSC Performance Optimization
270+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
271+
272+
**Single-Buffer Approach**
273+
274+
The single-buffer approach improves performance by using a dedicated buffer to temporarily store incoming write data instead of processing it immediately in the callback.
275+
276+
- **Configurable buffer size**: The buffer size is set via ``CONFIG_TINYUSB_MSC_BUFSIZE``, allowing users to balance performance and memory usage.
277+
278+
This approach ensures that USB transactions remain fast while avoiding potential delays caused by storage operations.
279+
280+
**USB MSC Drive Performance**
281+
282+
.. only:: esp32s3
283+
284+
.. list-table::
285+
:header-rows: 1
286+
:widths: 20 20 20
287+
288+
* - FIFO Size
289+
- Read Speed
290+
- Write Speed
291+
292+
* - 512B
293+
- 0.566 MB/s
294+
- 0.236 MB/s
295+
296+
* - 8192B
297+
- 0.925 MB/s
298+
- 0.928 MB/s
299+
300+
.. only:: esp32p4
301+
302+
.. list-table::
303+
:header-rows: 1
304+
:widths: 20 20 20
305+
306+
* - FIFO Size
307+
- Read Speed
308+
- Write Speed
309+
310+
* - 512B
311+
- 1.174 MB/s
312+
- 0.238 MB/s
313+
314+
* - 8192B
315+
- 4.744 MB/s
316+
- 2.157 MB/s
317+
318+
* - 32768B
319+
- 5.998 MB/s
320+
- 4.485 MB/s
321+
322+
.. only:: esp32s2
323+
324+
*Note: SD card support is not available for ESP32-S2 in MSC device mode.*
325+
326+
**SPI Flash Performance:**
327+
328+
.. list-table::
329+
:header-rows: 1
330+
:widths: 20 20
331+
332+
* - FIFO Size
333+
- Write Speed
334+
335+
* - 512B
336+
- 5.59 KB/s
337+
338+
* - 8192B
339+
- 21.54 KB/s
340+
341+
Performance Limitations:
342+
343+
- **Internal SPI Flash performance** is constrained by architectural limitations where program execution and storage access share the same flash chip. This results in program execution being **suspended during flash writes**, significantly impacting performance.
344+
- **Internal SPI Flash usage is intended primarily for demonstration purposes.** For practical use cases requiring higher performance, it is recommended to use **external storage such as an SD card or an external SPI flash chip, where supported.**
345+
346+
.. only:: esp32s3 or esp32p4
347+
348+
SD cards are not affected by this constraint, explaining their higher performance gains.
269349

270350
Application Examples
271351
--------------------

0 commit comments

Comments
 (0)