Can't flash the Android 7 update.img

I synced the Android 7 code, and built it as the guide described, got the update.img, but when I tried to flash the update.img using the USB burnning tools, it failed at 4%, the result string is:

[0x10302001] RomCode/状态切换/等待设备插入/设备枚举异常

And the u-boot revision is 35f4e9d3cb336ccf89d94d551d2bc4ca704f74f0:

$ git show
commit 35f4e9d3cb336ccf89d94d551d2bc4ca704f74f0
Author: terry <terry@szwesion.com>
Date:   Thu Apr 13 19:31:31 2017 +0800

    fixup! vim_check: add for Vim product only

diff --git a/board/khadas/configs/kvim.h b/board/khadas/configs/kvim.h
index bb7aa98..b59558e 100644
--- a/board/khadas/configs/kvim.h
+++ b/board/khadas/configs/kvim.h
@@ -226,7 +226,7 @@
             "\0"\
         "vim_check="\
             "saradc open 1;"\
-            "if saradc get_in_range 0x1d0 0x220; then "\
+            "if saradc get_in_range 0x1a0 0x220; then "\
                 "echo Product checking: pass!;"\
             "else if saradc get_in_range 0x0 0x1cf; then "\
                 "echo Product checking: fail!; sleep 5; reboot;"\

From the last topic, I learned that this is cased by u-boot? If so, what revision should I use ?

Can you give me more log infomations?

Below is the USB burning Tools:

Here is the serial Log:

GXL:BL1:9ac50e:a1974b;FEAT:ADFC318C;POC:3;RCY:0;EMMC:0;READ:0;CHK:AA;SD:800;USB:8;0.0;
TE: 10437249

BL2 Built : 13:38:48, Mar  8 2017. 
gxl g8e12692 - xiaobo.gu@droid05

set vcck to 1120 mv
set vddee to 1000 mv
Board ID = 6
CPU clk: 1200MHz
BL2 USB 
DQS-corr enabled
DDR scramble enabled
DDR3 chl: Rank0+1 @ 768MHz - PASS
Rank0: 1024MB(auto)-2T-11
Rank1: 1024MB(auto)-2T-11
0.0;
TE: 10633697

BL2 Built : 13:38:48, Mar  8 2017. 
gxl g8e12692 - xiaobo.gu@droid05

set vcck to 1120 mv
set vddee to 1000 mv
Board ID = 6
CPU clk: 1200MHz
BL2 USB 
0.0;
TE: 10689668

BL2 Built : 13:38:48, Mar  8 2017. 
gxl g8e12692 - xiaobo.gu@droid05

set vcck to 1120 mv
set vddee to 1000 mv
Board ID = 6
CPU clk: 1200MHz
BL2 USB 
Load fip header from USB, src: 0x0000c000, des: 0x01400000, size: 0x00004000
New fip structure!
Load bl30 from USB, src: 0x00010000, des: 0x01100000, size: 0x0000d600
Load bl31 from USB, src: 0x00020000, des: 0x10100000, size: 0x0001b400
Load bl33 from USB, src: 0x0003c000, des: 0x01000000, size: 0x000b3a00
NOTICE:  BL3-1: v1.0(debug):866a5ea
NOTICE:  BL3-1: Built : 15:50:05, Feb 28 2017
[BL31]: GXL CPU setup!
aml log : bl31 normal boot !
mpu_config_enable:ok
[Image: gxl_v1.1.3194-db501b7 2017-03-28 15:06:09 yun.cai@droid06]
OPS=0x82
f5 a6 20 2 8d 56 ad 1d 39 78 e0 c [10.970583 Inits done]

=== PROCESS EXCEPTION: 04 ====== xPSR: 21000000 ===
r0 :00000001 r1 :1000b268 r2 :1000aedc r3 :1000aebc
r4 :00000000 r5 :00000000 r6 :00000000 r7 :00000000
r8 :00000000 r9 :00000000 r10:00000000 r11:00000000
r12:00000000 sp :1000d350 lr :1000a039 pc :1000a5ba
Data access violation, mfar = 1000aed8
mmfs = 82, shcsr = 70001, hfsr = 0, dfsr = 0

=========== Process Stack Contents ===========
1000d370: 00000000 00000000 00000000 10000ac9
1000d380: 00000000 00000000 00000000 00000000
1000d390: 00000000 00000000 00000000 00000000
1000d3a0: 00000000 00000000 00000000 00000000

GXL:BL1:9ac50e:a1974b;FEAT:ADFC318C;POC:3;RCY:0;EMMC:0;READ:0;CHK:AA;SD:800;USB:8;

The GCC is Linaro gcc 4.9:

export PATH=/opt/toolchains/gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux/bin:$PATH
$ aarch64-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=aarch64-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/opt/toolchains/gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux/bin/../libexec/gcc/aarch64-linux-gnu/4.9.2/lto-wrapper
Target: aarch64-linux-gnu
Configured with: /cbuild/slaves/oorts/crosstool-ng/builds/aarch64-linux-gnu-linux/.build/src/gcc-linaro-4.9-2014.09/configure --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu --target=aarch64-linux-gnu --prefix=/cbuild/slaves/oorts/crosstool-ng/builds/aarch64-linux-gnu-linux/install --with-sysroot=/cbuild/slaves/oorts/crosstool-ng/builds/aarch64-linux-gnu-linux/install/aarch64-linux-gnu/libc --enable-languages=c,c++,fortran --disable-multilib --enable-multiarch --with-arch=armv8-a --with-pkgversion='crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09' --with-bugurl=https://bugs.launchpad.net/gcc-linaro --enable-__cxa_atexit --disable-libmudflap --enable-libgomp --disable-libssp --with-gmp=/cbuild/slaves/oorts/crosstool-ng/builds/aarch64-linux-gnu-linux/.build/aarch64-linux-gnu/build/static --with-mpfr=/cbuild/slaves/oorts/crosstool-ng/builds/aarch64-linux-gnu-linux/.build/aarch64-linux-gnu/build/static --with-mpc=/cbuild/slaves/oorts/crosstool-ng/builds/aarch64-linux-gnu-linux/.build/aarch64-linux-gnu/build/static --with-isl=/cbuild/slaves/oorts/crosstool-ng/builds/aarch64-linux-gnu-linux/.build/aarch64-linux-gnu/build/static --with-cloog=/cbuild/slaves/oorts/crosstool-ng/builds/aarch64-linux-gnu-linux/.build/aarch64-linux-gnu/build/static --with-libelf=/cbuild/slaves/oorts/crosstool-ng/builds/aarch64-linux-gnu-linux/.build/aarch64-linux-gnu/build/static --enable-threads=posix --disable-libstdcxx-pch --enable-linker-build-id --enable-plugin --with-local-prefix=/cbuild/slaves/oorts/crosstool-ng/builds/aarch64-linux-gnu-linux/install/aarch64-linux-gnu/libc --enable-c99 --enable-long-long
Thread model: posix
gcc version 4.9.2 20140904 (prerelease) (crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09)

It maybe caused by power supply. You can try to Upgrade Via a Burnning TF Card with the same update image.
Also you should connect the TYPE-C port with DC adapter and not PC while updating the rom.

I don’t think the power supply is the cause. For I can flash the KVIM official Android image with power supplied by the same USB port in the same Windows PC. The only different is the Update.img, one is compiled by myself according to the Khadas Doc, one is downloaded from Khadas firmware page.

Besides, I have flash the Android 6 update.img compiled by myself successfully with same Windows PC at the same USB Port.

Still, I tried to use the SD Card to burn the image, and it get success. The log is :

GXL:BL1:9ac50e:a1974b;FEAT:ADFC318C;POC:3;RCY:0;EMMC:0;READ:0;0.0;CHK:0;
TE: 96186

BL2 Built : 13:38:48, Mar  8 2017. 
gxl g8e12692 - xiaobo.gu@droid05

set vcck to 1120 mv
set vddee to 1000 mv
Board ID = 6
CPU clk: 1200MHz
DQS-corr enabled
DDR scramble enabled
DDR3 chl: Rank0+1 @ 768MHz - PASS
Rank0: 1024MB(auto)-2T-11
Rank1: 1024MB(auto)-2T-11
DataBus test pass!
AddrBus test pass!
-s
Load fip header from eMMC, src: 0x0000c200, des: 0x01400000, size: 0x00004000
New fip structure!
Load bl30 from eMMC, src: 0x00010200, des: 0x01100000, size: 0x0000d600
Load bl31 from eMMC, src: 0x00020200, des: 0x10100000, size: 0x0001b400
Load bl33 from eMMC, src: 0x0003c200, des: 0x01000000, size: 0x000b3a00
GXL:BL1:9ac50e:a1974b;FEAT:ADFC318C;POC:0;RCY:0;USB:0;SPI:0;CHK:AA;EMMC:400;NAND:81;SD:0;READ:0;0.0;CHK:0;
no sdio debug board detected 
TE: 1795806

BL2 Built : 13:38:48, Mar  8 2017. 
gxl g8e12692 - xiaobo.gu@droid05

set vcck to 1120 mv
set vddee to 1000 mv
Board ID = 6
CPU clk: 1200MHz
DQS-corr enabled
DDR scramble enabled
DDR3 chl: Rank0+1 @ 768MHz - PASS
Rank0: 1024MB(auto)-2T-11
Rank1: 1024MB(auto)-2T-11
DataBus test pass!
AddrBus test pass!
Load fip header from SD, src: 0x0000c200, des: 0x01400000, size: 0x00004000
New fip structure!
Load bl30 from SD, src: 0x00010200, des: 0x01100000, size: 0x0000d600
Load bl31 from SD, src: 0x00020200, des: 0x10100000, size: 0x0001b400
Load bl33 from SD, src: 0x0003c200, des: 0x01000000, size: 0x000b4000
NOTICE:  BL3-1: v1.0(debug):866a5ea
NOTICE:  BL3-1: Built : 15:50:05, Feb 28 2017
[BL31]: GXL CPU setup!
aml log : bl31 normal boot !
mpu_config_enable:ok
[Image: gxl_v1.1.3194-db501b7 2017-03-28 15:06:09 yun.cai@droid06]
OPS=0x82
f5 a6 20 2 8d 56 ad 1d 39 78 e0 c [2.218718 Inits done]
secure task start!
high task start!
low task start!
INFO:    BL3-1: Initializing runtime services
WARNING: No OPTEE provided by BL2 boot loader
ERROR:   Error initializing runtime service opteed_fast
INFO:    BL3-1: Preparing for EL3 exit to normal world
INFO:    BL3-1: Next image address = 0x1000000
INFO:    BL3-1: Next image spsr = 0x3c9


U-Boot 2015.01-g35f4e9d (Apr 19 2017 - 19:03:15)

DRAM:  2 GiB
Relocation Offset is: 76ebd000
register usb cfg[0][1] = 0000000077f5ca38
[CANVAS]canvas init
vpu: error: vpu: check dts: FDT_ERR_BADMAGIC, load default parameters
vpu: clk_level = 7
vpu: set clk: 666667000Hz, readback: 666660000Hz(0x300)
vpp: vpp_init
boot_device_flag : 1
Nand PHY Ver:1.01.001.0006 (c) 2013 Amlogic Inc.
init bus_cycle=6, bus_timing=7, system=5.0ns
reset failed
get_chip_type and ret:fffffffe
get_chip_type and ret:fffffffe
chip detect failed and ret:fffffffe
nandphy_init failed and ret=0xfffffff1
MMC:   aml_priv->desc_buf = 0x0000000073ebd6b0
aml_priv->desc_buf = 0x0000000073ebf9d0
SDIO Port B: 0, SDIO Port C: 1
emmc/sd response timeout, cmd55, status=0x1ff2800
init_part() 278: PART_TYPE_DOS
[mmc_init] mmc init success
dtb magic edfe0dd0
start dts,buffer=0000000073ec2200,dt_addr=0000000073ec2200
parts: 10
00:      logo   0000000002000000 1
01:  recovery   0000000002000000 1
02:       rsv   0000000000800000 1
03:       tee   0000000000800000 1
04:     crypt   0000000002000000 1
05:      misc   0000000002000000 1
06:      boot   0000000002000000 1
07:    system   0000000080000000 1
08:     cache   0000000020000000 2
09:      data   ffffffffffffffff 4
_check_ptbl_mbr()-815: MBR is OK!
init_part() 278: PART_TYPE_DOS
eMMC/TSD partition table have been checked OK!
check pattern success
mmc env offset: 0x27400000 
In:    serial
Out:   serial
Err:   serial
reboot_mode=cold_boot
Unknown command 'cvbs' - try 'help'
hpd_state=1
set hdmitx VIC = 16
config HPLL = 2970000
HPLL: 0xc000027b
config HPLL done
j = 4  vid_clk_div = 1
hdmitx phy setting done
hdmitx: set enc for VIC: 16
rx version is 1.4 or below  div=10
hdmtix: set audio
[store]To run cmd[emmc dtb_read 0x1000000 0x40000]
_verify_dtb_checksum()-918: calc 7df5e5dd, store 7df5e5dd
_verify_dtb_checksum()-918: calc 7df5e5dd, store 7df5e5dd
dtb_read()-1040: total valid 2
dtb_read()-1107: do nothing
card in
init_part() 278: PART_TYPE_DOS
[mmc_init] mmc init success
Device: SDIO Port B
Manufacturer ID: 74
OEM: 4a60
Name: SD16G 
Tran Speed: 25000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 14.6 GiB
mmc clock: 25000000
Bus Width: 4-bit
[MSG]ini sz 0x249B
[fat]Filesize is 0x249B[0M]
[fat]0x:leftSz 249 < BPS 2000, gotSz 249

=========sdc_burn_paras=====>>>
[common]
erase_bootloader = 1
erase_flash      = 1
reboot           = 0x1
key_overwrite    = 0x0

[burn_ex]
package          = update.img
media            = 

[burn_parts]
burn_num         = 0

<<<<=====sdc_burn_paras======

[fat]Filesize is 0x3bcb4f78B[956M]
[fat]0x:leftSz c40 < BPS 2000, gotSz 6c40
[MSG]image version [0x00000002]
[MSG]cfg10=0xADFC318C
[fat]Seek 0xf2b00 from 0x6c40
[MSG]itemSizeNotAligned 0x1500
[MSG]align 4 mmc read...        [fat]0x:leftSz e30 < BPS 2000, gotSz a330
[MSG]Down(mem) part(dtb) sz(0xa330) fmt(normal)
[MSG]Burn Start...
[MSG]load dt.img to 0x0000000001000000, sz=0xa330
[MSG]Burn complete
Err imgread(L587):Logo header err.
[MSG]echo video prepare for upgrade
hpd_state=1
[OSD]load fb addr from dts
[OSD]fb_addr for logo: 0x7f851000
[OSD]load fb addr from dts
[OSD]fb_addr for logo: 0x7f851000
[CANVAS]addr=0x7f851000 width=3840, height=2160
set hdmitx VIC = 16
config HPLL = 2970000
HPLL: 0xc000027b
config HPLL done
j = 4  vid_clk_div = 1
hdmitx phy setting done
hdmitx: set enc for VIC: 16
rx version is 1.4 or below  div=10
hdmtix: set audio
[MSG]dw,dh[1920, 1080]
[MSG]w,h[4,14]
[MSG]Exit before re-init
command:        store  exit
dtb magic edfe0dd0
start dts,buffer=0000000001000000,dt_addr=0000000001000000
parts: 10
00:      logo   0000000002000000 1
01:  recovery   0000000002000000 1
02:       rsv   0000000000800000 1
03:       tee   0000000000800000 1
04:     crypt   0000000002000000 1
05:      misc   0000000002000000 1
06:      boot   0000000002000000 1
07:    system   0000000080000000 1
08:     cache   0000000020000000 2
09:      data   ffffffffffffffff 4
emmc/sd response timeout, cmd8, status=0x1ff2800
emmc/sd response timeout, cmd55, status=0x1ff2800
init_part() 278: PART_TYPE_DOS
[mmc_init] mmc init success
switch to partitions #0, OK
mmc1(part 0) is current device
Device: SDIO Port C
Manufacturer ID: 15
OEM: 100
Name: 8WPD3 
Tran Speed: 52000000
Rd Block Len: 512
MMC version 5.0
High Capacity: Yes
Capacity: 7.3 GiB
mmc clock: 40000000
Bus Width: 8-bit
[store]amlmmc erase 1emmckey_is_protected : protect
 start = 0,end = 57343


Caution! Your devices Erase group is 0x400
The erase range would be change to 0x36000~0xe8ffff

start = 221184,end = 15269886
[burn_parts]
burn_num         = 5
burn_part0       = _aml_dtb
burn_part1       = boot
burn_part2       = logo
burn_part3       = recovery
burn_part4       = system


[MSG]=====>To burn part [_aml_dtb]
[MSG]itemSizeNotAligned 0x1500
[MSG]Down(store) part(_aml_dtb) sz(0xa330) fmt(normal)
[MSG]totalSlotNum = 0, nextWriteBackSlot 1
[MSG]itemSizeNotAligned 0x1500
[fat]0x:leftSz e30 < BPS 2000, gotSz 8e30
[MSG]Burn Start...
[MSG]optimus_download_dtb_image:dataSzReceived=0xa330
start erase dtb......
start = 81920,end = 82943
dev # 1,  , several blocks erased OK
[store]To run cmd[emmc dtb_write 0x00000000076feb00 0x40000]
dtb_write()-1141: valid 2
dtb_write()-1161: new stamp 1, checksum 0x475dc552, version 1, magic A~D
dtb magic edfe0dd0
start dts,buffer=00000000076feb00,dt_addr=00000000076feb00
dtb magic edfe0dd0
start dts,buffer=00000000076feb00,dt_addr=00000000076feb00
parts: 10
00:      logo   0000000002000000 1
01:  recovery   0000000002000000 1
02:       rsv   0000000000800000 1
03:       tee   0000000000800000 1
04:     crypt   0000000002000000 1
05:      misc   0000000002000000 1
06:      boot   0000000002000000 1
07:    system   0000000080000000 1
08:     cache   0000000020000000 2
09:      data   ffffffffffffffff 4
_construct_ptbl_by_mbr()-738: invalid magic value: 0x0000
_cmp_iptbl()-577: partition count is not same 0:13
_check_ptbl_mbr()-815: MBR is Improper!
mmc_device_init()-1101: MBR Updated!
init_part() 278: PART_TYPE_DOS
partition table success
[MSG]Burn complete
[store]To run cmd[emmc dtb_read 0x0000000007700000 0x40000]
dtb_read_shortcut()-976: short cut in...
[MSG]VERIFY OK 

[MSG]=====>To burn part [boot]
[fat]Seek 0x1ed2b0 from 0xfce60
[MSG]itemSizeNotAligned 0xd50
[MSG]flash LOGIC partCap 0x2000000B
[MSG]Down(store) part(boot) sz(0x8a2000) fmt(normal)
[MSG]totalSlotNum = 0, nextWriteBackSlot 139
[MSG]itemSizeNotAligned 0xd50
[fat]0x:leftSz 12b0 < BPS 2000, gotSz 12b0
[MSG]Burn Start...
[MSG]Burn complete
[MSG]Verify Start...
[MSG]To verify part boot in fmt normal
[MSG]Verify End
[MSG]VERIFY OK 

[MSG]=====>To burn part [logo]
[fat]Seek 0xb7f310 from 0xa8f2e0
[MSG]itemSizeNotAligned 0xcf0
[MSG]flash LOGIC partCap 0x2000000B
[MSG]Down(store) part(logo) sz(0x11b5b0) fmt(normal)
[MSG]totalSlotNum = 0, nextWriteBackSlot 18
[MSG]itemSizeNotAligned 0xcf0
[fat]0x:leftSz 8c0 < BPS 2000, gotSz a8c0
[MSG]Burn Start...
[MSG]Burn complete
[MSG]Verify Start...
[MSG]To verify part logo in fmt normal
[MSG]Verify End
[MSG]VERIFY OK 

[MSG]=====>To burn part [recovery]
[fat]Seek 0xcaa8b8 from 0xc9a8f0
[MSG]itemSizeNotAligned 0x1748
[MSG]flash LOGIC partCap 0x2000000B
[MSG]Down(store) part(recovery) sz(0xcb9000) fmt(normal)
[MSG]totalSlotNum = 0, nextWriteBackSlot 204
[MSG]itemSizeNotAligned 0x1748
[fat]0x:leftSz 18b8 < BPS 2000, gotSz 78b8
[MSG]Burn Start...
[MSG]Burn complete
[MSG]Verify Start...
[MSG]To verify part recovery in fmt normal
[MSG]Verify End
[MSG]VERIFY OK 

[MSG]=====>To burn part [system]
[MSG]itemSizeNotAligned 0x718
[MSG]flash LOGIC partCap 0x80000000B
[MSG]Down(store) part(system) sz(0x3a351660) fmt(sparse)
[MSG]totalSlotNum = 0, nextWriteBackSlot 1024
[MSG]itemSizeNotAligned 0x718
[MSG]Burn Start...
[fat]0x:leftSz f48 < BPS 2000, gotSz f48
[MSG]Burn complete
Downloading %100
[MSG]Verify Start...
[MSG]To verify part system in fmt sparse
[MSG]Verify End
[MSG]VERIFY OK 

[MSG]=====>To burn part [bootloader]
[MSG]itemSizeNotAligned 0xd20
[MSG]Down(store) part(bootloader) sz(0xf0000) fmt(normal)
[MSG]totalSlotNum = 0, nextWriteBackSlot 15
[MSG]itemSizeNotAligned 0xd20
[fat]0x:leftSz 12e0 < BPS 2000, gotSz f2e0
[MSG]Burn Start...
mmc switch to boot0 success
mmc switch to boot1 success
mmc switch to user success
[MSG]align bootloader sz from 0xf0000 to 0x100000
[MSG]Burn complete
mmc switch to boot0 success
mmc switch to boot1 success
mmc switch to user success
[MSG]VERIFY OK 
## save_setting ##
[MSG]Set upgrade_step to 2
Saving Environment to aml-storage...
mmc env offset: 0x27400000 
Writing to MMC(1)... done
[MSG]to close image
[MSG]Reload bmps env.
[MSG]======sdc burn SUCCESS.
reboot mode: normal
INFO:    PSCI Affinity Map:
INFO:      AffInst: Level 0, MPID 0x0, State ON
INFO:      AffInst: Level 0, MPID 0x1, State OFF
INFO:      AffInst: Level 0, MPID 0x2, State OFF
INFO:      AffInst: Level 0, MPID 0x3, State OFF
bl31 reboot reason: 0xd
bl31 reboot reason: 0x1
system cmd  1.

When the update is finished, it reboot and still loops on reboot and reboot:

GXL:BL1:9ac50e:a1974b;FEAT:ADFC318C;POC:0;RCY:0;USB:0;SPI:0;CHK:AA;EMMC:0;READ:0;0.0;CHK:0;
TE: 180843

BL2 Built : 13:38:48, Mar  8 2017. 
gxl g8e12692 - xiaobo.gu@droid05

set vcck to 1120 mv
set vddee to 1000 mv
Board ID = 6
CPU clk: 1200MHz
DQS-corr enabled
DDR scramble enabled
DDR3 chl: Rank0+1 @ 768MHz - PASS
Rank0: 1024MB(auto)-2T-11
Rank1: 1024MB(auto)-2T-11
DataBus test pass!
AddrBus test pass!
-s
Load fip header from eMMC, src: 0x0000c200, des: 0x01400000, size: 0x00004000
New fip structure!
Load bl30 from eMMC, src: 0x00010200, des: 0x01100000, size: 0x0000d600
Load bl31 from eMMC, src: 0x00020200, des: 0x10100000, size: 0x0001b400
Load bl33 from eMMC, src: 0x0003c200, des: 0x01000000, size: 0x000b3a00
NOTICE:  BL3-1: v1.0(debug):866a5ea
NOTICE:  BL3-1: Built : 15:50:05, Feb 28 2017
[BL31]: GXL CPU setup!
aml log : bl31 normal boot !
mpu_config_enable:ok
[Image: gxl_v1.1.3194-db501b7 2017-03-28 15:06:09 yun.cai@droid06]
OPS=0x82
f5 a6 20 2 8d 56 ad 1d 39 78 e0 c [0.441742 Inits done]

=== PROCESS EXCEPTION: 04 ====== xPSR: 21000000 ===
r0 :00000001 r1 :1000b268 r2 :1000aedc r3 :1000aebc
r4 :00000000 r5 :00000000 r6 :00000000 r7 :00000000
r8 :00000000 r9 :00000000 r10:00000000 r11:00000000
r12:00000000 sp :1000d350 lr :1000a039 pc :1000a5ba
Data access violation, mfar = 1000aed8
mmfs = 82, shcsr = 70001, hfsr = 0, dfsr = 0

=========== Process Stack Contents ===========
1000d370: 00000000 00000000 00000000 10000ac9
1000d380: 00000000 00000000 00000000 00000000
1000d390: 00000000 00000000 00000000 00000000
1000d3a0: 00000000 00000000 00000000 00000000

GXL:BL1:9ac50e:a1974b;FEAT:ADFC318C;POC:0;RCY:0;USB:0;SPI:0;CHK:AA;EMMC:0;READ:0;0.0;CHK:0;
TE: 170300

BL2 Built : 13:38:48, Mar  8 2017. 
gxl g8e12692 - xiaobo.gu@droid05

set vcck to 1120 mv
set vddee to 1000 mv
Board ID = 6
CPU clk: 1200MHz
DQS-corr enabled
DDR scramble enabled
DDR3 chl: Rank0+1 @ 768MHz - PASS
Rank0: 1024MB(auto)-2T-11
Rank1: 1024MB(auto)-2T-11
DataBus test pass!
AddrBus test pass!
-s
Load fip header from eMMC, src: 0x0000c200, des: 0x01400000, size: 0x00004000
New fip structure!
Load bl30 from eMMC, src: 0x00010200, des: 0x01100000, size: 0x0000d600
Load bl31 from eMMC, src: 0x00020200, des: 0x10100000, size: 0x0001b400
Load bl33 from eMMC, src: 0x0003c200, des: 0x01000000, size: 0x000b3a00
NOTICE:  BL3-1: v1.0(debug):866a5ea
NOTICE:  BL3-1: Built : 15:50:05, Feb 28 2017
[BL31]: GXL CPU setup!
aml log : bl31 normal boot !
mpu_config_enable:ok
[Image: gxl_v1.1.3194-db501b7 2017-03-28 15:06:09 yun.cai@droid06]
OPS=0x82
f5 a6 20 2 8d 56 ad 1d 39 78 e0 c [0.431181 Inits done]

=== PROCESS EXCEPTION: 04 ====== xPSR: 21000000 ===
r0 :00000001 r1 :1000b268 r2 :1000aedc r3 :1000aebc
r4 :00000000 r5 :00000000 r6 :00000000 r7 :00000000
r8 :00000000 r9 :00000000 r10:00000000 r11:00000000
r12:00000000 sp :1000d350 lr :1000a039 pc :1000a5ba
Data access violation, mfar = 1000aed8
mmfs = 82, shcsr = 70001, hfsr = 0, dfsr = 0

=========== Process Stack Contents ===========
1000d370: 00000000 00000000 00000000 10000ac9
1000d380: 00000000 00000000 00000000 00000000
1000d390: 00000000 00000000 00000000 00000000
1000d3a0: 00000000 00000000 00000000 00000000

All the Android 7 code is synced just as the Khadas Doc described, the toolchain is what it implied. So what is the cause? And how can I get my Android 7 compiled by myself to work?

I worry that you don’t see the full content of 4h, especially the second part of failed log, so I add this reply here.
For the problem in 4h

You guys, any hints?

which version the gcc is?

terry@terry:~/work/vim/uboot$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.3' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3) 

GCC:

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.5-2ubuntu1~14.04.1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.5 (Ubuntu 4.8.5-2ubuntu1~14.04.1)

You can compile the u-boot using the gcc-linaro-aarch64-none-elf-4.8-2013.11_linux

$ xz -d gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
$ sudo tar -xvf gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar -C /opt/toolchains
$ cd <path-to-your-project>/uboot
$ make distclean 
$ make kvim_defconfig
$ make  -j4 CROSS_COMPILE=/opt/toolchains/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin/aarch64-none-elf- 

Have a try

I used you aarch64 4.8 none gcc, build and test, and yes, it’s working now.

But that’s weird, and makes me confused:

  1. The Host GCC version is only compile the host target, why the slit different of gcc version(4.8.4 VS 4.8.5) would make a big difference?

  2. Why ask me the Host GCC version firstly, then, tell me to change the cross toolchain? The toolchain is prebuilt ELF file, the host GCC should has nothing to do with the toolchain?

From my knowledge, the difference of ABI does matter: non-elf VS linux-elf, is this the cause?

  1. Should the Khadas wiki page modify the building of u-boot and Android ?

Can you offer some explain?