USB Access

In the default configuration, as shipped, USB in is peripheral mode and a “wall wart” AC adaptor can be used for power. In this mode, it is also possible to connect the development board to a workstation’s USB 3.0+ port (where VBUS can supply up to 900mA) and access a serial console.

In the latest software images, the development board acts as a multifunction composite gadget which provides both serial and networking support.

USB Serial Console

Connect the board to a workstation using a USB-A to USB-C cable. The haptic motor will sound briefly and the board should appear shortly after as a USB serial device to the workstation.

Check to see that the following appears in the output of the lsusb command:

Bus 001 Device 008: ID 1d6b:0104 Linux Foundation Multifunction Composite Gadget

The bus and device numbers may differ from those shown.

The device will also appear in the /dev/ directory as a serial port, such as /dev/ttyACM0, which you can use to access the board’s serial console if you have permission to read and write to that device:

picocom -b 115200 /dev/ttyACM0

This should produce the output like this:

pureos-test login:

You may need to press Return to see the prompt.

You should be able to log in using purism as the user name and 123456 as the password.

Note: You may have trouble accessing the serial device if your user is not a member of the dialout group on your workstation. For example, you may get an error like this:

FATAL: cannot open /dev/ttyACM0: Permission denied

In this case, you can either add your user to the dialout group or, as a workaround, run picocom using the sudo command.

Alternate Configuration - USB C Host

Warning

Using the board in this mode means that you will lose access to the USB serial console, so it is important to have set up SSH access via Ethernet before following these steps.

In this configuration, USB host mode is used to allow keyboard, mouse and flash memory sticks to be connected to the development board.

The J5 Create JCA374 USB Type-C Multi-Adapter is known to work as a hub and power the board using USB Power Delivery.

Follow the instructions for the kernel you are running on the development board.

Linux 4.18

  1. On the development board, backup the device tree and copy in the USB host version:

    cp /boot/dtbs/librem5-evk.dtb /boot/dtbs/librem5-evk.dtb.bak
    cp /boot/dtbs/librem5-evk-usbhost.dtb /boot/dtbs/librem5-evk.dtb
    
  2. Attach a USB C hub to the development board.

  3. Attach power to the USB C hub.

  4. Plug in USB devices and they should appear in the output of the dmesg and lsusb tools.

Linux 5.2

The following steps will work for the specific version of the kernel you are using. When the kernel is updated, you will need to perform these steps again.

  1. On the development board, backup the device tree binary file:

    sudo cp /boot/dtbs/`uname -r`/imx8mq-librem5-devkit.dtb /boot/dtbs/`uname -r`/imx8mq-librem5-devkit.dtb.bak
    
  2. Extract the device tree sources from the binary:

    dtc /boot/dtbs/`uname -r`/imx8mq-librem5-devkit.dtb > /tmp/imx8mq-librem5-devkit.dts
    
  3. Find this line in the newly created /tmp/imx8mq-librem5-devkit.dts:

    dr_mode = "otg";
    

    Change it to this:

    dr_mode = "host";
    

    Save the file.

  4. Generate a new device tree binary file:

    sudo dtc /tmp/imx8mq-librem5-devkit.dts > /boot/dtbs/`uname -r`/imx8mq-librem5-devkit.dtb
    
  5. Attach a USB C hub to the development board.

  6. Attach power to the USB C hub.

  7. Plug in USB devices and they should appear in the output of the dmesg and lsusb tools.