Is there a basic guide to installing Linux on Hikey960?


#1

I have been looking through posts for several days and I can’t seem to find a good guide of some kind on how I can install Linux on the HiKey960. What I have found so far is a bit beyond my experience as I have never worked with these boards or similar hardware. I was hoping that someone would be able to point me in the direction of a good guide to help me in this process.


Commands on HIkey960 board
Error when Installing LInux on the Hikey960 board
#2

If you want to run Linux on Hikey960, I suggest you to try flashing one of the RPB(yocto) snapshots in a first time. They are available here: http://snapshots.linaro.org/reference-platform/embedded/.
There is no official guide, but the flashing is pretty the same as for AOSP. If this is the first time you flash your board then you will need to flash firmware/bootloader/UEFI. You can follow these steps on a Linux machine (Ubuntu):

Download Images

Download the rootfs and boot images.

wget http://snapshots.linaro.org/reference-platform/embedded/morty/hikey960/latest/rpb/rpb-desktop-image-hikey960-*.rootfs.img.gz && gunzip rpb-desktop-image-hikey960-*.rootfs.img.gz
wget http://snapshots.linaro.org/reference-platform/embedded/morty/hikey960/latest/rpb/boot*.uefi.img

Download firmwares/bootloaders (first RPB flash only).

wget http://snapshots.linaro.org/reference-platform/embedded/morty/hikey960/latest/rpb/bootloader/config
wget http://snapshots.linaro.org/reference-platform/embedded/morty/hikey960/latest/rpb/bootloader/fip.bin
wget http://snapshots.linaro.org/reference-platform/embedded/morty/hikey960/latest/rpb/bootloader/hikey_idt
wget http://snapshots.linaro.org/reference-platform/embedded/morty/hikey960/latest/rpb/bootloader/sec_uce_boot.img
wget http://snapshots.linaro.org/reference-platform/embedded/morty/hikey960/latest/rpb/bootloader/sec_usb_xloader.img
wget http://snapshots.linaro.org/reference-platform/embedded/morty/hikey960/latest/rpb/bootloader/sec_xloader.img
wget http://snapshots.linaro.org/reference-platform/embedded/morty/hikey960/latest/rpb/bootloader/l-loader.bin
wget http://snapshots.linaro.org/reference-platform/embedded/morty/hikey960/latest/rpb/bootloader/prm_ptable.img

Boot board in recovery mode

Configure board dip switch for recovery mode (ON - ON - OFF). Power on your boad, a ttyUSBx device should be enumerated (e.g. /dev/ttyUSB0).

Flash RAM with recovery binaries
chmod +x hikey_idt
sudo ./hikey_idt -c config -p /dev/ttyUSB0

Once complete, your board switches into fastboot mode. Do not unplug the power.

Flash UFS

partition table
fastboot flash ptable prm_ptable.img
Firmware/bootloader
fastboot flash xloader sec_xloader.img
fastboot flash fastboot l-loader.bin
fastboot flash fip fip.bin
UEFI (fastboot/grub efi apps)
fastboot flash boot boot*.uefi.img
ROOTFS
fastboot flash system rpb-desktop-image-hikey960-*.rootfs.img

Power off your board and reconfigure dip switch for normal operation (ON - OFF - OFF). Your board should now boot on Linux RPB. For any further RPB update, you can only download and flash the rootfs image.


Linux on HiKey 960
Installing Linux on Hikey960
Containers on Hikey960 board
#4

Hello,
I have tried the same steps but for fastboot steps, I had to power off the device and turn it on in fastboot mode, since it was showing
After all he steps, I connected the hmdi cable but the board just doesnt turn on in normal mode


#5

My board is not turning on at all. Kindly help


#6

It would be good to have the serial console output to see what happens. Do the LEDs remain off ? did you try with a different screen ?


#7

Yes I tried connecting the HDMI cable to a monitor, but for some reason the LED remains off even in normal boot option, i.e (On,Off,Off).


Linux support issue on hikey 960
#8

How do I see what went wrong and the error messages ? Is serial console output different from the hdmi cable connected to the monitor ?


#9

You can use UART adapter (e.g. https://www.96boards.org/product/uartserial/) to get serial output. Bootloader and Linux kernel will write information during boot, including initialization steps and errors… This will allow you to find at which step your board fails to boot.


#10

So using this, you can connect to the laptop and it will give all the boot loading information while the flash-boot is being performed? Correct me if I’m wrong.


#11

Correct! Also, once device will be successfully booted, you will get a Linux console via this serial, useful when hdmi does not work as expected.


#12

Personally, I prefer the sensor mezzanine board for this, since its got the same USB-UART built in, as well as being a pretty flexible interfacing board. For an extra $5, its, IMO, a no-brainer.


#13

Hello !

I’m also trying to install linux on a Hikey960 but for some reason i can’t. I’ve followed some tutorials but i can’t seem to make it work…

I have installed boot--18.img and rootfs--18.img found there : http://snapshots.linaro.org/96boards/hikey/linaro/debian/latest/ .
During the installation, everything seemed to work perfectly but when i try to normal boot the board (with switches on ON-OFF-OFF), I get no HDMI output.
However, I can see, through the UART console (via minicom), that it has booted (Iget the line “root@linaro-developer:~#”) but i can’t type anything in this console… :frowning:

Does this mean that it’s ‘just’ my HDMI display the issue here if so how can I fix it ? And why can’t I use the UART console (I can however use it before the debian boot, in the GRUB with no problem…) ?

Thx for your help ! :slight_smile:


#14

For UART console, please check if you have turned off “Hardware Flow Control” in minicom.

Regarding HDMI, kernel image as part of Debian doesn’t have the drivers enabled. You can use custom kernel using following steps:

Use https://github.com/96boards-hikey/tools-images-hikey960/blob/master/build-from-source/README-build-from-source.md2 to build kernel image.

You will get “Image.gz” after compilation which should be used to replace /boot/vmlinuz-4.15-hikey image.

And for device tree, you will get hi3660-hikey960.dtb image. Place this image in “/boot/” directory. Reboot and press “e” when you get GRUB menu. Just add following line in the configuration:

devicetree /boot/hi3660-hikey960.dtb


#15

Thanks for your answer !

In minicom, I have hardware flow control on ON and software flow control on OFF. I tried oth of them on ON and/or OFF but it doesn’t change anything

This may be a dumb question but how can I access the /boot directory from my host PC ? Via the USB used to flash the images ? It’s possible to mount /dev/ttyUSB1 ?


#16

@Delgankar Since default UART-1 console port on LS expansion header doesn’t carry flow control signals, you need to turn OFF both Hardware and Software flow control in minicom.

Then you should be able to type into the console.

Thanks,
Mani


#17

hi Mani
Thanks for your answer but even when both hard and soft flow control are turned off, I can’t type into the console…

Before the boot, everything works well ; I can select the boot mode, edit commands, …
But as soon as I boot on Debian, I can’t type into the console.

When Debian is booted, I have a white blinking cursor which stops blinking whenever I type but nothing else happens.
I tried the ‘ls’ and ‘pwd’ commands but still nothing.

I feel like once booted, I can’t communicate through the UART and must use a keyboard plugged directly on one of the USB port but I’m not even sure there are drivers for those port. And if there are, I don’t have HDMI output so I can’t see what happens…


#18

Hi @Delgankar,

Can you please share the boot log with us? Please use somethings like, pastebin.

Thanks,
Mani


#19

here’s my boot log : https://pastebin.com/zM856gg5

(I don’t know if it’s useful but the 1 and 4 User leds are ON ; every other is OFF)


#20

Looking at your boot log reveals that the CPU’s are not brought up properly! Have you updated your firmware with latest one? If not then I would encourage you to do so. You can see the instructions in below doc:

Please flash base firmware, ATF+UEFI and boot+rootfs images.

PS: The LED behaviours are normal! LED1 should blink at heartbeat rate and LED4 should be ON.

Thanks,
Mani


#21

thanks for you help Mani.

I did follow those instruction before loading the Debian images.
I did it again and got those logs when executing “./recovery-flash.sh /dev/ttyUSB1” :
https://pastebin.com/VeTvyxKC (host logs)
https://pastebin.com/TjrnzK8W (UART logs)

now I can’t boot at all (UART logs : https://pastebin.com/s299rAN2 and remains stuck at “usbloader: bootmode is 4”) ; I’m guessing it’s because the firmware update erased the Debian Image…