Overview Before you begin Run Ubuntu Linux on the HiKey 960 Build an Ubuntu filesystem Flash the base firmware and OS Flash the base firmware and OS - recovery mode Flash the base firmware and OS - fastboot mode Boot Linux Add more diskspace MNIST Draw MNIST Draw - Setup MNIST Draw - Machine Learning model MNIST Draw - MNIST demo application Streamline Streamline - Run the MNIST inference Streamline - Use Streamline to connect and profile the application Streamline - Automate the launch and capture Next steps
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