From 512371756aefca60489e4bd224ccdb087c0ecdb9 Mon Sep 17 00:00:00 2001 From: sakumisu <1203593632@qq.com> Date: Thu, 2 Jul 2026 05:24:18 +0000 Subject: Deploying to gh-pages from @ cherry-embedded/CherryUSB@8f04252f0fd77926ad369346ce3e3442552d5f1f 🚀 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _sources/demo/usbd_cdc_acm.rst.txt | 8 -------- _sources/index.rst.txt | 1 + _sources/quick_start/usb_speed.rst.txt | 27 +++++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 8 deletions(-) create mode 100644 _sources/quick_start/usb_speed.rst.txt (limited to '_sources') diff --git a/_sources/demo/usbd_cdc_acm.rst.txt b/_sources/demo/usbd_cdc_acm.rst.txt index 5ae3568c..758c9e73 100644 --- a/_sources/demo/usbd_cdc_acm.rst.txt +++ b/_sources/demo/usbd_cdc_acm.rst.txt @@ -98,13 +98,5 @@ CDC ACM Device } - 上述我们需要注意,长度设置为 2048 是为了测试 ZLP 功能,通常实际使用时,接收长度应该使用 CDC_MAX_MPS 。具体原因参考 :ref:`usb_ext` -- 如果需要做性能测试,使用 tools/test_srcipts/test_cdc_speed.py 进行测试,并在测试之前删除 `usbd_cdc_acm_bulk_out` 和 `usbd_cdc_acm_bulk_in` 中的打印,否则会影响测试结果。 - -测试命令如下: - -.. code-block:: python - - python test_cdc_speed.py --port COM17 --mode tx --chunk-length 4M - python test_cdc_speed.py --port COM17 --mode rx --chunk-length 4M .. note:: 对于 CDC ACM 搭配 OS 的情况,通常我们 read 使用异步并将数据存储到 ringbuffer 中,write 使用同步搭配 sem 使用。 \ No newline at end of file diff --git a/_sources/index.rst.txt b/_sources/index.rst.txt index f524fe42..6e3b2f4a 100644 --- a/_sources/index.rst.txt +++ b/_sources/index.rst.txt @@ -59,6 +59,7 @@ CherryUSB 是一个小而美的、可移植性高的、用于嵌入式系统的 quick_start/q&a quick_start/migration quick_start/opensource + quick_start/usb_speed .. toctree:: :maxdepth: 1 diff --git a/_sources/quick_start/usb_speed.rst.txt b/_sources/quick_start/usb_speed.rst.txt new file mode 100644 index 00000000..24a43c3c --- /dev/null +++ b/_sources/quick_start/usb_speed.rst.txt @@ -0,0 +1,27 @@ +USB 极限速度测试 +====================== + +在 tools 中我们提供了一个 USB 极限速度测试工具,帮助用户测试 USB 设备的传输速度。该工具可以测量 USB 设备在不同条件下的读写速度,并生成详细的测试报告。 + +- test_cdc_speed.c + libusb_winusb_device_for_speed.c + +该工具主要使用 libusb 进行测试,因此,需要保证本地文件需要有 libusb 库和头文件,device 使用 winusb,因为如果使用 cdc acm,则需要进行驱动转换。使用如下: + +.. code-block:: C + + #默认已经提供 test_cdc_speed.exe + + gcc -O2 -o test_cdc_speed.exe .\test_cdc_speed.c .\libusb-1.0.dll.a -I. -lm + .\test_cdc_speed.exe --vendor 0xFFFF --product 0xFFFF --interface 0 --mode tx --chunk-length 4M + .\test_cdc_speed.exe --vendor 0xFFFF --product 0xFFFF --interface 0 --mode rx --chunk-length 4M + +- test_cdc_speed.py + +该工具主要使用 pyserial 进行测试,因此,需要保证已经安装 pyserial 库。使用如下: + +.. code-block:: C + + python test_cdc_speed.py --port COM6 --mode tx --chunk-length 4M + python test_cdc_speed.py --port COM6 --mode rx --chunk-length 4M + +.. note:: python 测试 TX 和 libusb 基本相同,rx 会略低于 libusb,主要原因是因为 pyserial 读取后会放到缓存中,多一次拷贝导致 \ No newline at end of file -- cgit v1.3.1