Flash the base firmware and OS

Fastboot mode

Now that the HiKey 960 board is flashed with the basic boot code, the next step is to flash the remaining images including the bootloader, the Linux kernel and the file system. To do this, power off the board, move the switches to Fastboot mode, as shown in the preceding table, and power the board back on.

In the host machine, confirm the board is visible with fastboot, as you can see in this code:

$ sudo fastboot devices
447786182000000        fastboot

Before the HiKey board can be flashed, the correct images and setup scripts must be in the same directory. In the previous step, the script fastboot.sh and two Linux images, boot.img and dts.img, were copied from flash-images/ to the tools-images-hikey960/ directory. The system.simg file, generated in the first step, also needs to be copied into the tools-images-hikey960/ directory. Copy the file system image using:

$ cp ../build-ubuntu/ubuntu/system.simg .

In summary, the Linux-related images in the tools-images-hikey960 directory are:

  • boot.img
  • dts.img
  • system.simg

In the tools-images-hikey960/ directory, run the fastboot.sh script: $ ./fastboot.sh

This code shows the contents of the fastboot.sh. The script should flash all the images.

#!/bin/bash -e

DEVICE=$1
IMG_FOLDER=${PWD}

# partition table
sudo fastboot flash ptable ${IMG_FOLDER}/hisi-ptable.img

# bootloader
sudo fastboot flash xloader ${IMG_FOLDER}/hisi-sec_xloader.img
sudo fastboot flash fastboot ${IMG_FOLDER}/hisi-fastboot.img

# extra images
sudo fastboot flash nvme   ${IMG_FOLDER}/hisi-nvme.img
sudo fastboot flash fw_lpm3   ${IMG_FOLDER}/hisi-lpm3.img
sudo fastboot flash trustfirmware   ${IMG_FOLDER}/hisi-bl31.bin

# linux kernel and file system
sudo fastboot flash boot boot.img
sudo fastboot flash dts dts.img
sudo fastboot flash system system.simg
Previous Next