imx8.rst 5.76 KB
Newer Older
1 2
.. _imx8_devkit:

3 4
Librem 5 Development Kit
========================
5 6 7

.. note:: This page is incomplete and is being revised.

8 9
The scripts mentioned on this page can be obtained from the `librem5-devkit-tools`_
repository.
10

11 12
If you experience problems with the development kit, you may find it useful to
consult the :ref:`imx8_devkit_troubleshooting` guide.
13

14
.. _`librem5-devkit-tools`: https://source.puri.sm/Librem5/librem5-devkit-tools
15

16 17 18 19 20 21 22 23 24
.. Sections to add:
   What's in the box
   plugging in via USB-C (power adaptor vs. hub),
   connecting via ssh, connecting HDMI, mouse, keyboard
   900mA supply
   Host mode, hub, no serial out
   Device mode, serial
   USB 2 to USB 3 hub to USB-C devkit
   FTDI cables USB-to-serial
25

26
.. contents::
27

28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
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.

62 63
Power on/off
------------
64

65 66 67
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.
68

69 70
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.
71

72 73 74 75
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.
76

77 78
Install uuu
-----------
79

80
.. There is apparently a Debian package for this.
81

82 83
By Hand
~~~~~~~
84

85 86
The NXP mfgtool ``uuu`` is required to boot a board that has no bootloader
or is otherwise "bricked". Either download, build and install ``uuu``:
87

88
::
89

90 91 92 93 94
   git clone https://github.com/NXPmicro/mfgtools
   cd mfgtools
   cmake ./
   make
   sudo make install
95

96 97
Using the Convenient Script
~~~~~~~~~~~~~~~~~~~~~~~~~~~
98

99 100
Alternatively, you can use this script from the `librem5-devkit-tools`_
repository to build and install ``uuu``:
101 102 103

::

104
   scripts/build_uuu.sh -i
105

106 107
Udev Rules
----------
108

109
If you want to run ``uuu`` as non-root add the following udev rules
110 111 112

.. code:: bash

113 114 115 116 117 118 119 120 121 122 123
   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
124

125 126 127
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.
128

129
.. _imx8_devkit_flash_test_image:
130

131 132
Flash the Test Image
--------------------
133

134 135
The eMMC that gets flashed is ``files/devkit-test.img``. Put the "Boot
Mode" switch in the USB position.
136

137
**This will erase everything on your eMMC:**
138 139 140

::

141 142
   scripts/get_image.sh
   sudo uuu uuu_scripts/flash_librem5-devkiti-test.lst
143 144

Download Target Binaries
145
~~~~~~~~~~~~~~~~~~~~~~~~
146 147 148

You can manually download or build the required binaries. There is also
a convenience script to download pre-built binaries from the Purism
149
servers.::
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194

   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-1:

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
~~~~~~~~~

195
The panel is a Rockchip JH057N00900 (5.7", TFT 720x1440 Pixels) using a
196
ST7703 IC.
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220

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