This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
products:sbc:edge2:configurations:usb-gadget [2025/08/18 01:40] nick |
products:sbc:edge2:configurations:usb-gadget [2025/09/18 06:07] (current) jacobe |
||
---|---|---|---|
Line 1: | Line 1: | ||
{{indexmenu_n> | {{indexmenu_n> | ||
- | |||
====== Edge2 USB Gadget ====== | ====== Edge2 USB Gadget ====== | ||
- | |||
{{page>/ | {{page>/ | ||
Line 9: | Line 7: | ||
===== Usage of ADB ===== | ===== Usage of ADB ===== | ||
- | Try to access the devices | + | ADB is enabled by default, you can access the device directly |
- | ```shell | + | < |
$ adb kill-server | $ adb kill-server | ||
$ adb devices | $ adb devices | ||
* daemon not running; starting now at tcp:5037 | * daemon not running; starting now at tcp:5037 | ||
* daemon started successfully | * daemon started successfully | ||
+ | |||
List of devices attached | List of devices attached | ||
12036c819990 | 12036c819990 | ||
+ | |||
$ adb shell | $ adb shell | ||
root@Khadas:/# | root@Khadas:/# | ||
- | root@Khadas: | + | </code> |
- | root@Khadas:/# | + | |
- | root@Khadas:/# | + | |
- | ``` | + | |
- | ===== RNDIS Setup IP Address | + | ===== Enable Other USB Functions |
- | Edit ''/ | + | You can dynamically switch USB functions by writing to ''/ |
- | ```diff | + | * **Enable RNDIS** |
- | diff --git a/etc/profile.d/ | + | <code shell> |
- | index d10b84df..06d1ab22 100644 | + | echo usb_rndis_en > /tmp/.usb_config |
- | --- a/ | + | sudo usbdevice |
- | +++ b/etc/ | + | </code> |
- | @@ -11,8 +11,8 @@ | + | |
- | # @ UMS_RO: The flag of read only. 0->Read & Write, 1->Read Only. | + | |
- | | + | * **Enable ACM** |
- | export USB_FUNCS=" | + | <code shell> |
- | -#export USB_FUNCS=" | + | echo usb_acm_en > / |
- | +export USB_FUNCS=" | + | sudo usbdevice restart |
- | #export USB_FUNCS=" | + | </ |
- | # | + | |
- | | + | |
- | ``` | + | |
- | Setup IP address manyally, e.g. setup IP address as '' | + | * **Enable UAC** |
+ | <code shell> | ||
+ | echo usb_uac_en > /tmp/.usb_config | ||
+ | sudo usbdevice restart | ||
+ | </ | ||
- | ```shell | + | * **Enable UVC** |
- | sudo ifconfig usb0 192.168.35.100 up | + | < |
- | ``` | + | echo usb_uvc_en > /tmp/.usb_config |
+ | sudo usbdevice restart | ||
+ | </ | ||
- | You also need to setup the IP address on your PC, e.g. '' | + | After enabling UVC, run: |
+ | <code shell> | ||
+ | uvc-gadget rockchip/ | ||
+ | </ | ||
+ | > Note: Replace | ||
- | Check network connection: | + | * **Enable UMS** |
+ | <code shell> | ||
+ | echo usb_ums_en > / | ||
+ | sudo mkdir -p / | ||
+ | dd if=/ | ||
+ | </ | ||
- | ```shell | + | UMS mode requires the empty '' |
- | khadas@Khadas: | + | |
- | PING 192.168.35.110 | + | |
- | 64 bytes from 192.168.35.110: | + | |
- | 64 bytes from 192.168.35.110: | + | |
- | 64 bytes from 192.168.35.110: | + | |
- | 64 bytes from 192.168.35.110: | + | |
- | 64 bytes from 192.168.35.110: | + | |
- | ^C | + | |
- | --- 192.168.35.110 ping statistics --- | + | |
- | 5 packets transmitted, 5 received, 0% packet loss, time 4007ms | + | |
- | rtt min/ | + | |
- | ``` | + | |
+ | ===== RNDIS Setup IP Address ===== | ||
- | ===== Troubleshooting ===== | + | After enabling RNDIS, configure the IP address manually. For example, set the device IP to '' |
+ | |||
+ | <code shell> | ||
+ | sudo ifconfig usb0 192.168.35.100 up | ||
+ | </ | ||
- | If adb not work on windows, you can edit '' | + | Also configure the IP on the host PC, for example |
- | ```diff | + | Test the network connection: |
- | diff --git a/ | + | |
- | index d10b84df..06d1ab22 100644 | + | |
- | --- a/ | + | |
- | +++ b/ | + | |
- | @@ -11,8 +11,8 @@ | + | |
- | # @ UMS_RO: The flag of read only. 0->Read & Write, 1->Read Only. | + | |
- | | + | <code shell> |
- | -export USB_FUNCS=" | + | ping -I usb0 192.168.35.110 |
- | -#export USB_FUNCS=" | + | </ |
- | +#export USB_FUNCS=" | + | |
- | +export USB_FUNCS=" | + | |
- | # | + | |
- | # | + | |
- | | + | |
- | ``` | + | |