Hikey960 Wiki

Getting Started

Hardware Required:

../_images/hardware-requirements-1.jpg ../_images/hardware-requirement-2.jpg

Software Required:

  1. android-tools-fastboot

To install the software run the following command:

sudo apt-get install android-tools-fastboot

Flashing the image

Step 1: Boot into fastboot mode by keeping the switches in the position mentioned below:

Switch Position
Switch 1 ON
Switch 2 OFF
Switch 3 ON
Switch 4 OFF

Note: If the switches are not in correct order then fastboot will not work. Giving error message “<waiting for device>”

Step 2: Untar the Linux Image

1
2
  $ unzip Hikey960-shunya-console-image-0.1.zip
  $ cd Hikey960-shunya-console-image-0.1

Step 3: Connecting Cables

Connect USB Type C cable to the host and board(next to the HDMI) and make sure it is configured as ttyUSB0. Connect 12V@2A Power Adapter.

Confirm if the cables are connected correctly using dmesg command USB Type C should now be connected to ttyUSB0

Sample dmesg Log:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
     [ 7402.694006] usb 1-1.2: New USB device found, idVendor=18d1,idProduct=d00d
     [ 7402.694010] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
     [ 7402.694012] usb 1-1.2: Product: HiKey960
     [ 7402.694014] usb 1-1.2: Manufacturer: 96Boards
     [ 7402.694016] usb 1-1.2: SerialNumber: 5EA41CC0223F215
     [ 7516.698997] usb 1-1.2: USB disconnect, device number 4
     [11514.627430] usb 2-1.1: USB disconnect, device number 3
     [12112.700336] usb 2-1.2: new full-speed USB device number 4 using ehci-pci
     [12112.818364] usb 2-1.2: New USB device found, idVendor=12d1, idProduct=3609
     [12112.818368] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
     [12112.818370] usb 2-1.2: Product: USB SER
     [12112.818372] usb 2-1.2: Manufacturer: HISILICON
     [12114.530788] usbcore: registered new interface driver usbserial
     [12114.530843] usbcore: registered new interface driver usbserial_generic
     [12114.530890] usbserial: USB Serial support registered for generic
     [12114.625738] usbcore: registered new interface driver option
     [12114.625783] usbserial: USB Serial support registered for GSM modem (1-port)
     [12114.625922] option 2-1.2:1.0: GSM modem (1-port) converter detected
     [12114.628070] usb 2-1.2: GSM modem (1-port) converter now attached to ttyUSB0

Step 4: Install binaries on the Hikey960 board. This may take about 2-3 minutes

$ ./flash-minimum-binaries.sh

Step 5:Boot your newly installed Linux OS

Remove the power supply and keep the switches in the autoboot mode as follows:

Switch Position
Switch 1 ON
Switch 2 OFF
Switch 3 OFF
Switch 4 OFF
../_images/hikey970-autoboot-switches.jpg

Remove USB Type C cable (important)

Connect HDMI cable.

Connect the Power Adapter

Warning

Plug the HDMI cable before powering up. HDMI hot plug may not work.

Note

Congratulations! You are now booting your newly installed Shunya OS directly from UFS on Hikey960!

Login details

For user shunya the login details are:

Username: shunya
Password: shunya

For the root user the login details are:

Username: root
Password: toor

Networking

Network Devices available:

  • Wifi
  • Bluetooth

Using a Camera on Hikey960

Using GStreamer

To record a video in the avi format use the following command

gst-launch-1.0 v4l2src ! avimux ! filesink location=filename.avi -e

To record a video in the mkv format use the following command

gst-launch-1.0 -e v4l2src ! videoconvert ! matroskamux ! filesink location=filename.mkv

Note

Device number might change so be careful.

Using FFMPEG

To install ffmpeg use the following command:

sudo apt install ffmpeg

To check the index of the USB use v4l-utils.You can install it and get the index using the commands below:

sudo apt install v4l-utils
v4l2-ctl --list-devices

To record a video using ffmpeg the following command can be used:

ffmpeg -i /dev/video0 filename.avi

OR

ffmpeg -f v4l2 -video_size 640x480 -i /dev/video0 -c:v libx264 filename.mp4

Sound on Hikey960

Sound recording and playback is tested using a USB Mic and a Speaker connected to USB Sound Adapter.

Note

Device and card numbers might change so be careful.

Sound Recording

To list the recording devices you can use this command:

arecord -l

To record a wav file you can use the following command:

arecord -vv -Dplughw:0,0 -f dat filename.wav

Sound Playback

To list the playback devices use this command:

aplay -l

To playback a wav file you can use the following command:

aplay -vv --device=hw:0,0 filename.wav

OpenCV on Hikey960

Release info

Shunya O/s Version: 0.1-Beta

Kernel Version: 4.14

Bootloader: GRUB

Bootloader Version: UEFI + GNU GRUB 2.02

Desktop Environment: XFCE