Skip to content

Commit b3a7634

Browse files
committed
Merge branch 'docs/update_usb_device_const_com' into 'master'
docs: update usb device const com solution See merge request ae_group/esp-iot-solution!1162
2 parents 64848f4 + ae8c4b6 commit b3a7634

File tree

4 files changed

+110
-6
lines changed

4 files changed

+110
-6
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\303A10010101 /V IgnoreHWSerNum /t REG_BINARY /d 01 && (
2+
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\303A10010102 /V IgnoreHWSerNum /t REG_BINARY /d 01 && (
3+
echo Registry keys added successfully. Please restart your computer to apply the changes.
4+
) || (
5+
echo Failed to add the second registry key. Please try again with Administrator privileges.
6+
)
7+
) || (
8+
echo Failed to add the first registry key. Please try again with Administrator privileges.
9+
)
10+
pause
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\UsbFlags\IgnoreHWSerNum303A1001
2+
if %errorlevel% equ 0 (
3+
echo Registry keys added successfully. Please restart your computer to apply the changes.
4+
) else (
5+
echo Failed to add the first registry key. Please try again with Administrator privileges.
6+
)
7+
pause

docs/en/usb/usb_overview/usb_device_const_COM.rst

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,59 @@ In the ESP ROM Code, the configuration of USB descriptors is as follows:
1515
- ESP32S2
1616
- ESP32S3
1717
- ESP32C3
18+
- ESP32C5
19+
- ESP32C6
20+
- ESP32C61
21+
- ESP32H2
22+
- ESP32P4
23+
* - **Interface**
24+
- usb-otg
25+
- usb-serial-jtag
26+
- usb-serial-jtag
27+
- usb-serial-jtag
28+
- usb-serial-jtag
29+
- usb-serial-jtag
30+
- usb-serial-jtag
31+
- usb-serial-jtag
1832
* - **VID**
1933
- 0x303a
2034
- 0x303a
2135
- 0x303a
36+
- 0x303a
37+
- 0x303a
38+
- 0x303a
39+
- 0x303a
40+
- 0x303a
2241
* - **PID**
2342
- 0x0002
2443
- 0x1001
2544
- 0x1001
45+
- 0x1001
46+
- 0x1001
47+
- 0x1001
48+
- 0x1001
49+
- 0x1001
50+
* - **Revision (bcdDevice)**
51+
- N/A
52+
- v1.01
53+
- v1.01
54+
- v1.02
55+
- v1.02
56+
- v1.02
57+
- v1.02
58+
- v1.02
2659
* - **Serial**
2760
- 0
2861
- MAC address
2962
- MAC address
63+
- MAC address
64+
- MAC address
65+
- MAC address
66+
- MAC address
67+
- MAC address
3068

3169
* For ESP32S2 with USB On-The-Go (usb-otg), the Serial is a constant 0, and it remains the same for every device, resulting in consistent COM port numbers.
32-
* For ESP32S3 (usb-serial-jtag) and ESP32C3 (usb-serial-jtag), the Serial is set to the device MAC address. Each device has a unique MAC address, leading to different COM port numbers by default with incremental assignment.
70+
* For ESP32S3 (usb-serial-jtag) or other chips with usb-serial-jtag interface, the Serial is set to the device MAC address. Each device has a unique MAC address, leading to different COM port numbers by default with incremental assignment.
3371

3472
Incrementing COM numbers pose additional challenges for mass production programming. For customers requiring firmware downloads via USB, it is recommended to modify the Windows rules for incrementing the COM number to prevent incrementing the number based on the Serial number.
3573

@@ -40,6 +78,12 @@ Solution
4078

4179
.. code-block:: shell
4280
43-
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\303A10010101 /V IgnoreHWSerNum /t REG_BINARY /d 01
81+
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\303A10010101 /V IgnoreHWSerNum /t REG_BINARY /d 01
82+
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\303A10010102 /V IgnoreHWSerNum /t REG_BINARY /d 01
83+
84+
Users have the option to download the script :download:`ignore_hwserial_usb_serial_jtag.bat <../../../_static/ignore_hwserial_usb_serial_jtag.bat>` , then run it with administrative privileges by right-clicking and selecting **Run as Administrator**.
85+
86+
87+
.. Note::
4488

45-
Users have the option to download the script :download:`ignore_hwserial_esp32s3c3.bat <../../../_static/ignore_hwserial_esp32s3c3.bat>` , then run it with administrative privileges by right-clicking and selecting **Run as Administrator**.
89+
The above command is for Windows 10/11. For Windows 7 or other versions, the registry path is different. Please download the script :download:`ignore_hwserial_usb_serial_jtag_win7.bat <../../../_static/ignore_hwserial_usb_serial_jtag_win7.bat>` and run it with Administrative privileges.

docs/zh_CN/usb/usb_overview/usb_device_const_COM.rst

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,59 @@ ESP ROM Code 中对 USB 描述符配置如下:
1515
- ESP32S2
1616
- ESP32S3
1717
- ESP32C3
18+
- ESP32C5
19+
- ESP32C6
20+
- ESP32C61
21+
- ESP32H2
22+
- ESP32P4
23+
* - **Interface**
24+
- usb-otg
25+
- usb-serial-jtag
26+
- usb-serial-jtag
27+
- usb-serial-jtag
28+
- usb-serial-jtag
29+
- usb-serial-jtag
30+
- usb-serial-jtag
31+
- usb-serial-jtag
1832
* - **VID**
1933
- 0x303a
2034
- 0x303a
2135
- 0x303a
36+
- 0x303a
37+
- 0x303a
38+
- 0x303a
39+
- 0x303a
40+
- 0x303a
2241
* - **PID**
2342
- 0x0002
2443
- 0x1001
2544
- 0x1001
45+
- 0x1001
46+
- 0x1001
47+
- 0x1001
48+
- 0x1001
49+
- 0x1001
50+
* - **Revision (bcdDevice)**
51+
- N/A
52+
- v1.01
53+
- v1.01
54+
- v1.02
55+
- v1.02
56+
- v1.02
57+
- v1.02
58+
- v1.02
2659
* - **Serial**
2760
- 0
2861
- MAC 地址字符串
2962
- MAC 地址字符串
63+
- MAC 地址字符串
64+
- MAC 地址字符串
65+
- MAC 地址字符串
66+
- MAC 地址字符串
67+
- MAC 地址字符串
3068

3169
* ESP32S2(usb-otg)Serial 为常量 0,每个设备相同,COM 号一致
32-
* ESP32S3(usb-serial-jtag)、ESP32C3(usb-serial-jtagSerial 为设备 MAC 地址,每个设备均不同,COM 号默认递增
70+
* ESP32S3(usb-serial-jtag)、或其他支持 usb-serial-jtag 接口的芯片,Serial 为设备 MAC 地址,每个设备均不同,COM 号默认递增
3371

3472
递增 COM 编号,为量产烧录带来额外工作。对于需要使用 USB 进行固件下载的客户,建议修改 Windows 的递增 COM 编号的规则,阻止依据 Serial 号递增编号。
3573

@@ -40,6 +78,11 @@ ESP ROM Code 中对 USB 描述符配置如下:
4078

4179
.. code-block:: shell
4280
43-
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\303A10010101 /V IgnoreHWSerNum /t REG_BINARY /d 01
81+
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\303A10010101 /V IgnoreHWSerNum /t REG_BINARY /d 01
82+
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\303A10010102 /V IgnoreHWSerNum /t REG_BINARY /d 01
83+
84+
用户也可下载 :download:`ignore_hwserial_usb_serial_jtag.bat <../../../_static/ignore_hwserial_usb_serial_jtag.bat>` 脚本,右键选择管理员方式运行。
85+
86+
.. Note::
4487

45-
用户也可下载 :download:`ignore_hwserial_esp32s3c3.bat <../../../_static/ignore_hwserial_esp32s3c3.bat>` 脚本,右键选择管理员方式运行。
88+
以上指令仅适用于 Windows 10/11,对于 Windows 7 或其它版本,请下载使用 :download:`ignore_hwserial_usb_serial_jtag_win7.bat <../../../_static/ignore_hwserial_usb_serial_jtag_win7.bat>` 脚本,右键选择管理员方式运行。

0 commit comments

Comments
 (0)