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-ccimx8xsbcpro2GB-<variant>.imx
. See U-Boot files by variant to select the appropriate file for your hardware variant. -
partition-table.img
-
dtbo-imx8qxp.img
-
boot.img
-
vendor_boot.img
-
vbmeta-imx8qxp.img
-
super.img
These image files can be:
-
Development images located inside the
out/target/product/ccimx8xsbcpro
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 USB serial cable to the CONSOLE connector on the board and to your host computer.
-
Connect a USB type-C cable to your development PC and the other end to the target USB type-C 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-r2.2 (Jan 18 2021 - 15:54:04 +0000) Normal Boot Trying to boot from MMC1 Primary set selected Load image from MMC/SD 0x5f400 U-Boot dub-2020.04-r2.2 (Jan 18 2021 - 15:54:04 +0000) CPU: NXP i.MX8QXP RevB A35 at 1200 MHz at 25C DRAM: 2 GiB MCA: HW_VER=1 FW_VER=1.01 MMC: FSL_SDHC: 0, FSL_SDHC: 1 In: serial Out: serial Err: serial Model: Digi International ConnectCore 8X SBC Pro Board. ConnectCore 8X SOM variant 0x02: 2 GiB LPDDR4, Wi-Fi, Bluetooth, MCA, Crypto-auth Board version 3, ID 135 Boot: MMC0 BuildInfo: - SCFW 56682d58, SECO-FW 0e4b9cee, IMX-MKIMAGE 8da5cd23, ATF c949a88 - U-Boot dub-2020.04-r2.2 flash target is MMC:0 Net: eth0: ethernet@5b040000 [PRIME], eth1: ethernet@5b050000 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 1
-
-
On your development computer, execute the following command to update the U-Boot image:
$ fastboot flash bootloader u-boot-ccimx8xsbcpro2GB-<variant>.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 1
-
-
Update the Android firmware images.
While developing, new images are in your
out/target/product/ccimx8xsbcpro
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-imx8qxp.img $ fastboot flash dtbo_b dtbo-imx8qxp.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-imx8qxp.img $ fastboot flash vbmeta_b vbmeta-imx8qxp.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
-
-
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.