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 [2022/12/12 20:16] nick |
products:sbc:edge2:configurations:usb-gadget [2025/09/18 06:07] (current) jacobe |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | {{indexmenu_n> | ||
====== Edge2 USB Gadget ====== | ====== Edge2 USB Gadget ====== | ||
- | |||
{{page>/ | {{page>/ | ||
+ | |||
+ | ===== Usage of ADB ===== | ||
+ | |||
+ | ADB is enabled by default, you can access the device directly via adb: | ||
+ | |||
+ | <code shell> | ||
+ | $ adb kill-server | ||
+ | $ adb devices | ||
+ | * daemon not running; starting now at tcp:5037 | ||
+ | * daemon started successfully | ||
+ | |||
+ | List of devices attached | ||
+ | 12036c819990 | ||
+ | |||
+ | $ adb shell | ||
+ | root@Khadas:/# | ||
+ | </ | ||
+ | |||
+ | ===== Enable Other USB Functions ===== | ||
+ | |||
+ | You can dynamically switch USB functions by writing to ''/ | ||
+ | |||
+ | * **Enable RNDIS** | ||
+ | <code shell> | ||
+ | echo usb_rndis_en > / | ||
+ | sudo usbdevice restart | ||
+ | </ | ||
+ | |||
+ | * **Enable ACM** | ||
+ | <code shell> | ||
+ | echo usb_acm_en > / | ||
+ | sudo usbdevice restart | ||
+ | </ | ||
+ | |||
+ | * **Enable UAC** | ||
+ | <code shell> | ||
+ | echo usb_uac_en > / | ||
+ | sudo usbdevice restart | ||
+ | </ | ||
+ | |||
+ | * **Enable UVC** | ||
+ | <code shell> | ||
+ | echo usb_uvc_en > / | ||
+ | sudo usbdevice restart | ||
+ | </ | ||
+ | |||
+ | After enabling UVC, run: | ||
+ | <code shell> | ||
+ | uvc-gadget rockchip/ | ||
+ | </ | ||
+ | > Note: Replace '' | ||
+ | |||
+ | * **Enable UMS** | ||
+ | <code shell> | ||
+ | echo usb_ums_en > / | ||
+ | sudo mkdir -p /userdata/ | ||
+ | dd if=/ | ||
+ | </ | ||
+ | |||
+ | UMS mode requires the empty '' | ||
+ | |||
+ | ===== RNDIS Setup IP Address ===== | ||
+ | |||
+ | 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 | ||
+ | </ | ||
+ | |||
+ | Also configure the IP on the host PC, for example '' | ||
+ | |||
+ | Test the network connection: | ||
+ | |||
+ | <code shell> | ||
+ | ping -I usb0 192.168.35.110 | ||
+ | </ | ||
+ |