VIM3 Firmware upgrading - no mouse and keyboard

I use SSH to khadas and followed " Setup the PCIe/USB3.0 port using the Android/Ubuntu command line". Still doesn’t work:

[ 21.747990] *** VALIDATE fuse ***
[ 33.760875] USB_PWR: disabling
[ 146.808593] USB PCIe Switch Mode: USB3.0
root@Khadas:~# cat /sys/class/mcu/usb_pcie_switch_mode

I see the following errors in dmesg:

[ 2.848575] OF: /soc/usb@ffe09000: could not find phandle
[ 2.852606] OF: /soc/usb@ffe09000: could not find phandle
[ 2.857940] OF: /soc/usb@ffe09000: could not find phandle
[ 2.863261] dwc3-meson-g12a ffe09000.usb: USB2 ports: 0
[ 2.868432] dwc3-meson-g12a ffe09000.usb: USB3 ports: 0
[ 2.874092] dwc3 ff500000.usb: Failed to get clk ‘ref’: -2

After change the mode, you need to poweroff your device. Have you poweroff the device? It should work.

-------- khadas vim3 serial USB setup

connect the serial-usb adabter to the gpio pins on khadas
Tool Pin GND: <—> Pin17 of VIM’s GPIO
Tool Pin TXD: <—> Pin18 of VIM’s GPIO(Linux_Rx)
Tool Pin RXD: <—> Pin19 of VIM’s GPIO(Linux_Tx)

connect the adapter to USB to USB on other working linux machine

ls -l /dev/ttyUSB* > sudo gpasswd -a $(whoimi) uucp > newgrp uucp >

sudo apt install minicom > minicom > ctrl+a > z > o > Serial port setup >
A =/dev/ttyUSB0 > E = 115200 > F = No > G = No > ESC > Save setup as dfl >
sudo passwd khadas > xxxxxx > sudo passwd root > xxxxxxxxx > cat /sys/class/mcu/usb_pcie_switch_mode
1 > 0 - (USB 3.0 mode and 1 - PCIe mode) > (Change mode to USB 3.0): echo 0 > /sys/class/mcu/usb_pcie_switch_mode

echo 1 > /sys/class/mcu/poweroff > Then press the POWER KEY to boot the system.
reboot the khadas


I double checked on my side with a fresh install of image:

If you disable PCIe successfully, the USB works well.

My test was with image on 20191228.
And yet, it’s ALL about 20191231. After re-flashing 20191231, my khadas VIM3 won’t let me login, I mean: mouse and keyboard don’t work.

Now, how to disable PCIe? And, does that mean: there is one interface working at the same time? Either PCIe or USB? What’s more, how do I know if I successfully have PCIe disabled? which command to show that?


Hello, You can try @hyphop 's Krescue to set portmode.

I do power off and restart multiple times.

@mouacyk @jiapei100

No idea yet, I checked on my side with a fresh installation, it works well.

As the PCIe may broken the USB, I will upload a new image with PCIe disabled today.

mouse key works for me in CoreELEC and Android, so it must be only the Ubuntu image.

It only happens with VIM3 mainline kernel with PCIe enabled but NVMe SSD removed, 4.9 kernel works well.

@mouacyk @jiapei100

Here is the new image with PCIe disabled, the USB should work.


thank you, it works now

Still the same from my side…
mouse and keyboard are still locked…

How you bootup the mainline image? Have you erased the eMMC?

longervision-GT72-6QE% sudo dd bs=4M if=VIM3_Ubuntu-xfce-bionic_Linux-5.5-rc2_arm64_SD-USB_V0.8.2-20200103.img of=/dev/mmcblk0 conv=fsync
[sudo] password for longervision: 
1093+0 records in
1093+0 records out
4584374272 bytes (4.6 GB, 4.3 GiB) copied, 200.589 s, 22.9 MB/s

I ONLY burned TF so far…

Please check the release note:

NOTE: For mainline image, DO NOT use verdor u-boot to boot it, you need to erase the eMMC and fully boot from the SD card or you will get a green screen.

  1. It seems mine is khadas pro, and there is an existing Ubuntu on it. I’m using it temporarily for now…
  2. I actually tried to press P+F for a long term (without TF card inserted) after rebooting, it’s NOT working …
  3. Some times, the rebooting process recursively occurs, without letting me log in… I guess Khadas is easily to get overheating ???

Can confirm, VIM3 arribed friday and today I installed VIM3_Ubuntu-xfce-bionic_Linux-4.9_arm64_EMMC_V20191231 and mouse and keyboard don’t work. Will try the SD version tomorrow.

I think these post already answers the reason for USB not working, You need to change the mode using Krescue.

It’s impossible that USB doesn’t work on 4.9 kenel.