MX6412J/MX6210N Dual Role USB
===
### 1. Enter BIOS Expert Mode (Alt+F3), enable xDCI and set USB device mode on HS0 and SS0
It seems to work by only enabling xDCI without USB Device/Host Mode Override
### 2. Install Ubuntu 20.04.2 LTS
[Ubunut 20.04](http://www.releases.ubuntu.com/20.04/)
### 3. Run script to export a 2GB USB disk
```bash=
$ cat usb_device.sh
#!/bin/bash
echo -e "\n"
echo "Setup a 2GB vfat.img"
dd if=/dev/zero of=vfat.img bs=1M count=2000 status=progress
#mkdir vfat_mount_point
mkfs.vfat vfat.img
sudo losetup /dev/loop17 vfat.img
#sudo mount /dev/loop17 vfat_mount_point
sudo modprobe g_mass_storage file=/dev/loop17 stall=0 removable=1 iSerialNumber=123456
$ chmod +x usb_device.sh
$ sudo ./usb_device.sh
```
### 4. Connect to remote PC with USB 2.0 or 3.0 Type-A male to Type-A male cable
#### 4.1 Cable Pinout

#### 4.2 USB 2.0 Test Result
USBView

Writing to USB

Reading from USB

#### 4.3 USB 3.0 Test Result
USBView

Writing to USB

Reading from USB

###### tags: `USB` `MX6412J`