1These instructions will help you flashing the prebuilt bootloader
2and AOSP images(built from sources) on db845c.
3
4First, you wil need to have first built AOSP for the
5db845c-userdebug lunch target.
6
7
8Boot the board into fastboot mode:
9----------------------------------
10The easiest way to boot into fastboot mode is to run something
11like "adb reboot bootloader" from the host, or
12"reboot bootloader" on the device.  However, this
13functionality may depend on the software installed on the board
14to work, so you may need to manually enter fastboot mode as
15follows.
16
17
18To manually enter fastboot mode:
19--------------------------------
20* To manually boot the board into fastboot mode, press DOWN arrow
21  key over serial UART console when restarting the board.
22
23                         OR
24
25* Disconnect the power *and* USB-C cable. Flip the board over, and
26  while holding down the "VOL-" button plug in the power cable.
27  Continue holding down the "VOL-" button and tap the "ON/OFF"
28  button. The board should then boot to fastboot mode. Be sure to
29  then re-connect the USB-C cable so that you can flash the board.
30
31If HDMI is plugged in, you should see a text based
32"FastBoot Mode" prompt on your screen. Or you can check by running
33"fastboot devices" on your host which will print something like:
34
35  $ fastboot devices
36  c4e1189c        fastboot
37
38
39Flash the board:
40----------------
41Once the board is in fastboot mode, you can then flash it by
42running the following from the
43device/linaro/dragonboard/installer/db845c/ directory:
44
45  $ ./flash-all-aosp.sh <optional_kernel_binary>
46
47
48This will flash the bootloader binaries, AOSP images (userdata.img
49and super.img), and will also generate and flash boot.img if kernel
50binary (in Image.gz-dtb format) is passed to the script.
51
52
53Troubleshooting:
54----------------
55* Make sure the USB-C cable is connected. As it has to be
56  removed to fully power the device down, it is easy to forget
57  to reconnect it!
58
59* If you cannot get the board into fastboot mode, or for some
60  reason the flash-all-aosp.sh script does not work, you can do
61  a full recovery flash of the board using the following
62  instructions.
63
64
65Recovery:
66--------
67First boot into recovery mode. After removing the power cable
68and the USB-C cable, connect power while holding the "USB"
69button (next to volume buttons near the USB-A ports). While
70continuing to hold down the "USB" button, tap the "ON/OFF"
71button. Then re-connect USB-C cable. There will be no HDMI
72display output in recovery mode, and initially no serial output.
73
74Then run the recovery script from the
75device/linaro/dragonboard/installer/db845c/ directory:
76
77  $ ./recovery.sh
78
79This will do a recovery flash of the ptable and bootloader
80binaries. After it is finished, the board will reboot.
81
82Depending on the state of the board, it will enter fastboot
83or may boot to a previously installed kernel. At that point
84you may start again from the top of this document.
85