Commit bf259892 authored by Dorota Czaplejewicz's avatar Dorota Czaplejewicz

devkit: Add reflashing instructions

parent c3823d17
......@@ -62,88 +62,51 @@ After a moment, the orange Ethernet light should start blinking. Soon, the vibra
Note: the HDMI display will not be used by the dev kit even if plugged.
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.
Flashing eMMC
-------------
2. ~30 seconds after boot a new device will appear at ``/dev/ttyACM0`` -- this
is a serial console to the development board.
The main purpose of the image included on the eMMC is factory testing, therefore it's strongly recommended to flash an up-to-date one immediately.
If your PC cannot provide the necessary power you may need a USB 3 powered hub
between the host and the development board.
Downloading image files
~~~~~~~~~~~~~~~~~~~~~~~
Alternate Configuration #2 - USB C Host
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For that, you will need the files from the `librem5-devkit-tools`_ repository.
In this configuration, USB host mode is used to allow keyboard, mouse and flash
memory sticks to be connected to the development board.
Check it out, and download the necessary files:
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.
scripts/fetch_latest.sh -xk
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.
The script will fetch about 1GiB of data into the ``files`` directory, and decompress some of it, taking about 5GiB in total.
Install uuu
-----------
.. There is apparently a Debian package for this.
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``:
or is otherwise "bricked".
::
git clone https://github.com/NXPmicro/mfgtools
cd mfgtools
cmake ./
make
sudo make install
.. There is apparently a Debian package for this.
Using the Convenient Script
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Build By Hand
^^^^^^^^^^^^^
Alternatively, you can use this script from the `librem5-devkit-tools`_
repository to build and install ``uuu``:
If you're not using ``uuu`` included in your favorite distribution, build it manually:
::
scripts/build_uuu.sh -i
git clone https://source.puri.sm/Librem5/mfgtools
mkdir mfgtools-build
cd mfgtools-build
cmake ../mfgtools
make
The ``uuu`` binary will find itself in ``mfgtools-build/uuu/uuu``.
Udev Rules
----------
^^^^^^^^^^
If you want to run ``uuu`` as non-root add the following udev rules
We recommend running ``uuu`` as an unprivileged user. Issue the following commands as root to make the dev kit accessible to your user over USB whenever it's connected:
.. code:: bash
......@@ -155,37 +118,82 @@ If you want to run ``uuu`` as non-root add the following udev rules
ATTR{idVendor}=="0525", ATTR{idProduct}=="b4a4", GROUP+="plugdev", TAG+="uaccess"
LABEL="librem5_devkit_rules_end"
EOF
sudo udevadm control -R
sudo adduser <youruser> plugdev
udevadm control -R
adduser <youruser> plugdev
and then, to log in to the new group:
.. code:: bash
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.
Next time you plug in the USB cable, devkit's USB interface will be accessible by your user.
Note:
You may need to create the ``plugdev`` group with ``groupadd`` if you're not using Debian.
.. _imx8_devkit_flash_test_image:
Flash the Test Image
--------------------
Flash the Image
---------------
The eMMC that gets flashed is ``files/devkit-test.img``. Put the "Boot
Mode" switch in the USB position.
Put the "Boot Mode" switch in the USB position. Attach the development board to a USB C or USB 3 port on the host that is capable of providing 900mA of current. The HID device should appear when using the ``lsusb`` command. Now you can proceed with the flashing.
**This will erase everything on your eMMC:**
::
scripts/get_image.sh
sudo uuu uuu_scripts/flash_librem5-devkiti-test.lst
cd librem5-devkit-tools
export PATH=$PATH:/path-to-your-workspace/mfgtools-build/uuu/
uuu librem5-devkit-tools/uuu_scripts/flash_librem5-devkit-test.lst
Download Target Binaries
~~~~~~~~~~~~~~~~~~~~~~~~
Note:
You can manually download or build the required binaries. There is also
a convenience script to download pre-built binaries from the Purism
servers.::
If your PC cannot provide the necessary power you may need a USB 3 powered hub
between the host and the development board.
scripts/fetch_latest.sh -xk
Reboot
------
Flip the boot switch back to eMMC position and press the reboot button. The dev kit serial console should appear at ``/dev/ttyACM0``.
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 #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.
Flash u-boot
------------
......@@ -206,23 +214,6 @@ 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
-------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment