Librem 5 Development Kit

Note

This page is incomplete and is being revised.

The scripts mentioned on this page can be obtained from the librem5-devkit-tools repository.

If you experience problems with the development kit, you may find it useful to consult the Troubleshooting guide.

Connecting the Board to a Power Supply

In the default configuration, as shipped, USB in is peripheral mode and a “wall wart” AC adaptor is used for power.

Alternate Configuration #1 - USB C Console

  1. Attach the development board to a USB C or USB 3 port on the host that is capable of providing 900mA of current.
  2. ~30 seconds after boot a new device will appear at /dev/ttyACM0 – this is a serial console to the development board.

If your PC cannot provide the necessary power you may need a USB 3 powered hub between the host and the development board.

Alternate Configuration #2 - USB C Host

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

  1. On the target, 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.

Power on/off

On a development kit with an operating system installed, if the user holds the power button for ~2 seconds then a power down/reboot dialog should pop up; a quick press and release should turn the display on/off.

If the button is held for ~5 seconds the SoC triggers an event to shut down; pressing it again for ~2 seconds will turn it back on.

The button is also attached to the charge controller’s QON# pin, which when held for ~15 seconds is able to put the dev kit into a “shipping mode” where the charge controller is completely off, or holding it for ~18 seconds will cause it to perform a complete power cycle.

Install uuu

By Hand

The NXP mfgtool uuu is required to boot a board that has no bootloader or is otherwise “bricked”. Either download, build and install uuu:

git clone https://github.com/NXPmicro/mfgtools
cd mfgtools
cmake ./
make
sudo make install

Using the Convenient Script

Alternatively, you can use this script from the librem5-devkit-tools repository to build and install uuu:

scripts/build_uuu.sh -i

Udev Rules

If you want to run uuu as non-root add the following udev rules

cat <<EOF > /etc/udev/rules.d/99_librem5_devkit.rules
SUBSYSTEM!="usb", GOTO="librem5_devkit_rules_end"
# Devkit USB flash
ATTR{idVendor}=="1fc9", ATTR{idProduct}=="012b", GROUP+="plugdev", TAG+="uaccess"
ATTR{idVendor}=="0525", ATTR{idProduct}=="a4a5", GROUP+="plugdev", TAG+="uaccess"
ATTR{idVendor}=="0525", ATTR{idProduct}=="b4a4", GROUP+="plugdev", TAG+="uaccess"
LABEL="librem5_devkit_rules_end"
EOF
sudo udevadm control -R
sudo adduser <youruser> plugdev
newgrp plugdev

Make sure you replug the serial cable in case you have plugged it in already. With the above rules you can skip the sudo in front of the uuu invocations below.

Flash the Test Image

The eMMC that gets flashed is files/devkit-test.img. Put the “Boot Mode” switch in the USB position.

This will erase everything on your eMMC:

scripts/get_image.sh
sudo uuu uuu_scripts/flash_librem5-devkiti-test.lst

Download Target Binaries

You can manually download or build the required binaries. There is also a convenience script to download pre-built binaries from the Purism servers.:

scripts/fetch_latest.sh -xk

Flash u-boot

Using SDP

The uboot that gets flashed is files/u-boot-devkit-recovery.imx. Put the “Boot Mode” switch in the USB position:

sudo uuu uuu_scripts/u-boot_flash_librem5-devkit.lst

You can also just boot to u-boot without flashing anything:

sudo uuu uuu_scripts/u-boot_librem5-devkit.lst

Flash eMMC

Using SDP

The eMMC that gets flashed is files/devkit.img . Put the “Boot Mode” switch in the USB position.

This will erase everything on your eMMC:

sudo uuu uuu_scripts/flash_librem5-devkit.lst

Hardware Components

LCD Panel

The panel is a Rockchip JH057N00900 (5.7”, TFT 720x1440 Pixels) using a ST7703 IC.

Configure WiFi

For either method below you must first make sure the module is loaded:

modprobe rsi_sdio

Configure with nmtui

Just run “nmtui” and go to activate a network and then chose your WiFi network. If the list is empty it sometimes takes 15 seconds after loading the module to populate.

Configure with nmcli

If you know which network you want to connect to you can just us nmcli directly:

nmcli device wifi rescan
nmcli device wifi list
nmcli device wifi connect SSID-Name password wireless-password