Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:edge-2l:configurations:usb-gadget

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
products:sbc:edge-2l:configurations:usb-gadget [2025/11/25 04:04]
gray created
products:sbc:edge-2l:configurations:usb-gadget [2026/05/11 02:29] (current)
nick
Line 1: Line 1:
 {{indexmenu_n>30}} {{indexmenu_n>30}}
  
-====== Edge-2L USB Gadget ======+====== Edge-2L USB gadget ======
  
-{{page>/products/sbc/common/configurations/usb-gadget&noheader}}+{{page>products:sbc:common:configurations:usb-gadget&noheader}}
  
 ===== Usage of ADB ===== ===== Usage of ADB =====
  
-ADB is enabled by default, you can access the device directly via adb:+ADB (Android Debug Bridge) is enabled by default. You can access the device directly via ADB:
  
 <code shell> <code shell>
 $ adb kill-server $ adb kill-server
 $ adb devices $ adb devices
 +</code>
 +
 +Expected output:
 +```txt
 * daemon not running; starting now at tcp:5037 * daemon not running; starting now at tcp:5037
 * daemon started successfully * daemon started successfully
Line 17: Line 21:
 List of devices attached List of devices attached
 12036c819990    device 12036c819990    device
 +```
  
 +To obtain a shell on the device:
 +```shell
 $ adb shell $ adb shell
-root@Khadas:/# 
-</code> 
  
-===== Enable Other USB Functions =====+``` 
 +You should see a prompt like: ''root@Khadas:/#''
  
-You can dynamically switch USB functions by writing to ''/tmp/.usb_config'' and restarting the ''usbdevice'' service.+===== Enable other USB functions =====
  
-  * **Enable RNDIS**+You can dynamically switch USB gadget functions by writing the desired mode to the file ''/tmp/.usb_config'' and restarting the 'usbdevice' service. 
 + 
 +  * **Enable RNDIS (Ethernet over USB):**
 <code shell> <code shell>
 echo usb_rndis_en > /tmp/.usb_config echo usb_rndis_en > /tmp/.usb_config
Line 32: Line 40:
 </code> </code>
  
-  * **Enable ACM**+  * **Enable ACM (Serial Port over USB):**
 <code shell> <code shell>
 echo usb_acm_en > /tmp/.usb_config echo usb_acm_en > /tmp/.usb_config
Line 38: Line 46:
 </code> </code>
  
-  * **Enable UAC**+  * **Enable UAC (USB Audio Class):**
 <code shell> <code shell>
 echo usb_uac_en > /tmp/.usb_config echo usb_uac_en > /tmp/.usb_config
Line 44: Line 52:
 </code> </code>
  
-  * **Enable UVC**+  * **Enable UVC (USB Video Class):**
 <code shell> <code shell>
 echo usb_uvc_en > /tmp/.usb_config echo usb_uvc_en > /tmp/.usb_config
Line 50: Line 58:
 </code> </code>
  
-After enabling UVC, run:+After enabling UVC, start the UVC gadget application:
 <code shell> <code shell>
 uvc-gadget rockchip/functions/uvc.0 -d /dev/videoX uvc-gadget rockchip/functions/uvc.0 -d /dev/videoX
 </code> </code>
-> Note: Replace ''X'' with the actual video node number.+> Note: Replace ''X'' with the actual video device node number (e.g. /dev/video0).
  
-  * **Enable UMS**+  * **Enable UMS (USB Mass Storage):**
 <code shell> <code shell>
 echo usb_ums_en > /tmp/.usb_config echo usb_ums_en > /tmp/.usb_config
Line 63: Line 71:
 </code> </code>
  
-UMS mode requires the empty ''ums_shared.img'' file (1GB in the example above)which will be recognized as a storage drive by the host system.+UMS mode requires an empty disk image file (''ums_shared.img'' in the example above, 1GB size). This file will be presented to the host system as a removable storage drive. 
 + 
 +===== RNDIS setup IP address =====
  
-===== RNDIS Setup IP Address =====+After enabling the RNDIS function, you need to configure the IP address manually on both the device and the host PC.
  
-After enabling RNDIS, configure the IP address manuallyFor exampleset the device IP to ''192.168.35.100'':+Such as set the IP address for the usb0 interface (e.g., to 192.168.35.100):
  
 <code shell> <code shell>
Line 73: Line 83:
 </code> </code>
  
-Also configure the IP on the host PCfor example ''192.168.35.110''.+On the host PC, configure the corresponding USB network interface with an IP address on the same subnet (e.g., 192.168.35.110).
  
-Test the network connection:+Test the connection form the device to the host:
  
 <code shell> <code shell>
Last modified: 2025/11/25 04:04 by gray