Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:edge2:configurations:usb-gadget

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
products:sbc:edge2:configurations:usb-gadget [2024/10/16 02:58]
nick
products:sbc:edge2:configurations:usb-gadget [2025/09/18 06:07] (current)
jacobe
Line 1: Line 1:
 {{indexmenu_n>30}} {{indexmenu_n>30}}
  
 +====== Edge2 USB Gadget ======
  
 +{{page>/products/sbc/common/configurations/usb-gadget&noheader}}
  
-====== Edge2 USB Gadget ======+===== 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    device 
 + 
 +$ adb shell 
 +root@Khadas:/# 
 +</code> 
 + 
 +===== Enable Other USB Functions ===== 
 + 
 +You can dynamically switch USB functions by writing to ''/tmp/.usb_config'' and restarting the ''usbdevice'' service. 
 + 
 +  * **Enable RNDIS** 
 +<code shell> 
 +echo usb_rndis_en > /tmp/.usb_config 
 +sudo usbdevice restart 
 +</code> 
 + 
 +  * **Enable ACM** 
 +<code shell> 
 +echo usb_acm_en > /tmp/.usb_config 
 +sudo usbdevice restart 
 +</code> 
 + 
 +  * **Enable UAC** 
 +<code shell> 
 +echo usb_uac_en > /tmp/.usb_config 
 +sudo usbdevice restart 
 +</code> 
 + 
 +  * **Enable UVC** 
 +<code shell> 
 +echo usb_uvc_en > /tmp/.usb_config 
 +sudo usbdevice restart 
 +</code> 
 + 
 +After enabling UVC, run: 
 +<code shell> 
 +uvc-gadget rockchip/functions/uvc.0 -d /dev/videoX 
 +</code> 
 +> Note: Replace ''X'' with the actual video node number. 
 + 
 +  * **Enable UMS** 
 +<code shell> 
 +echo usb_ums_en > /tmp/.usb_config 
 +sudo mkdir -p /userdata/ 
 +dd if=/dev/zero of=/userdata/ums_shared.img bs=1M count=1024 
 +</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. 
 + 
 +====RNDIS Setup IP Address ===== 
 + 
 +After enabling RNDIS, configure the IP address manually. For example, set the device IP to ''192.168.35.100'': 
 + 
 +<code shell> 
 +sudo ifconfig usb0 192.168.35.100 up 
 +</code> 
 + 
 +Also configure the IP on the host PC, for example ''192.168.35.110''
 + 
 +Test the network connection:
  
 +<code shell>
 +ping -I usb0 192.168.35.110
 +</code>
  
-{{page>/products/sbc/vim4/configurations/usb-gadget&noheader}} 
Last modified: 2024/10/16 02:58 by nick