2024年4月8日发(作者:)

关于USB高速(HighSpeed)和中速(FullSpeed)的区分

USB中区分当前设备是低速还是中速(初始时,高速也被当做中速)的方法是检查 D+ 或

者 D- 上的电阻。如果发现时中速设备,还要有额外的动作来区分是中速还是高速设备。

具体的做法是:

“主机识别一个中速设备是否支持高速。要知道一个设备是否支持高速,需使用两个特

殊的信号状态。在Chirp J 状态时只有D+线会被驱动,在Chirp K 状态时只有D-线会被驱

动。

在重置期间,支持高速的设备会送出一个Chirp K。高速的集线器检测到该Chirp后,会

反映遗传的交替Chirp K与J。当设备检测到KJKJKJ的样式后,它会移除它的中速上升,

然后在高速执行所有的通信。如果集线器没有对设备的Chirp K做出相应,设备知道它必须

继续使用中速通信。高速的设备必须能够在中速时,相应检测设备的请求”【注释1】

使用 Ellisys USB 分析仪查看,其中的一个例子: Mass-storage USB 2.0 可以

看到这样一个握手。

上面的解释是

High speed Detection Handshake

High speed Detection Handshake state detected

Status

The handshake completed successfully.

When does this state occur?

All high speed devices start at full speed to ensure USB 1.1 backward compatibility. If the upstream port

(device) supports high speed signaling, it will generate a Chirp K state on the bus after Reset. If the downstream

port (host) also supports high speed signaling, it will generate Chirps to change the link speed into high speed. If

the downstream port (host) does not support high speed signaling, it will never see the upstream port (device)

Chirp and the link speed will stay at full speed

.”

可惜的是无法看清楚具体的电气特性。

这里还有一个Failed的情况:

主机多次尝试握手设备,不但没有相应,反而后面看起来将设备“握手死了”,以至于

无法相应后面的GetDescriptor命令… …设备是

Datalogic Quickscan L 2330

条码枪。

上方文字解释是

High speed Detection Handshake

High speed Detection Handshake state detected

Status

The upstream port (device) did not generate Chirp K state. This usually happens when the upstream port does not

support high speed signaling (full speed or low speed device)

When does this state occur?

All high speed devices start at full speed to ensure USB 1.1 backward compatibility. If the upstream port (device)

supports high speed signaling, it will generate a Chirp K state on the bus after Reset. If the downstream port (host)

also supports high speed signaling, it will generate Chirps to change the link speed into high speed. If the

downstream port (host) does not support high speed signaling, it will never see the upstream port (device) Chirp

and the link speed will stay at full speed.

上面是一个工作正常的条码枪(同样的主机平台),可以看到,主机握手三次,然后放弃

了,后面还能正常工作。

注释1:来自 USB2.0 硬件设计(第二版) P57 第3章 检测设备 萧世文 宋延清 编著

清华大学出版

参考: Ellisys Visual USB Analysis Software Version 3.1.3400.0 32-bit edition