Build image, but it can't work

Which Khadas SBC do you use?

VIM3

Which system do you use? Android, Ubuntu, OOWOW or others?

source env/setenv.sh -q -s  KHADAS_BOARD=VIM3 LINUX=4.9 UBOOT=2015.01 DISTRIBUTION=Ubuntu DISTRIB_RELEASE=jammy DISTRIB_RELEASE_VERSION=22.04 DISTRIB_TYPE=gnome DISTRIB_ARCH=arm64 INSTALL_TYPE=EMMC COMPRESS_IMAGE=yes INSTALL_TYPE_RAW=no

Which version of system do you use? Khadas official images, self built images, or others?

source env/setenv.sh -q -s  KHADAS_BOARD=VIM3 LINUX=4.9 UBOOT=2015.01 DISTRIBUTION=Ubuntu DISTRIB_RELEASE=jammy DISTRIB_RELEASE_VERSION=22.04 DISTRIB_TYPE=gnome DISTRIB_ARCH=arm64 INSTALL_TYPE=EMMC COMPRESS_IMAGE=yes INSTALL_TYPE_RAW=no

Please describe your issue below:

i used USB burning tool to download my built <vim3-ubuntu-20.04-gnome-linux-4.9-fenix-1.4-221229-emmc.img> to VIM3.
After download ok, then reboot vim3, It can’t work well, block somewhere.

Below is the powerup log.

G12B:BL:6e7c85:2a3b91;FEAT:E0F83180:402000;POC:F;RCY:0;EMMC:0;READ:0;0.
                                                                      bl2_stage_init 0x01
bl2_stage_init 0x81
hw id: 0x0000 - pwm id 0x01
bl2_stage_init 0xc1
bl2_stage_init 0x02

L0:00000000
L1:20000703
L2:00008067
L3:14000000
B2:00402000
B1:e0f83180

TE: 182032

BL2 Built : 19:23:21, Sep 18 2020. g12b g9fde858 - gongwei.chen@droid11-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: 00030ff3
eMMC boot @ 0
sw8 s
board id: 8
Load FIP HDR DDR from eMMC, src: 0x00010200, des: 0xfffd0000, size: 0x00004000, part: 0
Get wrong ddr fw magic! Error!!
fw parse done
PIEI prepare done
00000000
emmc switch 1 ok
ddr saved addr:00016000
Load ddr parameter from eMMC, src: 0x02c00000, des: 0xfffd0000, size: 0x00001000, part: 0
00000000
emmc switch 0 ok
fastboot data verify
result: 255
Cfg max: 12, cur: 1. Board id: 255. Force loop cfg
LPDDR4 probe

LPDDR4_PHY_V_0_1_22-Built : 14:57:26, Sep  1 2020. g12b g3c95fed - gongwei.chen@droid11-sz
ddr clk to 1608MHz

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 read dq deskew training
INFO : End of MPR read delay center optimization
INFO : End of Write leveling coarse delay
INFO : End of read delay center optimization
INFO : Training has run successfully!
Check phy result
INFO : End of initialization
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
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!

soc_vref_reg_value 0x 00000024 00000025 00000025 00000023 00000023 00000025 00000025 00000024 00000023 00000022 00000025 00000024 00000025 00000025 00000024 00000023 00000025 00000023 00000024 00000026 00000025 00000024 00000021 00000023 00000025 00000024 00000025 00000026 00000026 00000024 00000025 00000024 dwc_ddrphy_apb_wr((0<<20)|(2<<16)|(0<<12)|(0xb0):0004
 dram_vref_reg_value 0x 00000013
2D training succeed
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

non-sec scramble use zero key
ddr scramble enabled

100bdlr_step_size ps== 409
result report
boot times 0Enable ddr reg access
00000000
emmc switch 3 ok
Authentication key not yet programmed
get rpmb counter error 0x00000007
00000000
emmc switch 0 ok
Load FIP HDR from eMMC, src: 0x00010200, des: 0x01700000, size: 0x00004000, part: 0
Load BL3X from eMMC, src: 0x00078200, des: 0x01768000, size: 0x000ce800, 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 0c 22 00 00 07 37 37 34 54 33 50
[0.018960 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 (Sep 06 2023 - 14:08:01)

DRAM:  3.8 GiB
Relocation Offset is: d6e42000
spi_post_bind(spifc): req_seq = 0
register usb cfg[0][1] = 00000000d7f39750
aml_i2c_init_port init regs for 0
MCU version: 0x00 0x03
MCU version is to low! Doesn't support froce boot from SD card.
MMC:   aml_priv->desc_buf = 0x00000000d3e32a70
aml_priv->desc_buf = 0x00000000d3e34db0
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=00000000d3e37620,dt_addr=00000000d3e37620
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 66c51a54, store 66c51a54
_verify_dtb_checksum()-3477: calc 66c51a54, store 66c51a54
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
CC connected in 1 as UFP
fusb302 detect chip.port_num = 0
gpio: pin GPIOA_13 (gpio 77) value is 1
gpio: pin GPIOA_13 (gpio 77) value is 0
gpio: pin GPIOA_8 (gpio 72) value is 0

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
Net:   dwmac.ff3f0000
amlkey_init() enter!
amlkey_init() 71: already init!
[EFUSE_MSG]keynum is 1
MACADDR:02:00:00:22:0c:01(from chipid)

upgrade_step=2
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:72:49:3e
[KM]Error:f[key_manage_query_size]L515:key[deviceid] not programed yet
edid preferred_mode is <NULL>[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
card out
** Bad device mmc 0 **
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
ext4fs_devread read outside partition 6736683808
** File not found /usr/share/fenix/logo/logo.bmp **
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@55.0Hz
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:72:49:3e
[KM]Error:f[key_manage_query_size]L515:key[deviceid] not programed yet
gpio: pin GPIOAO_7 (gpio 7) value is 1
saradc: 0x28c, hw_ver: 0x32 (VIM3.V12)
Product checking: pass! Hardware version: VIM3.V12
normal power on
boot wol: disable
port mode is usb3.0
Hit Enter or space or Ctrl+C key to stop autoboot -- :  0
pll tsensor avg: 0x1f4a, u_efuse: 0x805d
temp1: 32
ddr tsensor avg: 0x1f5b, u_efuse: 0x801e
temp2: 33
device cool done
cfgload: start ...
cfgload: reading /boot.ini from mmc 0:1 ...
card out
** Bad device mmc 0 **
cfgload: no /boot.ini or empty file on mmc 0:1
cfgload: reading /boot/boot.ini from mmc 0:1 ...
card out
** Bad device mmc 0 **
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 ...
ext4fs_devread read outside partition 6736683808
** File not found /boot/boot.ini **
cfgload: no /boot/boot.ini or empty file on mmc 1:5
cfgload: failed to read boot.ini on all partitions!
card out
** Bad device mmc 0 **
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
ext4fs_devread read outside partition 6736683808
** File not found /boot/s905_autoscript **
ext4fs_devread read outside partition 6736683808
** File not found zImage **
ext4fs_devread read outside partition 6736683808
** File not found uInitrd **
ext4fs_devread read outside partition 6736683808
** File not found dtb.img **
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
[MSG]sof
Set Addr 59
Get DT cfg
Get DT cfg
Get DT cfg
set CFG

block here.

@joseph123 you are saying you have built 22.04 image and mention install 20.04 image ?

please confirm correctly, which image you have installed. Is this only firmware installed on the eMMC ?

yes,i want to build ubuntu 22.04 gnome os image. installed EMMC.
because i only see your provide 20.04 gnome emmc os image.
Can i build 22.04 gnome emmc os image?
thanks.

Yes you can build 22.04 gnome image for 4.9 kernel, please need not use compress image option, only eMMC version is enough.

the compress option just only generate “vim3-ubuntu-22.04-gnome-linux-4.9-fenix-1.4-230906-emmc.img” to be “vim3-ubuntu-22.04-gnome-linux-4.9-fenix-1.4-230906-emmc.img.xz”.
it shouldn’t affect the functions.
isn’t it right?
thanks.

It is for use with OOWOW/Krescue installation, for your use of usb-burn tool, not necessary to have enabled.

ok, now i am trying
source env/setenv.sh -q -s KHADAS_BOARD=VIM3 LINUX=4.9 UBOOT=2015.01 DISTRIBUTION=Ubuntu DISTRIB_RELEASE=jammy DISTRIB_RELEASE_VERSION=22.04 DISTRIB_TYPE=gnome DISTRIB_ARCH=arm64 INSTALL_TYPE=EMMC COMPRESS_IMAGE=no INSTALL_TYPE_RAW=no

NO_HOST_CHECK=1 BUILD_TYPE=release make
after build finish, i will download the the image into vim3.
Expect to have a good result.
thanks.

oh, same issue with before.
i don’t know how to do next, can you help?
thanks.

Hello @Electr1

Do youo have this issue on your side?

Need to check, I will try to replicate and see if issue persist.

1 Like

Hello @joseph123

I have built image with same configuration as you have prescribed on Ubuntu 22.04 x86 build system:

source env/setenv.sh -q -s KHADAS_BOARD=VIM3 LINUX=4.9 UBOOT=2015.01 \
DISTRIBUTION=Ubuntu DISTRIB_RELEASE=jammy DISTRIB_RELEASE_VERSION=22.04 \
DISTRIB_TYPE=gnome DISTRIB_ARCH=arm64 INSTALL_TYPE=EMMC COMPRESS_IMAGE=no \
INSTALL_TYPE_RAW=no BUILD_TYPE=release make

output image name: vim3-ubuntu-22.04-gnome-linux-4.9-fenix-1.5.2-230907-emmc.img

using image burning tool I can flash and obtain working system.
you can check my logs.

can you share your system build info ? Ubuntu version or Docker container ?

I used ubuntu 22.10 to build, so i must add NO_HOST_CHECK=1 make to build, can build pass.
i don’t know whether vim3 only support to use ubuntu 22.04 or docker.
Now i am ready to use docker to build, expect to have good result.
thanks.

@joseph123 is not preferred to use, have introduced changes compared to 22.04 and its not LTS.

Can you please use 22.04 and check if the image is able to build without issues ?

update the last: the result is indeed good.
now i can build the emmc image using docker.
maybe ubuntu 22.10 is not support to build vim3 image, that will lead to unexpected issue.
i believe ubuntu 22.04 may be supported to build vim3 image.
thank you @Electr1

1 Like