当前位置:网站首页>USB virtual serial port (CDC) limit speed test
USB virtual serial port (CDC) limit speed test
2022-07-28 17:42:00 【sudort】
all the time , Want to USB Virtual serial port , This thing is not generally convenient , Is particularly convenient , Recently I am debugging USB There has always been a puzzle when using virtual serial port ,USB How fast can the virtual serial port transmit , Online search did not find a specific and clear data . So I personally tested , I believe the results can explain some problems , Now I will share the measured data with you .
I use national technology N32G4FR The series chips are described as follows :
| N32G4FR Series adoption 32 bit ARM Cortex-M4F kernel , Maximum operating frequency 144MHz, Supports floating-point operations and DSP Instructions , Integration up to 512KB Encrypted storage Flash, It can be used to safely store fingerprint information , 144KB SRAM, 2x12bit 5Msps ADC, 2x1Msps 12bit DAC, Support up to 18 Channel capacitive touch button , Integrated multiplexer U(S)ART、 I2C、 SPI、 QSPI、 USB、 SDIO、 CAN communication interface , At the same time, it integrates digital video (DVP) Interface , Support mainstream semiconductor fingerprint and optical fingerprint sensor , built-in Cryptographic algorithm hardware acceleration engine |
USB The features are as follows :
N32G4FR Series products are embedded with a compatible full speed USB Device controller , Follow full speed USB equipment (12Mbit/ second ) standard , Endpoints can be configured by software , With standby function / Wake up function . USB A dedicated 48MHz The clock is controlled by an internal master PLL generator directive ( To ensure communication stability , The clock source must be HSE External high-speed crystal ).
The test method :
1. Use official USB The virtual serial port routine is modified . Remove unnecessary content . take USB The endpoint of 1 Receive as host .
2. In fact, I also see many tests on the Internet USB The content of virtual serial port speed , It seems that most of them use software to test . After analysis, it is found that such methods are limited by the operating system , And serial port software , So I use oscilloscope to measure USB State .
3. take USB The endpoint in the routine 1IN The callback function adds a IO Mouth jump .

Slave endpoint 1 The sending function of is as follows :

USB The packet size of the enumeration sending and receiving endpoints is configured as 64 byte :

The software used in the upper computer test is SSCOM V5.13.1 Serial port baud rate is set to 1500000:

Test one :USB Send packet size :30 Number of bags 1024 Function as follows :

The data received by the serial port debugging software is correct :
Oscilloscope probe test jump IO Oral duration is 56.3ms Here's the picture :

Conclusion 1:USB Send packet size :30 Number of bags 1024 The total number of bytes sent is 30KByte, The time used is 56.3ms The final data transmission speed is 532.8KByte/S
Test two :USB Send packet size :30 Number of bags 2048 Function as follows :

The data received by the serial port debugging software is correct :

Oscilloscope probe test jump IO Oral duration is 103.8ms Here's the picture :

Conclusion two :USB Send packet size :30 Number of bags 2048 The total number of bytes sent is 60KByte, The time used is 103.8ms The final data transmission speed is 578.03KByte/S
Test three :USB Send packet size :30 Number of bags 10240 Function as follows :

Serial port debugging software receives data error , Through the analysis of , Personally, I think this serial port debugging software can't receive big data in a short time , It should be that the operating system received so much data , The debugging software cannot read the data in the buffer in time , Cause data loss :

Oscilloscope probe test jump IO Oral duration is 541ms Here's the picture :

Conclusion three :USB Send packet size :30 Number of bags 10240 The total number of bytes sent is 300KByte, The time used is 541ms The final data transmission speed is 554.52KByte/S
Test 4 :USB Send packet size :30 Number of bags 20480 Function as follows :

Serial port debugging software receives data error

Oscilloscope probe test jump IO Oral duration is 1082ms Here's the picture :

Conclusion 4 :USB Send packet size :30 Number of bags 20480 The total number of bytes sent is 600KByte, The time used is 1082ms The final data transmission speed is 554.52KByte/S
Test five :USB Send packet size :60 Number of bags 512 Function as follows :

The data received by the serial port debugging software is correct :

Oscilloscope probe test jump IO Oral duration is 35.5ms Here's the picture :

Conclusion 5 :USB Send packet size :60 Number of bags 512 The total number of bytes sent is 30KByte, The time used is 35.5ms The final data transmission speed is 845.07KByte/S
Test six :USB Send packet size :60 Number of bags 1024 Function as follows :

The data received by the serial port debugging software is correct :

Oscilloscope probe test jump IO Oral duration is 70ms Here's the picture :

Conclusion 6 :USB Send packet size :60 Number of bags 1024 The total number of bytes sent is 60KByte, The time used is 70ms The final data transmission speed is 857.14KByte/S
Test seven :USB Send packet size :60 Number of bags 5120 Function as follows :

Serial port debugging software receives data error

Oscilloscope probe test jump IO Oral duration is 353ms Here's the picture :

Conclusion 7 :USB Send packet size :60 Number of bags 5120 The total number of bytes sent is 300KByte, The time used is 353ms The final data transmission speed is 849.85KByte/S
Test eight :USB Send packet size :60 Number of bags 10240 Function as follows :

Serial port debugging software receives data error

Oscilloscope probe test jump IO Oral duration is 674ms Here's the picture :

Conclusion 8 :USB Send packet size :60 Number of bags 10240 The total number of bytes sent is 600KByte, The time used is 674ms The final data transmission speed is 890.20KByte/S
summary :
| test | Bag size (Byte) | Number of bags | Total bytes sent | Elapsed time (ms) | Speed (Kbyte/S) |
| One | 30 | 1024 | 30KByte | 56.3 | 532.8 |
| Two | 2048 | 60KByte | 103.8 | 578.03 | |
| 3、 ... and | 10240 | 300KByte | 541 | 554.52 | |
| Four | 20480 | 600KByte | 1082 | 554.52 | |
| 5、 ... and | 60 | 512 | 30KByte | 35.5 | 845.07 |
| 6、 ... and | 1024 | 60KByte | 70 | 857.14 | |
| 7、 ... and | 5120 | 300KByte | 353 | 849.85 | |
| 8、 ... and | 10240 | 600KByte | 674 | 890.2 |
In embedded development USB Virtual serial port data transmission :
1. The transmission speed can basically achieve 500KB/S~900KB/S The magnitude of .
2. The transmission speed is related to the upper computer software or operating system .
3. Try to use large packet data transmission , In this way, we can put USB The communication speed is brought into full play .
doubt :
1. During the test , The length of my port packet is set to 64 byte , But I use a package size of 64 There will be serious data loss during communication test , On the Internet, it is said to be in 64 After sending byte packet data, add a 0 Just send the data packet , Finally, I just learned a little, but didn't go deep , The maximum number of packages is 60 Bytes to test .
2. In general, the serial port debugging software is very powerful , At a single time 100K There is no problem in the transmission of bytes , The file data is greater than 100K There will be a serious data loss problem when bytes are used , This should be related to factors such as the reading operation of the upper computer and the size of the changed data .
边栏推荐
- Convert the image file of input type='file'to Base64
- R language drawing / drawing / drawing 2
- es6 Promise
- 软件测试干货
- 【C语言笔记分享】字符函数和字符串函数(建议收藏)
- Precautions for $ionicpopup in ionic when calling alert for two consecutive times
- Distinguish between the export of ES6 and the module.exports of nodejs
- MySQL面试题大全(陆续更新)
- 技术面轻松通过,HR:只有三年大厂经验的不值20K
- Blue Bridge Cup embedded competition resources and skills
猜你喜欢

简单易用的APP专项测试工具iTest4.7.0发布啦

Embedded development learning path

【C语言笔记分享】字符函数和字符串函数(建议收藏)

Talk about the measurement of "post release problems"

mmcv安装的办法

Visual object class introduces Pascal VOC dataset

漫谈测试平台—平台建设思路(上)

医学公共数据库

Talk about what you know about publishing online (2)

Random talk on test platform - platform construction ideas (Part 1)
随机推荐
JS synchronizes the local time with the server time
软件测试培训两个月可以就业吗?
【C语言进阶】——函数指针
Ant financial mobile testing tool solopi monitoring part of the source code guide.. Continuous update
多线程(线程池ThreadPoolExecutor)
Division optimization of JS decimal calculation on the Internet
小白如何零基础学习软件测试?
Can‘t use an undefined value as an ARRAY reference at probe2symbol
医学公共数据库
在airtest中使用ocr反向识别文本内容
想学习软件测试,零基础去哪里学呢?
Jdwp unauthorized rapid utilization
[untitled]
Using OCR to reverse recognize text content in airtest
产品研发中第三方技术服务的管理
【 R语言—基础绘图】
【C语言进阶】——剖析入微数据在内存中的存储[上]
Master the key points of JVM interview
2021 年全国大学生数据统计与分析竞赛
ng-repeat在迭代最后一个元素时执行一个方法