HiKey:Quick Start

From BananaPro/Pi
Jump to: navigation, search

Other languages:
English

HiKey Quick Start Guide

By following this short quick start guide, we can use our HiKey in just a few minutes. There are three steps to boot our HiKey.

What we will need

MicroSD Card(Optional)
Minimum size 4Gb; class 4 (the class indicates how fast the card is).We recommend using branded SD cards as they are more reliable.

HDMI (Full sized – Type A) to HDMI/VGA cable
HDMI (Type A) to HDMI lead (for HD TVs and monitors with HDMI input).
Type A HDMI is 13.9 mm wide (check Wikipedia or Google for more info or look at the photos).

Keyboard and mouse(Optional)
Any standard USB keyboard and mouse should work.However, keyboards or mice that take a lot of power from the USB ports may need a powered USB hub.This may include some wireless devices.

DC Power supply
A good quality, 5.5*2.1mm DC power supply that can provide at least 2A at 12Vis essential.

Linux PC
Suggest install Vmware Workstation in the Windows PC, and install.Ubuntu or Fedora in the Vmware Workstation.

MicroUSB cable
Use for flashing OS for HiKey.
Jumper cap
Use for flashing OS for HiKey

1-19-1.png

Install Debian OS

In order to enjoy our HiKey, we will need to install an Operating System (OS) onto the SD card or the EMMC, we can install an Debian OS onto the SD card or the EMMC, but we only can install an Android OS onto the EMMC on the current release OS now. The instructions below will teach us how to write an OS image to the SD card or EMMC with the help of the Linux PC.

Download the OS image file:

EMMC boot: if we don’t insert an SD card which already had the Debian OS, HiKey will boot from EMMC.
SD boot: if we insert an SD card which already had Debian OS, HiKey will boot from SD card.

The differences between flashing EMMC and SD card:

We can download the OS image files from LeMaker Hikey Download and use the tool 7-Zip in Windows or the command 7za in Linux to extract the archive file. Windows
Install the 7-zip tool and then decompress and extract the archive file.
Linux

sudo apt-get install p7zip-full
7za x [imagefilename].7z

After extract the archive file, we will get these file.

Debian Android
flashing environment hisi-idt.py
l-loader.bin
hisi-idt.py
l-loader.bin
bootloader fip.bin
ptable-linux-8g.img
nvme.img
fip.bin
ptable-aosp-8g.img
nvme.img
kernel boot-fat.uefi.img boot-fat.uefi.img
file system hikey-jessie_alip_2015MMDD-nnn-8g.emmc.img
hikey-jessie_alip_2015MMDD-nnn.img
cache.img
system.img
userdata-8g.img

Note: Debian SD card image only one file(hikey-jessie_alip_2015MMDD-nnn.img), because if SD card boot, Debian OS will run bootloader amd kernel from EMMC, mount file system from SD card.

Prepare all the hardware and software for flashing:

Step 1: Install Ubuntu OS(e.g. Ubuntu 14.04 LTS) in PC, you can get a lot of methods from the Internet.
Step 2: Install fastboot in the Linux PC.
I. We will also need the fastboot application installed on the Linux PC.If this is not installed use the following command:

sudo apt-get install android-tools-fastboot      // On Debian/Ubuntu
sudo yum install android-tools                         //On Fedora

Note:if install failed, please add following deb into /etc/apt/sources.list:

deb http://archive.ubuntu.com/ubuntu trusty universe restricted main multiverse.

II. Create the file: /etc/udev/rules.d/51-android.rules. We need the superuser privileges , so we will use the command below to open the file:.

$ sudo vim /etc/udev/rules.d/51-android.rules 
#or you can execute the below command to instead the above.
$ sudo gedit /etc/udev/rules.d/51-android.rules

Then add the following content to the file.

# fastboot protocol on HiKey
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="d00d", MODE="0660", GROUP="dialout"
# adb protocol on HiKey
SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", ATTR{idProduct}=="1057", MODE="0660", GROUP="dialout"
# rndis for HiKey
SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", ATTR{idProduct}=="1050", MODE="0660", GROUP="dialout"

Step 3: We will also need a standard microUSB cable connected between the HiKey microUSB connector and the Linux PC, close Jumper1 and Jumper2, power up the HiKey board to prepare for flashing.
1-4-1.png
Step 4: Check up the flashing environment:
I. Download relevant files onto a Linux PC from the link below: http://www.lemaker.org/product-hikey-download-48.html
II. We have to execute the command below to extract Android For Hikey.7z file.

sudo apt-get install p7zip-full
7z e Android For Hikey.7z

We can get the following files.

hisi-idt.py
l-loader.bin

III. Check that the HiKey board has been recognized by your Linux PC.
Please note that: the Ubuntu must be version 14.04, if not, which can not identify the node .

ls /dev/USB*

We assume the /dev/ttyUSB0 is the tty port for communication with the HiKey board.
1-5-1.png
IV. Run the command and the script to initially prepare fastboot:

sudo apt-get install python2.7 python2.7-dev
alias python=python2.7
sudo python hisi-idt.py -d /dev/ttyUSB0 --img1=l-loader.bin

It will display the fllowing subtitle on your Ubuntu,if you execute the above command successfully.
1-6-1.png

Install Debian OS

Hikey boot sequence and condition on Debian:

EMMC boot: if we don’t insert an SD card which already had the Debian OS, HiKey will boot from EMMC.
SD boot: if we insert an SD card which already had Debian OS, HiKey will boot from SD card.

The differences between flashing EMMC and SD card on Debian:

Flashing EMMC sudo fastboot flash system hikey-jessie_alip_2015MMDD-nnn-8g.emmc.img (e.g. 8G board)
Flashing SD card sudo dd if=hikey-jessie_alip_2015MMDD-nnn.img of=/dev/sdb bs=4M oflag=sync status=noxfer

After we downloading the OS image file and extracting it, we need to use the following files

Flashing EMMC

Step 1: Flashing bootloader.(In general case, bootloader have been installed into HiKey board, so we do not need to install)
I. Download the following files onto a Linux PC from the link below:http://www.lemaker.org/product-hikey-download-45.html

Debian For Hikey EMMC.7z

Then extract the .7z file.

sudo apt-get install p7zip-full
7z e Debian For Hikey EMMC.7z

II. Power on the HiKey board and verify communications from the Linux PC, run the command “sudo fastboot devices”. if show“0123456789abcdef fastboot”, it will be OK.
1-7.png
III. The following fastboot commands then load the partition table, the bootloaders and other necessary files into the HiKey eMMC flash memory.

$ sudo fastboot flash ptable ptable-linux-8g.img
$ sudo fastboot flash fastboot fip.bin
$ sudo fastboot flash nvme nvme.img

It will displays the fllowing caption on your Ubuntu,if you execute the above command successfully.
1-8.png
IV. Once this has been completed the bootloader has been installed into eMMC.
Step 2: Flashing kernel image. Execute the following commands will flash the kernel images.

sudo fastboot flash boot boot-fat.uefi.img

It will display the fllowing subtitle on your Ubuntu,if you execute the above command successfully. 1-10.png
Step 3: Flashing file system into the EMMC.
III. The following commands will burn the file system images.

sudo fastboot flash system hikey-jessie_alip_2015MMDD-nnn-8g.emmc.img

It will display the fllowing subtitle on your Ubuntu,if you execute the above command successfully. 1-11.png
Until now, we have updated the OS into EMMC. Open the Jumper2,connect HiKey and display device by HDMI,power on, then it will boot the Debian OS from EMMC.

Flashing SD Card

Flashing SD Card on Ubuntu

The step 1 and step 2 for flashing SD card are the same as flashing EMMC . Because we must install the bootloader and kernel in the EMMC, we just can move the file system into the SD card.
Step 1: Flashing bootloader: the same as the EMMC flashing process.
Step 2: Flashing kernel image: the same as the EMMC flashing process.
Step 3: Flashing file system into the SD Card:
I. Format the SD Card.
II. Download the following files onto a Linux PC:http://www.lemaker.org/product-hikey-download-45.html ,and move to Linux PC.

Debian For Hikey SD.7z

III. The following command will extract the .gz file.

sudo apt-get install p7zip-full
7z e Debian For Hikey SD.7z

IV. Insert SD Card into Linux PC, using the command below to get SD card device node.

sudo fdisk

Hkikey -1.png
V. The following command will flash the file system images. We maybe need to change the SD device node according to the actual device node number in following command:

sudo dd if= hikey-jessie_alip_2015MMDD-nnn.img of=/dev/sdb bs=4M oflag=sync status=noxfer

It will display the fllowing subtitle on your Ubuntu,if you execute the above command successfully.
Hikey qiuck start.png
Until now, we have updated the OS into SD Card. Then we can pull out the SD Card from Linux PC. Open the Jumper2, insert therSD Card into the HiKey board,connect the HDMI display device, power on, then it will boot the Debian OS from SD Card.

Flashing SD Card on Windows

The step 1 and step 2 for flashing SD card are the same as flashing EMMC . Because we must install the bootloader and kernel in the EMMC, we just can move the file system into the SD card.
Step 1: Flashing bootloader: the same as the EMMC flashing process.
Step 2: Flashing kernel image: the same as the EMMC flashing process.
Step 3: Flashing file system into the SD Card.
I. Download the following files onto Linux PC:http://www.lemaker.org/product-hikey-download-45.html

Debian For Hikey SD.7z

II. The following command will extract the .gz file.

sudo apt-get install p7zip-full
7z e Debian For Hikey SD.7z

III. Move hikey-jessie_alip_2015MMDD-nnn.img file to the PC.
IV. Insert a MicroSD card into our computer or card reader. The size of the MicroSD card should be larger than the OS image size, Generally 4GB or greater.

Sandisk micro reader 8G.png

V. Format the MicroSD card
Download and install a MicroSD card format tool such as SDFormatter from http://mirror.lemaker.org/SDFormatter_v4.zip. Start the tool as Administrator, In the "Options" menu, set "FORMAT TYPE" option to QUICK, "FORMAT SIZE ADJUSTMENT" option to "ON". And then click “OK” to finish options setting and click “Format” to format the MicroSD card.

SDFormatter.png

Formatter Setting.png

VI. Write OS image into the MicroSD card
Download and install a tool that can wirte OS images into an MicroSD card such as Win32Diskimager from http://mirror.lemaker.org/Win32DiskImage_v0.9.5_install.zip. Start the tool as Administrator. Open the unzipped image file, and then click the “write” button to write the OS image into the MicroSD card. Wait patiently to successfully complete the writing.

HikeyshaoxieI.png

Install Android OS

Flashing EMMC

Step 1: Download the Android OS from link: http://www.lemaker.org/product-hikey-download-48.html , then copy to Linux PC.

Android For Hikey.7z

Then extract the Android For Hikey.7z file.

sudo apt-get install p7zip-full
7z e Android For Hikey.7z

Step 2: Flashing bootloader.(In general case, Debian bootloader have been installed into HiKey board, so we need to install)
I. After we downloading the OS image file and extracting it,we need to use the following files and copy them to Linux PC:

fip.bin
ptable-aosp-8g.img
nvme.img

II. Power on the HiKey board and verify communications from the Linux PC, run the command “sudo fastboot devices”. if show“0123456789abcdef fastboot”, it will be OK.
1-7.png
III. The following fastboot commands then load the partition table, the bootloaders and other necessary files into the HiKey eMMC flash memory.

$ sudo fastboot flash ptable ptable-aosp-8g.img
$ sudo fastboot flash fastboot fip.bin
$ sudo fastboot flash nvme nvme.img

1-8.png
IV. Once this has been completed the bootloader has been installed into eMMC. Step 2: Flashing kernel image. I. After we downloading the OS image file and extracting it,we need to use the following files and copy them to Linux PC:

boot-fat.uefi.img

2) Power on the HiKey board and verify communications from the Linux PC, run the command “sudo fastboot devices”. if show“0123456789abcdef fastboot”, it will be OK. 1-7.png

Shut down HiKey

We can use the GUI to shut down the Hikey safely.Also we can run the command in the terminal to shut down the HIkey:

sudo halt
#You can execute the below command to instead the above command
sudo shutdown –h now.