SD boot fail on VIM3

Hi,
I follow https://docs.khadas.com/vim3/FenixScript.html to compile on ubuntu 1804 and got a image VIM3_Ubuntu-xfce-bionic_Linux-4.9_arm64_SD-USB_V0.8.4-20200527.img . Then dd image to sdcard , But always boot fail on uboot , error message as below,How to solve this problem?

.G12B:BL:6e7c85:2a3b91;FEAT:E0F83180:402000;POC:F;RCY:0;EMMC:0;READ:0;CHK:1F;READ:0;CHK:1F;READ:0;CHK:1F;SD?:0;SD:0;READ:0;0.�!,K��х��}��������с0x01
bl2_stage_init 0x81
hw id: 0x0000 - pwm id 0x01
bl2_stage_init 0xc1
bl2_stage_init 0x02

no sdio debug board detected
L0:00000000
L1:20000703
L2:00008067
L3:14000000
B2:00402000
B1:e0f83180

TE: 400457

BL2 Built : 15:22:05, Aug 28 2019. g12b g1bf2b53 - luan.yuan@droid15-sz

Board ID = 8
Set A53 clk to 24M
Set A73 clk to 24M
Set clk81 to 24M
A53 clk: 1200 MHz
A73 clk: 1200 MHz
CLK81: 166.6M
smccc: 00066426
DDR driver_vesion: LPDDR4_PHY_V_0_1_18 build time: Aug 28 2019 15:22:01
board id: 8
Load FIP HDR from SD, src: 0x00010200, des: 0xfffd0000, size: 0x00004000, part: 0
fw parse done
Load ddrfw from SD, src: 0x00060200, des: 0xfffd0000, size: 0x0000c000, part: 0
Load ddrfw from SD, src: 0x00038200, des: 0xfffd0000, size: 0x00004000, part: 0
PIEI prepare done
fastboot data load
fastboot data verify
verify result: 266
Cfg max: 4, cur: 1. Board id: 255. Force loop cfg
LPDDR4 probe
ddr clk to 1608MHz
Load ddrfw from SD, src: 0x0003c200, des: 0xfffd0000, size: 0x0000c000, part: 0

dmc_version 0001
Check phy result
INFO : End of CA training
INFO : End of initialization
INFO : Training has run successfully!
Check phy result
INFO : End of initialization
INFO : End of read enable training
INFO : End of fine write leveling
INFO : End of Write leveling coarse delay
INFO : Training has run successfully!
Check phy result
INFO : End of initialization
INFO : End of read dq deskew training
INFO : End of MPR read delay center optimization
INFO : End of write delay center optimization
INFO : End of read delay center optimization
INFO : End of max read latency training
INFO : Training has run successfully!
1D training succeed
Load ddrfw from SD, src: 0x00048200, des: 0xfffd0000, size: 0x0000c000, part: 0
Check phy result
INFO : End of initialization
INFO : End of 2D read delay Voltage center optimization
INFO : End of 2D read delay Voltage center optimization
INFO : End of 2D write delay Voltage center optimization
INFO : End of 2D write delay Voltage center optimization
INFO : Training has run successfully!

channel==0
RxClkDly_Margin_A0==67 ps 7
TxDqDly_Margin_A0==106 ps 11
RxClkDly_Margin_A1==87 ps 9
TxDqDly_Margin_A1==106 ps 11
TrainedVREFDQ_A0==26
TrainedVREFDQ_A1==26
VrefDac_Margin_A0==30
DeviceVref_Margin_A0==26
VrefDac_Margin_A1==28
DeviceVref_Margin_A1==26

channel==1
RxClkDly_Margin_A0==106 ps 11
TxDqDly_Margin_A0==106 ps 11
RxClkDly_Margin_A1==87 ps 9
TxDqDly_Margin_A1==106 ps 11
TrainedVREFDQ_A0==26
TrainedVREFDQ_A1==25
VrefDac_Margin_A0==25
DeviceVref_Margin_A0==25
VrefDac_Margin_A1==24
DeviceVref_Margin_A1==25

dwc_ddrphy_apb_wr((0<<20)|(2<<16)|(0<<12)|(0xb0):0004

soc_vref_reg_value 0x 00000029 00000028 00000027 00000028 00000027 00000027 00000027 00000029 00000029 00000026 00000026 00000026 00000028 00000027 004
2D training succeed
aml_ddr_fw_vesion: LPDDR4_PHY_V_0_1_18 build time: Aug 28 2019 13:54:19
auto size-- 65535DDR cs0 size: 2048MB
DDR cs1 size: 2048MB
DMC_DDR_CTRL: 00e00024DDR size: 3928MB
cs0 DataBus test pass
cs1 DataBus test pass
cs0 AddrBus test pass
cs1 AddrBus test pass

100bdlr_step_size ps== 414
result report
boot times 0Enable ddr reg access
Load FIP HDR from SD, src: 0x00010200, des: 0x01700000, size: 0x00004000, part: 0
Load BL3X from SD, src: 0x00078200, des: 0x01768000, size: 0x000d0000, part: 0
0.0;M3 CHK:0;cm4_sp_mode 0
MVN_1=0x00000000
MVN_2=0x00000000
[Image: g12b_v1.1.3390-6ac5299 2019-09-26 14:10:05 luan.yuan@droid15-sz]
OPS=0x10
ring efuse init
chipver efuse init
29 0b 10 00 01 21 13 00 00 0f 35 37 4d 4d 4e 50
[0.018961 Inits done]
secure task start!
high task start!
low task start!
run into bl31
NOTICE: BL31: v1.3(release):4fc40b1
NOTICE: BL31: Built : 15:58:17, May 22 2019
NOTICE: BL31: G12A normal boot!
NOTICE: BL31: BL33 decompress pass
ERROR: Error initializing runtime service opteed_fast

U-Boot 2015.01 (May 27 2020 - 13:58:15)

DRAM: 3.8 GiB
Relocation Offset is: d6e46000
spi_post_bind(spifc): req_seq = 0
register usb cfg[0][1] = 00000000d7f39d10
aml_i2c_init_port init regs for 0
MMC: aml_priv->desc_buf = 0x00000000d3e36a70
aml_priv->desc_buf = 0x00000000d3e38db0
SDIO Port B: 0, SDIO Port C: 1
co-phase 0x3, tx-dly 0, clock 400000
co-phase 0x3, tx-dly 0, clock 400000
co-phase 0x3, tx-dly 0, clock 400000
emmc/sd response timeout, cmd8, status=0x3ff2800
emmc/sd response timeout, cmd55, status=0x3ff2800
co-phase 0x3, tx-dly 0, clock 400000
co-phase 0x1, tx-dly 0, clock 40000000
aml_sd_retry_refix[983]:delay = 0x0,gadjust =0x2000
[mmc_startup] mmc refix success
init_part() 297: PART_TYPE_AML
[mmc_init] mmc init success
start dts,buffer=00000000d3e3b620,dt_addr=00000000d3e3b620
get_partition_from_dts() 91: ret 0
parts: 3
00: logo 0000000000800000 1
01: ramdisk 0000000002000000 1
02: rootfs ffffffffffffffff 4
init_part() 297: PART_TYPE_AML
eMMC/TSD partition table have been checked OK!
crc32_s:0x1577dad == storage crc_pattern:0x1577dad!!!
crc32_s:0xee152b83 == storage crc_pattern:0xee152b83!!!
crc32_s:0x79f50f07 == storage crc_pattern:0x79f50f07!!!
mmc env offset: 0x6c00000
In: serial
Out: serial
Err: serial
reboot_mode=cold_boot
[store]To run cmd[emmc dtb_read 0x1000000 0x40000]
_verify_dtb_checksum()-3477: calc ab083b0d, store ab083b0d
_verify_dtb_checksum()-3477: calc ab083b0d, store ab083b0d
dtb_read()-3694: total valid 2
update_old_dtb()-3675: do nothing
aml_i2c_init_port init regs for 0
fusb302_init: Device ID: 0x91

amlkey_init() enter!
[EFUSE_MSG]keynum is 1
vpu: clk_level in dts: 7
vpu: vpu_power_on
vpu: set clk: 666667000Hz, readback: 666666667Hz(0x100)
vpu: vpu_module_init_config
vpp: vpp_init
vpp: vpp osd2 matrix rgb2yuv…
cvbs: cpuid:0x29
LCD_RESET PIN: 0
lcd: detect mode: tablet, key_valid: 0
lcd: detect lcd_clk_path: 1
lcd: load config from dts
lcd: pinctrl_version: 2
lcd: use panel_type=lcd_0
lcd: bl: pinctrl_version: 2
lcd: bl: name: backlight_pwm, method: 1
lcd: bl: aml_bl_power_ctrl: 0
card in
co-phase 0x2, tx-dly 0, clock 400000
co-phase 0x2, tx-dly 0, clock 400000
co-phase 0x2, tx-dly 0, clock 400000
co-phase 0x2, tx-dly 0, clock 400000
co-phase 0x2, tx-dly 0, clock 40000000
aml_sd_retry_refix[983]:delay = 0x0,gadjust =0x2000
[mmc_startup] mmc refix success
init_part() 282: PART_TYPE_DOS
[mmc_init] mmc init success
Device: SDIO Port B
Manufacturer ID: 1
OEM: 5041
Name: SD64G
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 57.9 GiB
mmc clock: 40000000
Bus Width: 4-bit
Net: dwmac.ff3f0000
amlkey_init() enter!
amlkey_init() 71: already init!
[EFUSE_MSG]keynum is 1
MACADDR:02:00:00:13:21:01(from chipid)

upgrade_step=0
reboot_mode:::: cold_boot

amlkey_init() enter!
amlkey_init() 71: already init!
[EFUSE_MSG]keynum is 1
[KM]Error:f[key_manage_query_size]L515:key[usid] not programed yet

mac address: c8:63:14:70:51:3d
[KM]Error:f[key_manage_query_size]L515:key[deviceid] not programed yet
edid preferred_mode is [0]
hdr mode is 0
dv mode is ver:0 len: 0
hdr10+ mode is 0
HDMI cable is NOT connected
hpd_state=0
[OSD]load fb addr from dts:/meson-fb
[OSD]set initrd_high: 0x7f800000
[OSD]fb_addr for logo: 0x7f800000
[OSD]load fb addr from dts:/meson-fb
[OSD]fb_addr for logo: 0x7f800000
[OSD]VPP_OFIFO_SIZE:0xfff01fff
[CANVAS]canvas init
[CANVAS]addr=0x7f800000 width=5760, height=2160
750054 bytes read in 74 ms (9.7 MiB/s)
[OSD]osd_hw.free_dst_data: 0,1079,0,1919
[OSD]osd1_update_disp_freescale_enable
cvbs: outputmode[panel] is invalid
hdmitx: outputmode[panel] is invalid
vpp: vpp_matrix_update: 0
vpp: g12a/b post2(bit12) matrix: YUV limit -> RGB …
lcd: enable: TS050, mipi, 1080x1920@47.6Hz
lcd: tablet driver init(ver 20180718): mipi
lcd: lcd_pll_wait_lock: pll_lock=1, wait_loop=1
vpp: vpp_init_lcd_gamma_table
lcd: pixel_clk = 120.000MHz, bit_rate = 960.000MHz, lanebyteclk = 120.000MHz
lcd: Waiting STOP STATE LANE
lcd: dsi init on
lcd: bl: set level: 100, last level: 0
lcd: bl: aml_bl_power_ctrl: 1
lcd: clear mute
vpp: Rx hdr_info.hdr_sup_eotf_smpte_st_2084 = 0

amlkey_init() enter!
amlkey_init() 71: already init!
[EFUSE_MSG]keynum is 1
[KM]Error:f[key_manage_query_size]L515:key[usid] not programed yet

mac address: c8:63:14:70:51:3d
[KM]Error:f[key_manage_query_size]L515:key[deviceid] not programed yet
gpio: pin GPIOAO_7 (gpio 7) value is 1
saradc: 0x289, hw_ver: 0x32 (VIM3.V12)
Product checking: pass! Hardware version: VIM3.V12
reboot_mode=cold_boot
Failed to mount ext2 filesystem…
** Unrecognized filesystem type **
normal power on
boot wol: disable
port mode is pcie
Hit Enter or space or Ctrl+C key to stop autoboot – : 0
pll tsensor avg: 0x1ebb, u_efuse: 0x801e
temp1: 28
ddr tsensor avg: 0x1eee, u_efuse: 0x8027
temp2: 30
device cool done
cfgload: start …
cfgload: reading /boot.ini from mmc 0:1 …
emmc/sd response timeout, cmd16, status=0x1ff2800
** Can’t read partition table on 0:0 **
** Invalid partition 1 **
cfgload: no /boot.ini or empty file on mmc 0:1
cfgload: reading /boot/boot.ini from mmc 0:1 …
emmc/sd response timeout, cmd16, status=0x1ff2800
** Can’t read partition table on 0:0 **
** Invalid partition 1 **
cfgload: no /boot/boot.ini or empty file on mmc 0:1
cfgload: reading /boot.ini from mmc 1:1 …
Failed to mount ext2 filesystem…
** Unrecognized filesystem type **
cfgload: no /boot.ini or empty file on mmc 1:1
cfgload: reading /boot/boot.ini from mmc 1:1 …
Failed to mount ext2 filesystem…
** Unrecognized filesystem type **
cfgload: no /boot/boot.ini or empty file on mmc 1:1
cfgload: reading /boot/boot.ini from mmc 1:5 …
Failed to mount ext2 filesystem…
** Unrecognized filesystem type **
cfgload: no /boot/boot.ini or empty file on mmc 1:5
cfgload: failed to read boot.ini on all partitions!
emmc/sd response timeout, cmd16, status=0x1ff2800
** Can’t read partition table on 0:0 **
** Invalid partition 1 **
Failed to mount ext2 filesystem…
** Unrecognized filesystem type **
Failed to mount ext2 filesystem…
** Unrecognized filesystem type **
Failed to mount ext2 filesystem…
** Unrecognized filesystem type **
Failed to mount ext2 filesystem…
** Unrecognized filesystem type **
Failed to mount ext2 filesystem…
** Unrecognized filesystem type **
Bad Linux ARM64 Image magic!
** Unrecognized filesystem type **
** Unrecognized filesystem type **
** Unrecognized filesystem type **
** Unrecognized filesystem type **
** Unrecognized filesystem type **
** Partition 6 not found on device 1 **
** Invalid partition 6 **
** Partition 7 not found on device 1 **
** Invalid partition 7 **
** Partition 8 not found on device 1 **
** Invalid partition 8 **
** Partition 9 not found on device 1 **
** Invalid partition 9 **
** Partition 10 not found on device 1 **
** Invalid partition 10 **
** Partition 11 not found on device 1 **
** Invalid partition 11 **
** Partition 12 not found on device 1 **
** Invalid partition 12 **
** Partition 13 not found on device 1 **
** Invalid partition 13 **
** Partition 14 not found on device 1 **
** Invalid partition 14 **
** Partition 15 not found on device 1 **
** Invalid partition 15 **
** Partition 16 not found on device 1 **
** Invalid partition 16 **
** Partition 17 not found on device 1 **
** Invalid partition 17 **
** Partition 18 not found on device 1 **
** Invalid partition 18 **
** Partition 19 not found on device 1 **
** Invalid partition 19 **
** Partition 20 not found on device 1 **
** Invalid partition 20 **
** Partition 21 not found on device 1 **
** Invalid partition 21 **
** Partition 22 not found on device 1 **
** Invalid partition 22 **
** Partition 23 not found on device 1 **
** Invalid partition 23 **
** Partition 24 not found on device 1 **
** Invalid partition 24 **
InUsbBurn
noSof
sof timeout, reset usb phy tuning
Device: SDIO Port B
Manufacturer ID: 1
OEM: 5041
Name: SD64G
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 57.9 GiB
mmc clock: 40000000
Bus Width: 4-bit
emmc/sd response timeout, cmd16, status=0x1ff2800
** Can’t read partition table on 0:0 **
** Invalid partition 1 **
Device: SDIO Port B
Manufacturer ID: 1
OEM: 5041
Name: SD64G
Tran Speed: 50000000
Rd Block Len: 512
SD versio
Capacity: 57.9 GiB
mmc clock: 40000000
Bus Width: 4-bit
emmc/sd response timeout, cmd16, status=0x1ff2800
** Can’t read partition table on 0:0 **
** Invalid partition 1 **
emmc/sd response timeout, cmd16, status=0x1ff2800
** Can’t read partition table on 0:0 **
** Invalid partition 1 **
(Re)start USB…
USB0: USB3.0 XHCI Register 3000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
scanning bus 0 for devices… 2 USB Device(s) found
scanning usb for storage devices… 0 Storage Device(s) found
** Bad device usb 0 **
** Bad device usb 0 **
Start read misc partition datas!
Cannot find dev.
amlmmc cmd failed

store - STORE sub-system

Usage:
store init flag
store read name addr off|partition size
read ‘size’ bytes starting at offset ‘off’
to/from memory address ‘addr’, skipping bad blocks.
store write name addr off|partition size
write ‘size’ bytes starting at offset ‘off’
to/from memory address ‘addr’, skipping bad blocks.
store rom_write add off size.
write uboot to the boot device
store erase boot/data:
erase the area which is uboot or data
store erase partition <partition_name>:
erase the area which partition in u-boot
store erase dtb
store erase key
store disprotect key
store rom_protect on/off
store scrub off|partition size
scrub the area from offset and size
store dtb iread/read/write addr
read/write dtb, size is optional
store key read/write addr
read/write key, size is optional
store ddr_parameter read/write addr
read/write ddr parameter, size is optional
store mbr addr
update mbr/partition table by dtb

[burnup]Err:store_read_ops,L84:cmd failed, ret=1, [store read misc 0xd3e34b90 0x0 0x820]
failed to store read misc.
info->magic =
info->version_major = 0
info->version_minor = 0
info->slots[0].priority = 0
info->slots[0].tries_remaining = 0
info->slots[0].successful_boot = 0
info->slots[1].priority = 0
info->slots[1].tries_remaining = 0
info->slots[1].successful_boot = 0
info->crc32 = 0
Magic is incorrect.
boot-info is invalid. Resetting.
save boot-info
info->magic =
info->version_major = 1
info->version_minor = 0
info->slots[0].priority = 15
info->slots[0].tries_remaining = 7
info->slots[0].successful_boot = 0
info->slots[1].priority = 14
info->slots[1].tries_remaining = 7
info->slots[1].successful_boot = 0
info->crc32 = -1075449479
Cannot find dev.
amlmmc cmd failed

store - STORE sub-system

Usage:
store init flag
store read name addr off|partition size
read ‘size’ bytes starting at offset ‘off’
to/from memory address ‘addr’, skipping bad blocks.
store write name addr off|partition size
write ‘size’ bytes starting at offset ‘off’
to/from memory address ‘addr’, skipping bad blocks.
store rom_write add off size.
write uboot to the boot device
store erase boot/data:
erase the area which is uboot or data
store erase partition <partition_name>:
erase the area which partition in u-boot
store erase dtb
store erase key
store disprotect key
store rom_protect on/off
store scrub off|partition size
scrub the area from offset and size
store dtb iread/read/write addr
read/write dtb, size is optional
store key read/write addr
read/write key, size is optional
store ddr_parameter read/write addr
read/write ddr parameter, size is optional
store mbr addr
update mbr/partition table by dtb

[burnup]Err:store_write_ops,L148:cmd [store write misc 0xd3e34b90 0x0 0x820] failed active slot = 0
active_slot: normal
Cannot find dev.
amlmmc cmd failed

store - STORE sub-system

Usage:
store init flag
store read name addr off|partition size
read ‘size’ bytes starting at offset ‘off’
to/from memory address ‘addr’, skipping bad blocks.
store write name addr off|partition size
write ‘size’ bytes starting at offset ‘off’
to/from memory address ‘addr’, skipping bad blocks.
store rom_write add off size.
write uboot to the boot device
store erase boot/data:
erase the area which is uboot or data
store erase partition <partition_name>:
erase the area which partition in u-boot
store erase dtb
store erase key
store disprotect key
store rom_protect on/off
store scrub off|partition size
scrub the area from offset and size
store dtb iread/read/write addr
read/write dtb, size is optional
store key read/write addr
read/write key, size is optional
store ddr_parameter read/write addr
read/write ddr parameter, size is optional
store mbr addr
update mbr/partition table by dtb

[burnup]Err:store_read_ops,L84:cmd failed, ret=1, [store read recovery 0x1080000 0x0 0x100000]
Err imgread(L328):Fail to read 0x100000B from part[recovery] at offset 0
kvim3#

Hmm, did you activate multiboot ?
did you connect a screen and see any output ?

Hello,
I never changed any code. Only erase emmc partition as below.

kvim3#store init 3
kbvi3#reset

Hi,
It’s working but I need to plugin HDMI cable. But when I unplug hdmi cable, VIM3 will be stay in uboot.

I had a problem before like this but in my case it was caused due to corruption of the data written on my SD card and so I had to try Writing the image to it again, could you try that and see if it works ?

1 Like

@tonyl Did you use external power supply ? If your power supply is connected to a PC, it is not enough to supply the board and HDMI

Yes, you could attempt this , but do it with a USB3.0 port as that is the minimum power needed to boot up
I have done this, connected to PC and having HDMI display but my laptop has a P.D port so i have no problem, but still is a bit risky, your port could be overloaded at anytime, to say its like a ticking bomb with no clock :slight_smile:

Hi,
Thanks for your advice,I already fix it .

Good, what did you do to fix it, could you tell me the source of the problem ?

Hi,
Maybe you can looking for "write_uboot_platform() " ,exchange block & count .
Could you tell me how to calculate the uboot offset ,if uboot bin size more than 1282560B.

Best Regards,

I am not exactly sure, ask @Frank