====== VIM3/VIM3L USB3/PCIe Switch ====== Khadas VIM3 contains a 2:1 data switch chipset to switch the "combo interface" between ''PCIe'' and ''USB 3.0'', and the default mode is ''USB 3.0''. ===== Switch port mode using KBI ===== You need to setup the [[ products:sbc:common:development:setup-serial-tool| serial debug tool ]] and enter the u-boot command line. Initialize the KBI: ```shell kvim3#kbi init ``` Check current port mode: ```shell kvim3#kbi portmode r port mode is USB3.0 ``` The default mode is USB-3.0. Change mode to PCIe: ```shell kvim3#kbi portmode w 1 set port mode to :PCIE ``` Change mode to USB 3.0: ```shell kvim3#kbi portmode w 0 set port mode to :USB3.0 ``` Poweroff the system to bring changes into effect: ```shell kvim3#kbi poweroff do_kbi_poweroff ``` Then press the ''POWER KEY'' to boot the system ===== Switch port mode using linux ===== Check current port mode: ```shell khadas@Khadas:~$ cat /sys/class/mcu/usb_pcie_switch_mode 1 ``` ''0'' - USB 3.0 mode ''1'' - PCIe mode Change mode to USB 3.0: ```shell khadas@Khadas:~$ echo 0 > /sys/class/mcu/usb_pcie_switch_mode ``` Change mode to PCIe: ```shell khadas@Khadas:~$ echo 1 > /sys/class/mcu/usb_pcie_switch_mode ```shell Poweroff the system to bring changes into effect: ```shell khadas@Khadas:~$ echo 1 > /sys/class/mcu/poweroff ``` Then press the ''POWER KEY'' to boot the system.