news 2026/4/15 23:58:11

usb3 协议

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
usb3 协议

一、 基本概念


低频周期性信令(LFPS,Low frequency periodic signaling)
Low frequency periodic signaling (LFPS) is used for side band communication between the two ports across a link that is in a low power link state. It is also used when a link is under training, or when a downstream port issues Warm Reset to reset the link.
For x2 operation, LFPS signals are only transmitted on the Configuration Lane.


SCD1/SCD2
SuperSpeedPlus Capability Declaration (SCD) is a step for a SuperSpeedPlus port, while in the Polling.LFPS substate, to identify itself as SuperSpeedPlus capable by transmitting
Polling.LFPS signals with specific patterns unique to SuperSpeedPlus ports. This section defines SuperSpeedPlus specific patterns in SCD1 and SCD2.

LBPM SuperSpeedPlus LFPS Based PWM Message
LBPM is defined as a low power signaling mechanism for two SuperSpeedPlus ports to communicate with each other based on LFPS signals. The adoption of Pulse Width Modulation (PWM) is to embed the transmitting clock in data and to allow for easy data recovery at the receiver based on LFPS clock defined in Table 6-29. T

二、physical layer


gen1 8b/10b 编码
gen2 128b/132b 编码

gen1 data scrambling

Special Symbols for Framing and Link Management


Training sequence TS1, TS2, TSEQ

三、link layer

3.1 包结构

link layer 包结构,分为 LMP/TP/DP/ITP header packet 和 data packet payload
LMP TP DP ITP header packet
header packet 包括 link control word、packet header



Data Packet Payload

3.2 link commands

Link commands are used for link level data integrity, flow control and link power management.
Link commands are a fixed length of eight symbols and contain repeated symbols to increase the error tolerance. Refer to Section 7.3 for more details. Link command names have the L-preface to differentiate their link level usage and to avoid confusion with packets

Link Commandb10-9b8-7b6-4b3-0
LGOOD_n0000000HP Sequence Number
0000:LGOOD_0

1111:LGOOD_15
n: Header Sequence Number.
Sent by a port receiving a header packet when all of the following conditions are true:
• The header packet has a valid structure and can be recognized by the receiver.
• CRC-5 and CRC-16 are valid.
• Header Sequence Number in the received header packet matches the expected Rx Header Sequence Number.
• An Rx Header Buffer in the receiver is available for storing the received header packet.
Mismatch between a Header Sequence Number in the received header packet and the expected Rx Header Sequence Number will result in a port transitioning to Recovery.
Received by a port sending a header packet. This is an acknowledgement from a link partnerthat a header packet with the Header Sequence Number of “n” is received properly. Receipt of LGOOD_n mismatching the expected ACK Tx Header Sequence Number will result in a porttransitioning to Recovery.
Also sent by a port upon entry to U0 as the Header Sequence Number Advertisement to initialize the ACK Tx HeaderSequence Number of the two ports.
LCRD_x
LCRD1_x
LCRD2_x
0001000Gen 1x1, Gen 1x2, Gen 2x1:
b3: Reserved
b2: Credit series
0: LCRD_x or LCRD1_x
1: LCRD2_x
b1~0: Rx Header Buffer Credit
00: LCRD_A/LCRD1_A/LCRD2_A
01: LCRD_A/LCRD1_A/LCRD2_A
10: LCRD_A/LCRD1_A/LCRD2_A
11: LCRD_A/LCRD1_A/LCRD2_A
used to signal the availability of Rx Header Buffers in terms of Credit.
LRTY0010000reservedSent by a port before resending the first header packet in response to receipt of LBAD.
LBAD0011000reservedBad header packet.
Sent by a port receiving the header packet in response to an invalid header packet. Packet that was received has corrupted CRC-5 and/or CRC-16.
Receipt of LBAD will cause a port to resend all header packets after the last header packet that has been acknowledged with LGOOD_n.
Refer to Section 7.2.4.1 for details.
LGO_Ux01000000001: LGO_U1
0010: LGO_U2
0011: LGO_U3
Others: Reserved
Sent by a port requesting entry to U1.
Sent by a port requesting entry to U2
Sent by a downstream port requesting entry to U3. An upstream port shall accept the request.
LAU0101000reservedSent by a port accepting the request to enter U1, U2, or U3.
LXU0110000reservedSent by a port rejecting the request to enter U1 or U2.
LPMA0111000reservedSent by a port upon receiving L AU. Used in conjunction with LGO_Ux and LAU handshake to guarantee both ports are in the same state.
LDN10-00000reservedDownstream port present in U0. Sent by a downstream port every 10 µs when there are no packets or other link commands to be transmitted. Refer to Section 7.5.6.1 for detail
LUP1001000reservedDevice present in U0. Sent by an upstream port every 10 µs when there are no packets or other link commands to be transmitted. Refer to Section 7.5.6.1 for details.

LCRD 发送规则
初始时根据 buffer 数量发送相应的 LCDR_x
进入 U0 后 → 发送 LGOOD_n → 马上发 LCRD_x。

Local Rx Header Buffer Credit Count要发送的 LCRD 报文
1LCRD_A
2LCRD_A, LCRD_B
3LCRD_A, LCRD_B, LCRD_C
4LCRD_A, LCRD_B, LCRD_C, LCRD_D

正常工作时
处理完一个 header packet 后 发送一个新的LCRD_x
A B C D 循环发送

3.3 LTSSM

四、protocol layer

Packet Types

  1. 00000b Link Management Packet (LMP)
    subtype
    0000b Reserved
    0001b Set Link Function
    0010b U2 Inactivity Timeout
    0011b Vendor Device Test
    0100b Port Capability
    0101b Port Configuration
    0110b Port Configuration Response
    0111b Precision Time Management
    1000b-1111b Reserved
  2. 00100b Transaction Packet (TP)
    subtype
    0000b Reserved
    0001b ACK
    0010b NRDY
    0011b ERDY
    0100b STATUS
    0101b STALL
    0110b DEV_NOTIFICATION
    0111b PING
    1000b PING_RESPONSE
    1001b – 1111b Reserved
  3. 01000b Data Packet Header (DP)
  4. 01100b Isochronous Timestamp Packet (ITP)

4.1Link Management Packets (LMP)

4.2 Transaction Packet (TP)










4.3 Data Packet (DP)

4.4 Isochronous Timestamp Packet (ITP)

4.5 TP sequence

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/4/10 14:16:07

模板特化与偏特化实战

1、非修改序列算法 这些算法不会改变它们所操作的容器中的元素。 1.1 find 和 find_if find(begin, end, value):查找第一个等于 value 的元素,返回迭代器(未找到返回 end)。find_if(begin, end, predicate):查找第…

作者头像 李华
网站建设 2026/4/12 2:19:19

跨语言调用C++接口

1、非修改序列算法 这些算法不会改变它们所操作的容器中的元素。 1.1 find 和 find_if find(begin, end, value):查找第一个等于 value 的元素,返回迭代器(未找到返回 end)。find_if(begin, end, predicate):查找第…

作者头像 李华
网站建设 2026/4/15 8:48:41

Thinkphp和Laravel私人健身和教练预约管理系统

目录 ThinkPHP与Laravel框架的私人健身及教练预约管理系统摘要功能概述技术实现差异核心模块数据安全扩展能力部署方案 项目开发技术介绍PHP核心代码部分展示系统结论源码获取/同行可拿货,招校园代理 ThinkPHP与Laravel框架的私人健身及教练预约管理系统摘要 功能概述 私人健…

作者头像 李华
网站建设 2026/4/15 20:02:20

Python迭代器(Iterator)揭秘:for循环背后的故事

SQLAlchemy是Python中最流行的ORM(对象关系映射)框架之一,它提供了高效且灵活的数据库操作方式。本文将介绍如何使用SQLAlchemy ORM进行数据库操作。目录安装SQLAlchemy核心概念连接数据库定义数据模型创建数据库表基本CRUD操作查询数据关系操…

作者头像 李华
网站建设 2026/4/12 9:17:08

实时操作系统中的C++

1、非修改序列算法 这些算法不会改变它们所操作的容器中的元素。 1.1 find 和 find_if find(begin, end, value):查找第一个等于 value 的元素,返回迭代器(未找到返回 end)。find_if(begin, end, predicate):查找第…

作者头像 李华
网站建设 2026/3/31 18:17:06

基于matlab的全局路径规划算法中的快速扩展随机树RRT路径规划算法及其改进方法RRT

基于matlab的全局路径规划算法中的快速扩展随机树RRT路径规划算法及其改进方法RRT Star、RRT_Conncet是一种具有状态约束的非线性系统生成开环轨迹的技术,相比于其他算法可以轻松处理障碍物的问题。最近在折腾机器人路径规划的时候,被各种RRT变种算法搞得…

作者头像 李华