Android Image Flashing / Burning

From Variscite Wiki
Revision as of 22:20, 31 December 2018 by Admin (talk | contribs) (→‎Flash and boot Android from SD card)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Boot options

Boot options of the Android:
1. Directly from SD card
2. U-Boot boots from NAND flash, and the rest of the Android images from on-SOM eMMC (when available)

After successfull build, the image are generated as per build

Images created by the Android build for Variscite MX6 system

Path: out/target/product/var_mx6/

Image
Description
system.img Android system image file.
SOM agnostics.
u-boot-var-imx6-nand.img U-Boot for nand used in eMMC boot.
SOM agnostics.
u-boot-var-imx6-sd.img U-Boot for SD card boot.
SOM agnostics.
boot-<name>-<touch>.img
recovery-<name>-<touch>.img
<name> is one of: som-mx6q - Supports VAR-SOM-MX6Q and VAR-SOM-MX6D
som-mx6dl - Supports VAR-SOM-MX6DL and VAR-SOM-MX6S
som-solo - Supports VAR-SOM-SOLO and VAR-SOM-DUAL
<touch> - is "r" or "c" r = resistive touch display
c = capacitive touch dispaly
Setup Name
Images Names
SOM type
Carrier Board type
LCD Type
Evaluation Kit name
som-mx6qp-c boot-som-mx6qp-c.img,
recovery-som-mx6qp-c.img
VAR-SOM-MX6_V2 (Quad Plus) VAR-MX6CustomBoard Capacitive touch VAR-DVK-MX6_V2-PRO,
VAR-STK-MX6_V2
som-mx6qp-r boot-som-mx6qp-r.img,
recovery-som-mx6qp-r.img
VAR-SOM-MX6_V2 (Quad Plus) VAR-MX6CustomBoard Resistive touch VAR-DVK-MX6_V2,
VAR-STK-MX6_V2
som-mx6qp-vsc boot-som-mx6qp-vsc.img,
recovery-som-mx6qp-vsc.img
VAR-SOM-MX6_V2 (Quad Plus) VAR-SOLOCustomBoard Capacitive LVDS touch N/A
som-mx6q-c boot-som-mx6q-c.img,
recovery-som-mx6q-c.img
VAR-SOM-MX6_V2 (Quad / Dual) VAR-MX6CustomBoard Capacitive touch VAR-DVK-MX6_V2-PRO,
VAR-STK-MX6_V2
som-mx6q-r boot-som-mx6q-r.img,
recovery-som-mx6q-r.img
VAR-SOM-MX6_V2 (Quad / Dual) VAR-MX6CustomBoard Resistive touch VAR-DVK-MX6_V2,
VAR-STK-MX6_V2
som-mx6q-vsc boot-som-mx6q-vsc.img,
recovery-som-mx6q-vsc.img
VAR-SOM-MX6_V2 (Quad / Dual) VAR-SOLOCustomBoard Capacitive LVDS touch N/A
som-mx6dl-c boot-som-mx6dl-c.img,
recovery-som-mx6dl-c.img
VAR-SOM-MX6_V2 (DualLite/ Solo) VAR-MX6CustomBoard Capacitive touch N/A
som-mx6dl-r boot-som-mx6dl-r.img,
recovery-som-mx6dl-r.img
VAR-SOM-MX6_V2 (DualLite/ Solo) VAR-MX6CustomBoard Resistive touch N/A
som-solo-vsc boot-som-solo-vsc.img,
recovery-som-solo-vsc.img
VAR-SOM-SOLO / VAR-SOM-DUAL VAR-SOLOCustomBoard Capacitive LVDS touch VAR-DVK-SOLO/DUAL,
VAR-STK-SOLO/DUAL
som-solo-c boot-som-solo-c.img,
recovery-som-solo-c.img
VAR-SOM-SOLO / VAR-SOM-DUAL VAR-MX6CustomBoard Capacitive touch N/A
imx6q-var-dart boot-imx6q-var-dart.img,
recovery-imx6q-var-dart.img
DART-MX6 VAR-DT6CustomBoard Capacitive touch VAR-STK-DT6,
VAR-DVK-DT6

Flash and boot Android from SD card

Create a bootable SD card

Partition and format SD card, and copy all images

$ sudo ./var-mksdcard.sh -f SETUP_NAME /dev/sdX;sync
  • Replace SETUP_NAME with the actual desired setup name accrding to the second table in the "images created" section.
  • Replace /dev/sdX with your true device, You can identify it with dmesg.

Boot From SD card

  • Power-off the board.
  • Insert the SD card into the SD card slot of the carrier board (DVK)
  • Make sure the Boot Mode is set to SD card: see Setting the Boot Mode section
  • Power up the board - it will boot into Linux from the SD card


Flash and boot Android from eMMC

eMMC based system consist of:

  1. SPL and U-Boot on NAND flash
  2. Rest of Android images in eMMC

Preparing images

All Android built images but system.img are ready for flashing out of the default build.

The default system.img format is suitable for flashing using fastboot, and must be modified for flashing using 'dd'.

$ cd out/target/product/var_mx6
$ simg2img system.img system_raw.img


Make sure you built Android for eMMC

Flashing Android from Linux shell (when the primary installation android)

An example of flashing eMMC, can be found here.

Follow the following steps instructions above:

1. Preparing a rescue SD card;

2. Flash from command line (use the install_android.sh script)


Further, follow the steps described in paragraph "Flashing Android with USB Fastboot"

Flashing Android with USB Fastboot

Install tools on host

$ sudo apt-get install android-tools-adb android-tools-fastboot

Note: Make sure you built Android for eMMC
Connect the target with host PC at fastboot mode:

  1. Connect a USB OTG cable from the target board OTG port to a your host machine USB HOST port.
  2. Power up the board and hit return/space to stop the boot at U-Boot.
  3. type fastboot usb0 in the U-Boot command line.

On the Host PC:

$ sudo `which fastboot` flash boot out/target/product/var_mx6/boot-SETUP_NAME.img
$ sudo `which fastboot` flash recovery out/target/product/var_mx6/recovery-SETUP_NAME.img
$ sudo `which fastboot` flash system out/target/product/var_mx6/system.img
$ sudo `which fastboot` reboot

Replace SETUP_NAME with the actual desired setup name accrding to the second table in the "images created" section.

Android recovery mode

Enter board in Android Recovery mode

Turn on the device by holding down the "back" button must be held until the end of the boot and logged in "Android Recovery" mode.

Control menu in Android Recovery Mode

  1. To switch between menu items, use a short press of any button (except RESET) or a short touch touchscreen;
  2. To select an item, use long press any button (except RESET) or long touch the touchscreen;

Update Android firmware

Generate OTA packages For generating "OTA" packages, use the following commands:

$ cd /
# if Android for SD card
$ make -j4 BUILD_TARGET_DEVICE=sd otapackage 2>&1 | tee build1-1.log
# if Android for eMMC
$ make -j4 BUILD_TARGET_DEVICE=emmc otapackage 2>&1 | tee build1-1.log

Install OTA package to device

  1. Enter to Android Recovery mode
  2. Select menu item "apply update from ADB"
  3. To the host system, perform the following command:
    $ out/host/linux-x86/bin/adb sideload out/target/product/var_mx6/var_mx6-ota-<data>-<image-id>.zip
  4. reboot this device

Note: Real example name for OTA package: out/target/product/var_mx6/var_mx6-ota-20160331-som-mx6q-c.zip