Linux on HiKey 960

yes

verify your device node (/dev/ttyUSBx)

there are 2 usb connections from the board to your pc:
1 for serial/telnet console (usually /dev/ttyUSB0)
1 for ‘data’ - microUSB type C (usually /dev/ttyUSB1, used in hikey_idt command)

you’re using /dev/ttyUSB0 for both
they should not be the same

1 Like

okay so your uart is at ttyUSB0, nect connect the usb c of the hikey 960 to the host system, it should show up as /dev/ttyUSB1 in demsg. then sudo ./hikey_idt -c config -p /dev/ttyUSB1

Press ESCAPE for boot options UfsExecScsiCmds() fails with Target Failure
UfsExecScsiCmds() fails with Target Failure
UfsExecScsiCmds() fails with Target Failure
UfsExecScsiCmds() fails with Target Failure
…[Bds]Booting Android Fastboot
add-symbol-file /work/wangjie/hikey960_linux/edk2/Build/HiKey960/DEBUG_GCC5/AARCH64/EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp/DEBUG/AndroidFastbootApp.dll 0xBA1E3000
Loading driver at 0x000BA1E2000 EntryPoint=0x000BA1E3000 AndroidFastbootApp.efi
Android Fastboot mode - version 0.6.
Press RETURN or SPACE key to quit.

Does the error affect the burn?

then, i used this command
$sudo fastboot flash ptable ptable.img

Fastboot platform: check for partition-type:ptable
Downloading 200704 bytes
**200704 / 200704 bytes downloaded (100%)
****Flashing partition ptable
****Fastboot platform: No GPT on flash. Fastboot on Versatile Express does not support MBR.
Warning: Failed to read partitions from Android NVM device (status: Device Error)
Done.

now what should i do?

seem to be flashing the wrong file
sudo fastboot flash ptable prm_ptable.img

but int the linkhttps://github.com/96boards-hikey/tools-images-hikey960
there is no prm_ptable.img but a ptable.img

Press ESCAPE for boot options UfsExecScsiCmds() fails with Target Failure
UfsExecScsiCmds() fails with Target Failure
UfsExecScsiCmds() fails with Target Failure
UfsExecScsiCmds() fails with Target Failure
…[Bds]Booting Android Fastboot
add-symbol-file /work/wangjie/hikey960_linux/edk2/Build/HiKey960/DEBUG_GCC5/AARCH64/EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp/DEBUG/AndroidFastbootApp.dll 0xBA1E3000
Loading driver at 0x000BA1E2000 EntryPoint=0x000BA1E3000 AndroidFastbootApp.efi
Android Fastboot mode - version 0.6.
Press RETURN or SPACE key to quit.

Does the error affect the burn?Did you meet the problem after sudo ./hikey_idt -c config -p /dev/ttyUSB1

no the error does not effect the burn.

PTABLE=aosp-32g SECTOR_SIZE=4096 SGDISK=./sgdisk bash -x generate_ptable.sh
this command creates the prm_ptable.img
it could be in this directory ${BUILD_PATH}/l-loader

I’ve already succeeded. Thank you very much

It would be helpful for others too if you would kindly list out what the problem was and how you fixed it. Thanks!

yes,i will list them after, thanks for your help

Ok, I got the UART board, plugged it into the HiKey 960 and got some signs of life after telneting to 2004

From the instructions, it says:

Update images.
$sudo fastboot flash ptable prm_ptable.img
$sudo fastboot flash xloader sec_xloader.img
$sudo fastboot flash fastboot l-loader.bin
$sudo fastboot flash fip fip.bin
$sudo fastboot flash boot boot.img
$sudo fastboot flash cache cache.img
$sudo fastboot flash system system.img
$sudo fastboot flash userdata userdata.img

Question 1: Where is cache.img?
Question 2: Where is userdata.img?

Anyway, skipping cache.img and userdata.img. If I restart the board in fastmode, this is the output. Suggestions?

Thanks!

telnet localhost 2004
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.

ser2net port 2004 device /dev/ttyUSB0 [115200 N81] (Debian GNU/Linux)

hikey960 boarid:5301 xloader use UART6
scsysstat_value[0].
clear reset source
last_keypoint0,reboot_type0
secdbg not DCU.
SecDbgVer exit

xloader chipid is: 0x36600110, start at 400ms.
Build Date: Jun 1 2017, 16:54:45
[clock_init] ++
hi3660 [clk_setup]
[clock_init] –
storage type is UFS
ufs retry: 6 count v_tx:0 v_rx:0
ufs set v_tx:0 v_rx:0
Hikey960[5301] no need avs_init.
ddr ft:0xf20332a3,mode:1 target:4
UceLdOk
ch 0 gt_errfail, STATUS:0x00000060
ch 0 gdst_errfail, STATUS:0x00000040
ch 1 gt_errfail, STATUS:0x00000060
ch 1 gdst_errfail, STATUS:0x00000040
ch 2 gt_errfail, STATUS:0x00000060
ch 2 gdst_errfail, STATUS:0x00000040
ch 3 gt_errfail, STATUS:0x00000060
ch 3 gdst_errfail, STATUS:0x00000040
timeout
timeout
timeout
timeout
density: 0x0c0c0c0c,0x00000000,0x0c0c0c0c,0x00000000,0x0c0c0c0c,0x00000000,0x0c0c0c0c,0x00000000
ddr info 0x00000306
400M
685M
1067M
C0R,V0x0000002c e:193
C1R,V0x0000002d e:66
C2R,V0x0000002c e:66
C3R,V0x0000002c e:66
C0R,V0x0000002d e:66
C1R,V0x0000002e e:66
C2R,V0x0000002d e:66
C3R,V0x0000002d e:66
C0R,V0x0000002e e:66
C1R,V0x0000002f e:66
C2R,V0x0000002e e:66
C3R,V0x0000002e e:66
C0R,V0x0000002f e:65
C1R,V0x00000030 e:65
C2R,V0x0000002f e:66
C3R,V0x0000002f e:66
1244M
1866M
C1R,V0x00000016 e:193
C0R,V0x00000017 e:66
C1R,V0x00000017 e:66
C2R,V0x00000017 e:66
C3R,V0x00000017 e:66
iomcu_subsys_init
boot_c0 PROFILE 4
slave0 irq0:0x00000014
slave1 irq0:0x00000004
NOTICE: Booting Trusted Firmware
NOTICE: BL1: v1.3(release):
NOTICE: BL1: Built : 00:09:44, Jul 5 2017
ERROR: Failed to load BL2 firmware.

Never mind. Problem solved! I was not adding l-loader.bin to the config file as explained in the instructions.

I can log in now

Cheers!

@ric96 , I am following the instructions in:

Even after setting export AARCH64_TOOLCHAIN=GCC49, I am getting the error:

Attaching the script i am using:

{{{
#!/bin/sh

BUILD_OPTION=DEBUG

export AARCH64_TOOLCHAIN=GCC49

export UEFI_TOOLS_DIR=${BUILD_PATH}/uefi-tools

export EDK2_DIR=${BUILD_PATH}/edk2

EDK2_OUTPUT_DIR=${EDK2_DIR}/Build/HiKey960/${BUILD_OPTION}_${AARCH64_TOOLCHAIN}

cd ${EDK2_DIR}

Build UEFI & ARM Trust Firmware

${UEFI_TOOLS_DIR}/uefi-build.sh -b ${BUILD_OPTION} -a …/arm-trusted-firmware hikey960

Generate l-loader.bin

cd ${BUILD_PATH}/l-loader

ln -sf ${EDK2_OUTPUT_DIR}/FV/bl1.bin

ln -sf ${EDK2_OUTPUT_DIR}/FV/fip.bin

ln -sf ${EDK2_OUTPUT_DIR}/FV/BL33_AP_UEFI.fd

python gen_loader_hikey960.py -o l-loader.bin --img_bl1=bl1.bin --img_ns_bl1u=BL33_AP_UEFI.fd
}}}

After setting: export AARCH64_TOOLCHAIN=GCC49

{{{

OK
make[1]: Leaving directory ‘/home/rakshith/Projects/UEFI-source/edk2/BaseTools/Tests’
make: Leaving directory ‘/home/rakshith/Projects/UEFI-source/edk2/BaseTools’
Target: AARCH64
Build: X64
Building Hikey960 - AARCH64
CROSS_COMPILE=“aarch64-linux-gnu-”
hikey960_BUILDFLAGS=’ -D FIRMWARE_VER=9d69f68’
TOOLCHAIN is GCC5
Toolchain prefix: GCC5_AARCH64_PREFIX=aarch64-linux-gnu-
Build environment: Linux-4.4.0-21-generic-x86_64-with-Ubuntu-16.04-xenial
Build start time: 15:25:16, Jul.17 2017

build: : warning: Tool chain [GCC5] is not defined

build.py…
: error 4000: Not available
[GCC5] not defined. No toolchain available for build!

  • Failed -
    Build end time: 15:25:17, Jul.17 2017
    Build total time: 00:00:00

                                     Hikey960 DEBUG	fail

pass 0
fail 1
python: can’t open file ‘gen_loader_hikey960.py’: [Errno 2] No such file or directory
rakshith@patkar007:~/Projects/UEFI-source/edk2$
}}}

- Installed gcc version:
{{{
rakshith@patkar007:~/Projects/UEFI-source/edk2$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

rakshith@patkar007:~/Projects/UEFI-source/edk2$
}}}

Any help?

@rakshithpatkar As answered in Cannot build Hikey Fw from source - #18 by vchong.

when i run ‘sudo ./hikey_idt -c config -p /dev/ttyUSB1’ and press hotkey ‘f’ in the console,then the console output the flowing message:
Press ESCAPE for boot options UfsExecScsiCmds() fails with Target Failure
UfsExecScsiCmds() fails with Target Failure
UfsExecScsiCmds() fails with Target Failure
UfsExecScsiCmds() fails with Target Failure
…[Bds]Booting Android Fastboot
add-symbol-file /home/icebaby/96board/download2/edk2/Build/HiKey960/DEBUG_GCC5/AARCH64/EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp/DEBUG/AndroidFastbootApp.dll 0xBA1E3000
Loading driver at 0x000BA1E2000 EntryPoint=0x000BA1E3000 AndroidFastbootApp.efi
Fastboot platform: No GPT on flash. Fastboot on Versatile Express does not support MBR.
Warning: Failed to read partitions from Android NVM device (status: Device Error)
Android Fastboot mode - version 0.6.
Press RETURN or SPACE key to quit.

Maybe there are some errors??
like bellow:
Fastboot platform: No GPT on flash. Fastboot on Versatile Express does not support MBR.
Warning: Failed to read partitions from Android NVM device (status: Device Error)
why??
thank you.

that seems fine, it just booted into android fast boot, now you should flash boot and system images from open embedded builds
http://builds.96boards.org/snapshots/reference-platform/openembedded/morty/hikey960/rpb/

Hello,

FYI, I’ve successfully updated my hikey960 (with build 77), however there was a pitfall - It seems build 78 and 79 were corrupted. Both rootfs images have no kernel image and dtb, so the size of rootfs image becomes smaller (e.g. console image: 110MB@77 → 100MB@78) and it failed to boot. (btw, there is also NO modules–* files)
One odd thing is the build system reported it as “done” instead of failure.

already been reported and is being worked on https://bugs.96boards.org/show_bug.cgi?id=562

Reported as fixed:
George Grey 2017-08-04 07:47:40 UTC

Loaded Snapshots OE Build84 and boots successfully. Thanks all.

new home for oe builds
http://snapshots.linaro.org/reference-platform/embedded/morty/hikey960/latest/rpb/