Fastboot is a protocol for communication between your device and a computer. It allows you to modify file system images over a USB connection, which is a quick way to update firmware during development. Fastboot requires the USB interface to work as 'device'.
Once you have generated the images, you can use them to update your Android system from U-Boot. This process is recommended to:
-
Test and evaluate changes and/or new features during the development phase (see Build your development images).
-
Flash final release images already signed with your own private keys in the manufacturing process (see Generate release custom images).
If your device is not booting U-Boot see Recover your device. |
Follow these steps to update eMMC partitions:
1. Set up your computer
To use fastboot on your development computer, install the fastboot
tool and add the udev
rules in your system.
-
Install the
fastboot
tool.The
fastboot
tool is generated atout/host/linux-x86/bin/fastboot
in the development machine when building the Android images (see Build your development images). To avoid building full images to get this tool, you can:-
Build it with:
$ make fastboot
-
Use an external
fastboot
tool. Go to https://developer.android.com/studio/releases/platform-tools.
-
-
Add a
udev
rule for the USB.User must be part of the
plugdev
group to usefastboot
. Create a new/etc/udev/rules.d/51-android.rules
file with the following contents:/etc/udev/rules.d/51-android.rulesSUBSYSTEM=="usb", ATTR{idVendor}=="0525", ATTRS{idProduct}=="a4a5", MODE="0666", GROUP="plugdev"
-
Reload and trigger the
udev
rules.Reboot your system or well reload the
udev
rules without rebooting your PC with the following commands:$ sudo udevadm control --reload $ sudo udevadm trigger
2. Obtain the firmware image files
The list of files built by Digi Embedded for Android is:
-
u-boot-ccimx8mmdvk.imx
. See U-Boot files by variant to select the appropriate file for your hardware variant. -
partition-table.img
-
dtbo-imx8mm.img
-
boot.img
-
vendor_boot.img
-
vbmeta-imx8mm.img
-
super.img
These image files can be:
-
Development images located inside the
out/target/product/ccimx8mmdvk
directory after building the development firmware. See Build your development images for more information about building the Android system. -
Production images, already signed with your release keys. See Generate release custom images.
-
Digi pre-built images, which you can download from:
3. Establish a serial connection with your device
-
Connect a microAB USB cable (not included) to the USB CONSOLE connector on the board and to your host computer.
-
Connect a micro USB cable to your development PC and the other end to the target USB recovery connector. See Step 2 - Set up the hardware for instructions.
-
Open a serial connection with the device. You can use any serial terminal program such as Tera Term, Minicom, CoolTerm, or HyperTerminal.
PuTTY terminal program is not recommended due to an incompatibility with the USB/serial driver. Open a serial connection with the following settings:
Parameter Value Port
Serial port where the device is connected
Baud rate
115200
Data bits
8
Parity
None
Stop bits
1
Flow control
None
4. Update firmware with fastboot
You can program the Android system of your device with fastboot
.
It updates all device partitions and then reboots the device.
-
Reset the device (press the Reset button on the board) and immediately press a key in the serial terminal to stop the auto-boot process. You will be stopped at the U-Boot bootloader prompt:
U-Boot SPL dub-2020.04-r3.1-git-00114-g909871f6fff7-dirty (Feb 11 2021 - 16:54:47 +0100) DDRINFO: start DRAM init DDRINFO: DRAM rate 3000MTS DDRINFO:ddrphy calibration done DDRINFO: ddrmix config done Normal Boot Trying to boot from MMC2 U-Boot dub-2020.04-r3.1-git-00114-g909871f6fff7-dirty (Feb 11 2021 - 16:54:47 +0100) CPU: i.MX8MMQ rev1.0 1600 MHz (running at 1200 MHz) CPU: Industrial temperature grade (-40C to 105C) at 32C Reset cause: POR DRAM: 2 GiB MCA: HW_VER=1 FW_VER=1.00 MMC: FSL_SDHC: 1, FSL_SDHC: 0 In: serial Out: serial Err: serial Model: Digi ConnectCore 8M Mini Development Kit ConnectCore 8M Mini SOM variant 0x03: 2 GiB LPDDR4, Wi-Fi, Bluetooth, MCA, Crypto-auth Board version 3, ID undefined Boot: MMC2 BuildInfo: - ATF a7f57f3 - U-Boot dub-2020.04-r3.1-git-00114-g909871f6fff7-dirty flash target is MMC:0 Net: eth0: ethernet@30be0000 Fastboot: Normal Normal Boot Hit any key to stop autoboot: 0 =>
-
Update the U-Boot image (optional):
-
Enter U-Boot fastboot mode:
-
Unlock fastboot:
=> env set skip-fblock-check yes
-
Start the fastboot mode in U-Boot:
=> fastboot 0
-
-
On your development computer, execute the following command to update the U-Boot image:
$ fastboot flash bootloader u-boot-ccimx8mmdvk.imx
-
Configure the partition of the eMMC to hold Android images by executing the following command on your development computer:
$ fastboot flash gpt <partition-table.img>
-
Reset the board to boot into the recently updated U-Boot, and press any key to stop the autoboot process.
-
Reset the U-Boot environment to default values. (This will not reset protected variables like the MAC address). To do so, issue this command:
=> env default -a
-
Save the U-Boot environment to apply the default configuration.
=> env save
-
-
Enter U-Boot fastboot mode:
-
Unlock fastboot:
=> env set skip-fblock-check yes => env save
Digi recommends to remove skip-fblock-check
U-Boot variable once the program process finishes. -
Start the fastboot mode in U-Boot:
=> fastboot 0
-
-
Update the Android firmware images.
While developing, new images are in your
out/target/product/ccimx8mmdvk
directory after a build. You can program them in the device by issuingfastboot
in your development computer:$ fastboot --slot all flashall
The
-w
option wipes userdata.$ fastboot -w --slot all flashall
-
Program individual partitions one by one with the command:
$ fastboot flash <partition_name> <path_to_pre-built-image>
$ fastboot flash dtbo_a dtbo-imx8mm.img $ fastboot flash dtbo_b dtbo-imx8mm.img $ fastboot flash boot_a boot.img $ fastboot flash boot_b boot.img $ fastboot flash vendor_boot_a vendor_boot.img $ fastboot flash vendor_boot_b vendor_boot.img $ fastboot flash vbmeta_a vbmeta-imx8mm.img $ fastboot flash vbmeta_b vbmeta-imx8mm.img $ fastboot flash super super.img
-
You can wipe userdata with:
$ fastboot -w
If you already have signed images (see Generate release custom images), you can load them with the following command:
$ fastboot update signed-img.zip
-
-
After flashing boot, dtbo, vbmeta, and vendor_boot partitions, the target is rebooted into fastboot. While fastboot is waiting in your host computer, remove the micro USB cable from the target USB recovery connector, and connect it to the USB Host connector (next to the microSD socket) of the board.
-
If required, reboot the device using fastboot.
$ fastboot reboot
The first Android boot takes several minutes due to system deployment. |
For more information, see the fastboot
readme file at https://source.codeaurora.org/external/imx/aosp/platform/system/core/tree/fastboot/README.md?h=android-11.0.0_1.0.0.