You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b781195
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: examples/int32_publisher_custom_transport_usbcdc/README.md
+43-10Lines changed: 43 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,14 @@ This example is configured to use the two interfaces of USB-CDC. One interface i
16
16
17
17
### Hardware Required
18
18
19
-
This example can be run on any development board that has a USB-CDC interface.
19
+
This example can be run on any ESP32-S2 or ESP32-S3 development board that exposes the chip's native USB interface.
20
+
21
+
Some development boards have two USB connectors:
22
+
23
+
- A USB-to-UART connector, which is commonly used for flashing and serial monitor.
24
+
- A native USB connector wired directly to the ESP32-S2/S3 USB pins.
25
+
26
+
This example uses the native USB connector at runtime. The application exposes USB-CDC ACM interfaces from the ESP32-S2/S3 itself, so the micro-ROS Agent must be connected to the native USB connector, not to the USB-to-UART connector.
20
27
21
28
### Configure the project
22
29
@@ -31,37 +38,63 @@ If you want to use only the micro-ROS communication interface, you need to turn
31
38
### Build and Flash
32
39
33
40
> [!NOTE]
34
-
> The ESP32-S2/S3 chip needs to be in bootloader mode before it can be detected as a DFU device and flash. This can be achieved by pulling GPIO0 down (e.g., pressing the BOOT button), pulling RESET down for a moment, and releasing GPIO0.
41
+
> You can flash the firmware through any supported ESP-IDF flashing interface. If you flash through a USB-to-UART connector, reconnect the board through the native USB connector before running the micro-ROS Agent.
35
42
36
43
#### Build the project
37
44
38
-
Build DFU image:
45
+
```bash
46
+
idf.py build
47
+
```
48
+
49
+
#### Flash using USB-to-UART
50
+
51
+
If your board has a USB-to-UART connector, you can flash the application with the regular ESP-IDF serial flashing flow. Replace `/dev/ttyUSB0` with the actual serial port if needed:
39
52
40
53
```bash
41
-
idf.py dfu
54
+
idf.py -p /dev/ttyUSB0 flash
42
55
```
43
56
44
-
#### Flash the project
57
+
After flashing, move the USB cable to the native USB connector before running the example.
58
+
59
+
#### Flash using native USB
45
60
46
-
Put the ESP32-S2/S3 into bootloader mode and run the following command:
61
+
If you want to avoid moving the USB cable between flashing and running the example, flash through the native USB connector.
62
+
63
+
For ESP32-S2, enter USB DFU bootloader mode by holding BOOT, resetting the board, and then releasing BOOT. Then run:
47
64
48
65
```bash
66
+
idf.py dfu
49
67
idf.py dfu-flash
50
68
```
51
69
70
+
For ESP32-S3, the native USB connector commonly enumerates as USB-JTAG/serial in bootloader mode. Replace `/dev/ttyACM0` with the actual USB-JTAG/serial port if needed:
71
+
72
+
```bash
73
+
idf.py -p /dev/ttyACM0 flash
74
+
```
75
+
76
+
After flashing, reset the board and let the application start. With the default configuration, the application exposes two USB-CDC ACM ports over the native USB connector: one for micro-ROS communication and one for log output.
77
+
52
78
### Run micro-ROS Agent
53
79
80
+
Use the micro-ROS communication CDC port from the native USB connector, usually `/dev/ttyACM0`:
81
+
54
82
```bash
55
83
export ROS_DOMAIN_ID=100 # Set the ROS2 domain ID
56
84
ros2 run micro_ros_agent micro_ros_agent serial --dev /dev/ttyACM0
57
85
```
58
86
87
+
Or, using Docker:
88
+
89
+
```bash
90
+
docker run -it --rm -v /dev:/dev -v /dev/shm:/dev/shm --privileged --net=host microros/micro-ros-agent:rolling serial --dev /dev/ttyACM0 -v4
Copy file name to clipboardExpand all lines: examples/int32_publisher_custom_transport_usbcdc/components/esp32s2_usbcdc_transport/esp32s2_usbcdc_transport.h
0 commit comments