There are two documentation of building and installing AOSP on Hikey.
Official AOSP page:
The old image:
Please use the official AOSP page.
When connecting Hikey and the PC for flashing emmc from fastboot,
please remove all the USB devices from USB-Type-A connector (I normally remove HDMI cable too) and then connect between PC and HiKey with microUSB cable to the microUSB connector on the HiKey.
Then, check the jumper pins on J15, both 1-2 pin and 3-4 pins closed and 5-6 open.
Then, connect AC adapter and wait for about 30 seconds.
If you have LeMaker HiKey with 8G emmc version then,
$ sudo ./flash-all.sh /dev/ttyUSB0
if you have 4G emmc version then
$ sudo ./flash-all.sh /dev/ttyUSB0 4G
I hope this works for you.