VIM3 failing to boot from SD or EMMC

As stated, our VIM3 is no longer booting into Linux correctly. For a while, it was working normally while using the SD card with the EMMC empty and unused. However, I attempted to use the EMMC as additional file storage and upon rebooting I am having memory issues. It seems the DMA memory pool is not being initialized, and I am seeing a line which suggests the DDR size is 0. When I cat /proc/iomem in Linux I also see all options are allocated to 00000000 - 00000000.

I have exhausted many options trying to recover the board, such as completely erasing the EMMC, using official images for both EMMC and SD card, changing power supplies, SD cards, etc. It is worth noting I had created a partition on the /dev/mmcblk0 device which I assumed was the EMMC as it had 14+ GB of space available, and believe this has broken something. I also have tried Krescue on an SD card to erase everything and flash a raw EMMC image on the board but to no avail. I also tried some of the uboot commands such as store erase, init and many others. The only thing I have noticed is that with Krescue when I cat /proc/iomem, devices do seem to be allocated the correct addresses. I have not tried Krescue flashed directly onto EMMC however.

I have attached a log of a full boot with this official image: vim3-ubuntu-20.04-server-linux-4.9-fenix-1.4-221229-emmc.img.xz
This was after using Krescue to erase SPI flash and EMMC flash, supposedly fully. I would like to get the board functioning again, but at this point have no clue how to proceed. Are there any additional things I can try to reset the board to a complete factory default?

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: 236675

BL2 Built : 19:23:21, Sep 18 2020. g12b g9fde858 - gongwei.chen@droid11-sz

Board ID = 10
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: 0003e5be
eMMC boot @ 0
sw8 s
board id: 10
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 : ERROR : Training has failed!
Check phy result
INFO : ERROR : Training has failed!
Check phy result
INFO : End of initialization
INFO : ERROR : Training has failed!
1D training failed
Cfg max: 12, cur: 2. Board id: 255. Force loop cfg
LPDDR4 probe
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 0000002b 00000029 00000027 00000028 00000028 00000028 00000027 00000026 00000029 00000028 00000028 00000028 00000028 00000027 00000028 00000027 00000025 00000026 00000025 00000025 00000026 00000026 00000027 00000027 00000025 00000026 00000025 00000025 00000026 00000027 00000025 00000027 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: 0MB
DMC_DDR_CTRL: 00c0002cDDR size: 2048MB
cs0 DataBus test pass
cs0 AddrBus test pass

non-sec scramble use zero key
ddr scramble enabled

100bdlr_step_size ps== 437
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: 0x000ce600, 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 1f 17 00 00 04 37 38 37 50 43 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 (Dec 29 2022 - 03:32:44)

DRAM:  2 GiB
Relocation Offset is: 76e42000
spi_post_bind(spifc): req_seq = 0
register usb cfg[0][1] = 0000000077f392b0
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 = 0x0000000073e32a70
aml_priv->desc_buf = 0x0000000073e34db0
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 =0x12000
[mmc_startup] mmc refix success
init_part() 297: PART_TYPE_AML
[mmc_init] mmc init success
start dts,buffer=0000000073e37620,dt_addr=0000000073e37620
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 e85c090e, store e85c090e
_verify_dtb_checksum()-3477: calc e85c090e, store e85c090e
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 0 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:17:1f: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:73:44:51
[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 **
1080138 bytes read in 48 ms (21.5 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@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:73:44:51
[KM]Error:f[key_manage_query_size]L515:key[deviceid] not programed yet
gpio: pin GPIOAO_7 (gpio 7) value is 1
saradc: 0x34c, hw_ver: 0x34 (VIM3.V14)
Product checking: pass! Hardware version: VIM3.V14
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: 0x1f95, u_efuse: 0x8085
temp1: 33
ddr tsensor avg: 0x1fa4, u_efuse: 0x802a
temp2: 35
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 ...
10279 bytes read in 4 ms (2.4 MiB/s)
cfgload: applying boot.ini...
[#] Script a:73e39010 l:10259 c:0 s:0 - run
Starting boot.ini...
saradc: 0x34c, hw_ver: 0x34 (VIM3.V14)

mac address: c8:63:14:73:44:51
uboot type: vendor
Scanning mmc 0:1...
card out
** Bad device mmc 0 **
Scanning mmc 0:5...
card out
** Bad device mmc 0 **
Scanning mmc 1:1...
** Unrecognized filesystem type **
Scanning mmc 1:5...
9160467 bytes read in 264 ms (33.1 MiB/s)
29245952 bytes read in 827 ms (33.7 MiB/s)
90241 bytes read in 10 ms (8.6 MiB/s)
4561 bytes read in 5 ms (890.6 KiB/s)
Import env.txt
Can not get u-boot part UUID, set to NULL
Booting legacy kernel...
port mode is usb3.0
Apply dtbo uart3
225 bytes read in 9 ms (24.4 KiB/s)
Apply dtbo pwm_f
345 bytes read in 9 ms (37.1 KiB/s)
Apply dtbo i2c3
223 bytes read in 7 ms (30.3 KiB/s)
Apply dtbo i2s
3330 bytes read in 8 ms (406.3 KiB/s)
Apply dtbo os08a10
1072 bytes read in 9 ms (116.2 KiB/s)
Apply dtbo watchdog
222 bytes read in 10 ms (21.5 KiB/s)
HDMI: Autodetect: 1080p60hz
## Loading init Ramdisk from Legacy Image at 13000000 ...
   Image Name:   uInitrd
   Image Type:   AArch64 Linux RAMDisk Image (uncompressed)
   Data Size:    9160403 Bytes = 8.7 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
load dtb from 0x1000000 ......
## Flattened Device Tree blob at 01000000
   Booting using the fdt blob at 0x1000000
   reserving fdt memory region: addr=1000000 size=17000
   Loading Ramdisk to 73573000, end 73e2f6d3 ... OK
   Loading Device Tree to 000000001ffe6000, end 000000001fffffff ... OK

Starting kernel ...

uboot time: 5450653 us
[    0.358230@3] codec_mm_module_init
[    0.364984@3] clkmsr ffd18004.meson_clk_msr: failed to get msr ring reg0
[    0.541012@3] dmi: Firmware registration failed.
[    0.544972@3] lcd: error: failed to get null
[    0.544993@3] lcd: error: Out of clock range, reset to default setting
[    0.545077@3] lcd: error: lcd_debug_info_if is null
[    0.983556@2] mtdoops: mtd device (mtddev=name/number) must be supplied
[    1.004893@2] meson_cpufreq_init:don't find the node <dynamic_gp1_clk>
[    1.006722@2] meson_cpufreq_init:don't find the node <dynamic_gp1_clk>
[    1.008491@2] ff803000.serial: clock gate not found
[    1.063167@2] meson-remote ff808040.rc: don't find the node <led_blink>
[    1.064212@2] meson-remote ff808040.rc: don't find the node <led_blink_frq>
[    1.071770@2] efuse efuse:  open efuse clk gate error!!
[    1.083135@2] fb: failed to init reserved memory
[    1.111193@2] meson-fb meson-fb: create ion_client ffffffc073a62240, handle=ffffffc073a61580
[    1.111197@2] meson-fb meson-fb: ion memory(0): created fb at 0x000000006b400000, size 75 MiB
[    6.267849@0] di_get_vpu_clkb: get clk vpu error.
[    6.269104@0] get fclk_div5 err
[    6.270071@0] vdin_drv_probe: vdin cannot get msr clk !!!
[    6.275902@0] get fclk_div5 err
[    6.278610@0] vdin_drv_probe: vdin cannot get msr clk !!!
[    6.287145@0] amlvideo2 probe called
[    6.287701@0] amlvideo2 probe called
[    6.291676@0] Reserved memory: failed to init DMA memory pool at 0x0000000075800000, size 0 MiB
[    6.304133@2] meson-mmc: >>>>>>>>hostbase ffffff80088f3000, dmode
[    6.360846@0] meson-mmc: >>>>>>>>hostbase ffffff80088fc000, dmode
[    6.402620@0] meson-mmc: >>>>>>>>hostbase ffffff8008b0a000, dmode
[    6.404956@0] meson-mmc: Tuning transfer error: nmatch=0 tuning_err:0xffffffac
[    6.414435@0] meson-mmc: Tuning transfer error: nmatch=0 tuning_err:0xffffffac
[    6.421519@0] meson-mmc: Tuning transfer error: nmatch=0 tuning_err:0xffffffac
[    6.428764@0] meson-mmc: Tuning transfer error: nmatch=0 tuning_err:0xffffffac
[    6.432028@0] meson-mmc: Tuning transfer error: nmatch=0 tuning_err:0xffffffac
[    6.443000@1] cectx ff80023c.aocec: cec driver date:2019/6/13:early suspend not report pw status
[    6.443000@1]
[    6.449977@1] cectx ff80023c.aocec: compatible:amlogic, aocec-g12a
[    6.455698@1] cectx ff80023c.aocec: cecb_ver:0x1
[    6.460290@1] cectx ff80023c.aocec: line_reg:0x1
[    6.464913@2] cectx ff80023c.aocec: line_bit:0x3
[    6.469466@2] cectx ff80023c.aocec: ee_to_ao:0x1
[    6.474350@2] cectx ff80023c.aocec: not find 'port_num'
[    6.479386@2] cectx ff80023c.aocec: using cec:1
[    6.483788@2] cectx ff80023c.aocec: no hdmirx regs
[    6.488524@2] cectx ff80023c.aocec: no hhi regs
[    6.493033@2] cectx ff80023c.aocec: not find 'output'
[    6.499511@2] cectx ff80023c.aocec: irq cnt:2
[    6.502520@2] cectx ff80023c.aocec: wakeup_reason:0x0
[    6.507470@2] cectx ff80023c.aocec: cev val1: 0x0;val2: 0x0
[    6.512964@2] cectx ff80023c.aocec: aml_cec_probe success end
[    6.963677@2] defendkey ff630218.defendkey: Reserved memory is not enough!
[    7.177663@2] asoc-aml-card auge_sound: control 2:0:0:I2SIn CLK:0 is already present
[    7.179757@2] snd_tdm ff642000.audiobus:tdma: ASoC: Failed to add I2SIn CLK: -16
[    7.187131@2] aml_dai_tdm_probe, failed add snd tdm controls
[    7.192771@2] asoc-aml-card auge_sound: control 2:0:0:I2SIn CLK:0 is already present
[    7.200485@2] snd_tdm ff642000.audiobus:tdmc: ASoC: Failed to add I2SIn CLK: -16
[    7.207850@2] aml_dai_tdm_probe, failed add snd tdm controls
[    7.577766@2] edt_ft5x06 3-0038: touchscreen probe failed
[    7.583322@3] rtc-hym8563 4-0051: hctosys: unable to read the hardware clock
[    7.703361@3] thermal thermal_zone0: binding zone soc_thermal with cdev thermal-cpufreq-0 failed:-22
[    7.706925@3] thermal thermal_zone0: binding zo~SELinux:  Could not open policy file <= /etc/selinux/targeted/policy/policy.32:  No such file or directory
[   17.657929@1] cgroup: cgroup2: unknown option "nsdelegate"
[   18.682753@0] meson-mmc: sdio: resp_timeout,vstat:0x9dff0800,virqc:3fff
[   18.683727@0] meson-mmc: sdio: err: wait for desc write back, bus_fsm:0x7
[   18.691508@0] meson-mmc: sdio: resp_timeout,vstat:0xa1ff2800,virqc:3fff
[   18.697073@0] meson-mmc: sdio: err: wait for irq service, bus_fsm:0x8
[   18.708022@0] meson-mmc: sdio: resp_timeout,vstat:0x9dff0800,virqc:3fff
[   18.710073@0] meson-mmc: sdio: err: wait for desc write back, bus_fsm:0x7
[   18.865200@2] meson-mmc: Tuning transfer error: nmatch=0 tuning_err:0xffffffac
[   18.886227@2] meson-mmc: Tuning transfer error: nmatch=0 tuning_err:0xffffffac
[   19.217468@3] No find node.
[   19.291285@5] Amlogic A/V streaming port init
[   19.458592@4] iq name from dts config is ----> os08a10
[   19.477075@0] config sensor os08a10 driver.
[   19.482865@4] pwr_enable: get_named_gpio power-enable fail
[   19.482866@4] set power fail
[   19.503432@0] arm_sensor_i2c_probe: start to probe
[   19.504253@0] system_i2c_init:success to add i2c driver
[   19.511806@4] system_i2c_read:failed to read reg data: rc -6, saddr 0x36
[   19.516376@4] system_i2c_read:failed to read reg data: rc -6, saddr 0x36
[   19.522358@4] system_i2c_read:failed to read reg data: rc -6, saddr 0x36
[   19.552765@5] system_i2c_read:failed to read reg data: rc -6, saddr 0x36
[   19.552906@5] system_i2c_read:failed to read reg data: rc -6, saddr 0x36
[   19.553039@5] system_i2c_read:failed to read reg data: rc -6, saddr 0x36
[   19.720472@2] meson-fb meson-fb: create ion_client ffffffc073a62240, handle=ffffffc014e05f80
[   19.723467@2] meson-fb meson-fb: ion memory(1): created fb at 0x0000000070000000, size 1 MiB
[   20.763441@2] meson-fb meson-fb: create ion_client ffffffc073a62240, handle=ffffffc014e05840
[   20.766256@2] meson-fb meson-fb: ion memory(2): created fb at 0x0000000070100000, size 1 MiB
[   21.789681@2] meson-fb meson-fb: create ion_client ffffffc073a62240, handle=ffffffc014e05580
[   21.792468@2] meson-fb meson-fb: ion memory(3): created fb at 0x0000000070200000, size 8 MiB
[   22.912268@3] meson-remote ff808040.rc: remote_ioctl invalid user space pointer
[   24.784256@1] meson-mmc: Tuning transfer error: nmatch=0 tuning_err:0xffffffac
[   24.807743@0] meson-mmc: Tuning transfer error: nmatch=0 tuning_err:0xffffffac
[   25.122991@0] CONFIG-ERROR) dhd_conf_set_intiovar: txbf setting failed -23

Ubuntu 20.04.5 LTS Khadas ttyS0

Khadas login:

@Anthony_McGivern As I understand, you have tried to use the SD card as the boot device with the eMMC as additional storage after which you are now facing issues ?

That’s correct. Before I never touched the emmc and only relied on the SD card, but I had ran out of space and rather than reflashing my image onto a larger card, I tried to create a partition in Linux on /dev/mmcblk0 and mounted it to store additional files. I assumed this was the EMMC and it appeared to work fine, but after rebooting the board no longer boots correctly.

@Electr1 I have been trying further steps to recover the board and still nothing works. I attempted to use an OOWOW image and reset the board, erase the EMMC and SPI flash, then use the wizard to download and flash an image onto the EMMC. This does not help either. So I then wiped everything and tried using an SD card with an official Ubuntu 20.04 image. This is the log I get from this:

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.
bl2_stage_init 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: 239075

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: 0003eec7
board id: 8
Load FIP HDR DDR from SD, src: 0x00010200, des: 0xfffd0000, size: 0x00004000, part: 0
Get wrong ddr fw magic! Error!!
fw parse done
PIEI prepare done
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 : ERROR : Training has failed!
Check phy result
INFO : ERROR : Training has failed!
Check phy result
INFO : End of initialization
INFO : ERROR : Training has failed!
1D training failed
Cfg max: 12, cur: 2. Board id: 255. Force loop cfg
LPDDR4 probe
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 00000026 00000025 00000026 00000027 00000027 00000027 00000025 00000026 00000025 00000022 00000025 00000024 00000026 00000027 00000024 00000024 00000023 00000024 00000025 00000023 00000024 00000024 00000023 00000025 00000025 00000025 00000025 00000024 00000024 00000023 00000025 00000025 dwc_ddrphy_apb_wr((0<<20)|(2<<16)|(0<<12)|(0xb0):0004
dram_vref_reg_value 0x 00000014
2D training succeed
auto size-- 65535DDR cs0 size: 2048MB
DDR cs1 size: 0MB
DMC_DDR_CTRL: 00c0002cDDR size: 2048MB
cs0 DataBus test pass
cs0 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
Load FIP HDR from SD, src: 0x00010200, des: 0x01700000, size: 0x00004000, part: 0
Load BL3X from SD, src: 0x00078200, des: 0x01768000, size: 0x000ce600, 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 1a 03 00 00 0a 35 38 47 47 52 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 (Dec 29 2022 - 04:40:03)

DRAM: 2 GiB
Relocation Offset is: 76e42000
spi_post_bind(spifc): req_seq = 0
register usb cfg[0][1] = 0000000077f392b0
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 = 0x0000000073e32a70
aml_priv->desc_buf = 0x0000000073e34db0
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
[mmc_init] mmc init success
start dts,buffer=0000000073e37620,dt_addr=0000000073e37620
check_valid_dts: FDT_ERR_BADMAGIC
get_partition_from_dts() 91: ret -9
get_partition_from_dts() 94: ret -9
get_ptbl_from_dtb()-272: get partition table from dts faild
mmc_device_init()-1254: get partition table from dtb failed
get_ptbl_rsv()-494: magic faild MPT,
mmc_device_init()-1281: dtb&rsv are not exist, no LPT source
get partition info failed !!
Using default environment

In: serial
Out: serial
Err: serial
reboot_mode=cold_boot
[store]To run cmd[emmc dtb_read 0x1000000 0x40000]
_verify_dtb_checksum()-3477: calc 0, store 0
update_dtb_info()-3585: cpy 1 is not valid
_verify_dtb_checksum()-3477: calc 0, store 0
update_dtb_info()-3585: cpy 0 is not valid
dtb_read()-3694: total valid 0
emmc - EMMC sub system

Usage:
emmc dtb_read addr size
emmc dtb_write addr size
emmc erase dtb
emmc erase key
emmc fastboot_read addr size
emmc fastboot_write addr size

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
[KM]Error:f[keymanage_dts_parse]L307:not a fdt at 0x0000000001000000
vpu: error: vpu: check dts: FDT_ERR_BADMAGIC, load default parameters
vpu: clk_level = 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: error: check dts: FDT_ERR_BADMAGIC, load default lcd parameters
lcd: detect mode: tablet, key_valid: 0
lcd: load config from bsp
lcd: use panel_type=lcd_0
lcd: bl: name: lcd_0, 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 25000000
init_part() 282: PART_TYPE_DOS
[mmc_init] mmc init success
Device: SDIO Port B
Manufacturer ID: 9f
OEM: 5449
Name: SD16G
Tran Speed: 25000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 14.5 GiB
mmc clock: 25000000
Bus Width: 4-bit
Net: [KM]Error:f[keymanage_dts_get_key_device]L100:/unify not parsed yet!
[KM]Error:f[_get_km_ops_by_name]L248:key eth_exphy_para not know device 4
[KM]Error:f[key_unify_read]L312:key[eth_exphy_para] no cfg in dts
dwmac.ff3f0000 Waiting for PHY auto negotiation to complete… done
The Best Window is index 41
[KM]Error:f[keymanage_dts_get_key_device]L100:/unify not parsed yet!
[KM]Error:f[_get_km_ops_by_name]L248:key eth_exphy_para not know device 4
[KM]Error:f[key_unify_write]L279:key[eth_exphy_para] no cfg in dts
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
No FDT memory address configured. Please configure
the FDT address via “fdt addr ” command.
Aborting!
dwmac.ff3f0000[KM]Error:f[keymanage_dts_parse]L307:not a fdt at 0x0000000001000000

upgrade_step=0
reboot_mode:::: cold_boot
[KM]Error:f[keymanage_dts_parse]L307:not a fdt at 0x0000000001000000
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]check dts: FDT_ERR_BADMAGIC, load default fb_addr parameters
[OSD]set initrd_high: 0x3d800000
[OSD]fb_addr for logo: 0x3d800000
[OSD]check dts: FDT_ERR_BADMAGIC, load default fb_addr parameters
[OSD]fb_addr for logo: 0x3d800000
[OSD]VPP_OFIFO_SIZE:0xfff01fff
[CANVAS]canvas init
[CANVAS]addr=0x3d800000 width=5760, height=2160
1080138 bytes read in 195 ms (5.3 MiB/s)
[OSD]osd_hw.free_dst_data: 0,767,0,1023
[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: lcd_0, mipi, 768x1024@60.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 = 64.843MHz, bit_rate = 518.744MHz, lanebyteclk = 64.843MHz
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
[KM]Error:f[keymanage_dts_parse]L307:not a fdt at 0x0000000001000000
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
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
port mode is usb3.0
No FDT memory address configured. Please configure
the FDT address via “fdt addr ” command.
Aborting!
No FDT memory address configured. Please configure
the FDT address via “fdt addr ” command.
Aborting!
Hit Enter or space or Ctrl+C key to stop autoboot – : 0
pll tsensor avg: 0x20e8, u_efuse: 0x8180
temp1: 40
ddr tsensor avg: 0x210f, u_efuse: 0x8132
temp2: 42
device cool done
cfgload: start …
cfgload: reading /boot.ini from mmc 0:1 …
reading /boot.ini
10279 bytes read in 7 ms (1.4 MiB/s)
cfgload: applying boot.ini…
[#] Script a:73e54a70 l:10259 c:0 s:0 - run
Starting boot.ini…
saradc: 0x28d, hw_ver: 0x32 (VIM3.V12)

mac address: c8:63:14:70:ce:c7
uboot type: vendor
Scanning mmc 0:1…
reading uInitrd
9160406 bytes read in 807 ms (10.8 MiB/s)
reading zImage
29245952 bytes read in 2570 ms (10.9 MiB/s)
reading dtb.img
90241 bytes read in 12 ms (7.2 MiB/s)
reading /boot/env.txt
** Unable to read file /boot/env.txt **
reading env.txt
4561 bytes read in 7 ms (635.7 KiB/s)
Import env.txt
Booting legacy kernel…
port mode is usb3.0
Apply dtbo uart3
reading /dtb/overlays/kvim3/uart3.dtbo
225 bytes read in 9 ms (24.4 KiB/s)
Apply dtbo pwm_f
reading /dtb/overlays/kvim3/pwm_f.dtbo
345 bytes read in 8 ms (42 KiB/s)
Apply dtbo i2c3
reading /dtb/overlays/kvim3/i2c3.dtbo
223 bytes read in 9 ms (23.4 KiB/s)
Apply dtbo i2s
reading /dtb/overlays/kvim3/i2s.dtbo
3330 bytes read in 10 ms (325.2 KiB/s)
Apply dtbo os08a10
reading /dtb/overlays/kvim3/os08a10.dtbo
1072 bytes read in 9 ms (116.2 KiB/s)
Apply dtbo watchdog
reading /dtb/overlays/kvim3/watchdog.dtbo
222 bytes read in 9 ms (23.4 KiB/s)
HDMI: Autodetect: 1080p60hz

Loading init Ramdisk from Legacy Image at 13000000 …

Image Name: uInitrd
Image Type: AArch64 Linux RAMDisk Image (uncompressed)
Data Size: 9160342 Bytes = 8.7 MiB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum … OK
load dtb from 0x1000000 …

Flattened Device Tree blob at 01000000

Booting using the fdt blob at 0x1000000
reserving fdt memory region: addr=1000000 size=17000
Loading Ramdisk to 3cf43000, end 3d7ff696 … OK
Loading Device Tree to 000000001ffe6000, end 000000001fffffff … OK

Starting kernel …

uboot time: 10218420 us
[ 0.357313@3] codec_mm_module_init
[ 0.363991@3] clkmsr ffd18004.meson_clk_msr: failed to get msr ring reg0
[ 0.541114@2] dmi: Firmware registration failed.
[ 0.545078@2] lcd: error: failed to get null
[ 0.545097@2] lcd: error: Out of clock range, reset to default setting
[ 0.545181@2] lcd: error: lcd_debug_info_if is null
[ 0.984217@3] mtdoops: mtd device (mtddev=name/number) must be supplied
[ 1.005858@3] meson_cpufreq_init:don’t find the node <dynamic_gp1_clk>
[ 1.007628@3] meson_cpufreq_init:don’t find the node <dynamic_gp1_clk>
[ 1.009384@3] ff803000.serial: clock gate not found
[ 1.065218@3] meson-remote ff808040.rc: don’t find the node <led_blink>
[ 1.066202@3] meson-remote ff808040.rc: don’t find the node <led_blink_frq>
[ 1.073758@3] efuse efuse: open efuse clk gate error!!
[ 1.085094@3] fb: failed to init reserved memory
[ 1.116776@3] meson-fb meson-fb: create ion_client ffffffc04683f6c0, handle=ffffffc03d277d00
[ 1.116780@3] meson-fb meson-fb: ion memory(0): created fb at 0x0000000070000000, size 75 MiB
[ 6.267521@2] di_get_vpu_clkb: get clk vpu error.
[ 6.268647@1] get fclk_div5 err
[ 6.269726@1] vdin_drv_probe: vdin cannot get msr clk !!!
[ 6.275535@1] get fclk_div5 err
[ 6.278214@1] vdin_drv_probe: vdin cannot get msr clk !!!
[ 6.284791@2] amlvideo2 probe called
[ 6.287255@2] amlvideo2 probe called
[ 6.290915@2] Reserved memory: failed to init DMA memory pool at 0x000000006d800000, size 0 MiB
[ 6.302417@4] meson-mmc: >>>>>>>>hostbase ffffff80088f3000, dmode
[ 6.356984@1] meson-mmc: >>>>>>>>hostbase ffffff80088fc000, dmode
[ 6.397182@0] meson-mmc: Tuning transfer error: nmatch=0 tuning_err:0xffffffac
[ 6.399660@1] meson-mmc: >>>>>>>>hostbase ffffff8008b0a000, dmode
[ 6.403795@0] meson-mmc: Tuning transfer error: nmatch=0 tuning_err:0xffffffac
[ 6.408668@0] meson-mmc: Tuning transfer error: nmatch=0 tuning_err:0xffffffac
[ 6.408700@0] meson-mmc: Tuning transfer error: nmatch=0 tuning_err:0xffffffac
[ 6.467272@0] cectx ff80023c.aocec: cec driver date:2019/6/13:early suspend not report pw status
[ 6.467272@0]
[ 6.472427@0] cectx ff80023c.aocec: compatible:amlogic, aocec-g12a
[ 6.478333@0] cectx ff80023c.aocec: cecb_ver:0x1
[ 6.482819@0] cectx ff80023c.aocec: line_reg:0x1
[ 6.487412@0] cectx ff80023c.aocec: line_bit:0x3
[ 6.492005@0] cectx ff80023c.aocec: ee_to_ao:0x1
[ 6.496894@0] cectx ff80023c.aocec: not find ‘port_num’
[ 6.501839@2] cectx ff80023c.aocec: using cec:1
[ 6.506314@2] cectx ff80023c.aocec: no hdmirx regs
[ 6.511072@2] cectx ff80023c.aocec: no hhi regs
[ 6.515572@2] cectx ff80023c.aocec: not find ‘output’
[ 6.522054@2] cectx ff80023c.aocec: irq cnt:2
[ 6.525042@2] cectx ff80023c.aocec: wakeup_reason:0x0
[ 6.530013@2] cectx ff80023c.aocec: cev val1: 0x0;val2: 0x0
[ 6.535499@2] cectx ff80023c.aocec: aml_cec_probe success end
[ 6.601759@1] meson-mmc: card IN
[ 6.989718@0] defendkey ff630218.defendkey: Reserved memory is not enough!
[ 7.213968@0] asoc-aml-card auge_sound: control 2:0:0:I2SIn CLK:0 is already present
[ 7.216067@0] snd_tdm ff642000.audiobus:tdma: ASoC: Failed to add I2SIn CLK: -16
[ 7.223482@0] aml_dai_tdm_probe, failed add snd tdm controls
[ 7.229086@0] asoc-aml-card auge_sound: control 2:0:0:I2SIn CLK:0 is already present
[ 7.236804@0] snd_tdm ff642000.audiobus:tdmc: ASoC: Failed to add I2SIn CLK: -16
[ 7.244190@2] aml_dai_tdm_probe, failed add snd tdm controls
[ 7.609855@0] edt_ft5x06 3-0038: touchscreen probe failed
[ 7.733529@2] thermal thermal_zone0: binding zone soc_thermal with cdev thermal-cpufreq-0 failed:-22
[ 7.737072@2] thermal thermal_zone0: binding zo~SELinux: Could not open policy file <= /etc/selinux/targeted/policy/policy.32: No such file or directory
[ 14.474472@4] cgroup: cgroup2: unknown option “nsdelegate”
[ 16.915080@0] meson-mmc: sdio: resp_timeout,vstat:0xa1ff2800,virqc:3fff
[ 16.916059@0] meson-mmc: sdio: err: wait for irq service, bus_fsm:0x8
[ 16.924773@0] meson-mmc: sdio: resp_timeout,vstat:0xa1ff2800,virqc:3fff
[ 16.929058@0] meson-mmc: sdio: err: wait for irq service, bus_fsm:0x8
[ 16.940026@0] meson-mmc: sdio: resp_timeout,vstat:0x9dff0800,virqc:3fff
[ 16.942053@0] meson-mmc: sdio: err: wait for desc write back, bus_fsm:0x7
[ 17.110260@4] meson-mmc: Tuning transfer error: nmatch=0 tuning_err:0xffffffac
[ 17.526190@4] No find node.
[ 18.263593@2] meson-fb meson-fb: create ion_client ffffffc04683f6c0, handle=ffffffc0451b1040
[ 18.266410@2] meson-fb meson-fb: ion memory(1): created fb at 0x0000000074c00000, size 1 MiB
[ 18.279000@4] Amlogic A/V streaming port init
[ 19.076632@0] iq name from dts config is ----> os08a10
[ 19.261968@0] config sensor os08a10 driver.
[ 19.292707@3] meson-fb meson-fb: create ion_client ffffffc04683f6c0, handle=ffffffc03377ff40
[ 19.295577@3] meson-fb meson-fb: ion memory(2): created fb at 0x0000000074d00000, size 1 MiB
[ 20.321169@3] meson-fb meson-fb: create ion_client ffffffc04683f6c0, handle=ffffffc03339fe80
[ 20.323969@3] meson-fb meson-fb: ion memory(3): created fb at 0x0000000074e00000, size 8 MiB
[ 21.495317@1] meson-remote ff808040.rc: remote_ioctl invalid user space pointer
[ 26.602275@0] meson-mmc: Tuning transfer error: nmatch=39 tuning_err:0xffffffac
[ 26.936937@0] CONFIG-ERROR) dhd_conf_set_intiovar: txbf setting failed -23

Ubuntu 20.04.5 LTS Khadas ttyS0

Khadas login:

This is actually the second VIM3 we have bought, as the USB ports seem to have failed on the first one. However, even now trying the first one seems to be having the same issues. I dont know at this point if it is worth it to RMA this board or if I am missing something. There must be something on either the EMMC or SPI flash that needs to be in place for this to boot correctly, but if there is I do not know what.

@Anthony_McGivern the issue is 4.9 kernel images don’t support this functionality. However, with mainline kernel images 5.x/6.x support that functionality you require booting from other disk and to use the eMMC as secondary storage.

If using the mainline image, you can install the bootloader on the spi flash and it will execute the boot order perfectly.

Could you elaborate on this issue ?

@Electr1 So how do I need to configure the board in order to boot the 4.9 kernel images? I have had this image working before without any problems, all I had to do was flash an SD card with the image then erase the eMMC using “store erase boot”. However trying this now does not work and shows the same log from my previous post. Note in this case I no longer care about using eMMC as secondary storage as I have a larger SD card.

Also, I ended up purchasing an official Khadas 24W adapter and this doesn’t seem to have made a difference. As for the USB ports on the original board, they do not seem to be detected at all, whether or not I plug a device into them. I had to connect a USB-C hub with power delivery pass-through in order to get some USBs to connect a keyboard and mouse to it. I tried different images to get this working but they appear to be broken.

Okay,

I need to test what configurations for the 4.9 kernel images can work with the device and get back to you.

can you provide logs for this, any other information will help to diagnose this issue.
eg. dmesg or lsusb, for before and after connecting the USB devices.

On my working Khadas I would receive logs in dmesg stating when a USB device was connected, however these do not appear on the broken one. In addition, in U-boot I would run “usb info” and receive this log

kvim3#usb info
1: Hub, USB Revision 3.0

  • u-boot XHCI Host Controller
  • Class: Hub
  • PacketSize: 9 Configurations: 1
  • Vendor: 0x0000 Product 0x0000 Version 1.0
    Configuration: 1
    • Interfaces: 1 Self Powered 0mA
      Interface: 0
      • Alternate Setting 0, Endpoints: 1
      • Class Hub
      • Endpoint 1 In Interrupt MaxPacket 8 Interval 255ms

lsusb simply shows this

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

On the broken board is the USB device powering up ? Please provide some detailed pictures near the port area, top and bottom of the board of the broken device.

No device appears to receive power. I tested with a keyboard and no lights appear on. Here are images of the top and bottom of the board.


Not entirely sure what has resolved it, but seems like the CMA memory is being allocated correctly. When I view the serial it shows some failures, but once Linux loads and I look at the dmesg I can see it has worked correctly. As for the missing FDT address, when uboot loaded I ran recovery_from_sdcard and that seems to have loaded the correct information into the eMMC.

Finally, it seems I can only view the /proc/iomem info when I am sudo, and simply viewing it as a regular user shows all zeros.

The board boot successully, what’s the issue you have ?

Initially, it appeared that the DMA pool was not being initialized. As I attempted to load the ISP module I was greeted with an error stating it was unable to retrieve reserved memory. I can still see the DMA memory pool error via the serial console, however I can load the driver normally. Upon viewing dmesg I can see it did in fact allocate successfully, so the error must have been for something else. Does the boot log I sent for the SD card image appear normal to you? Note the FDT errors no longer appear, as I called “run recovery_from_sdcard” in u-boot and this seems to have resolved it.

Yes, it is normal, so your issue is gone ?

Formatting the eMMC and booting 4.9 linux image from the SD card, seems to work

khadas@Khadas:~$ lsblk
NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
mmcblk0      179:0    0  14.6G  0 disk /mnt/emmc
mmcblk0boot0 179:32   0     4M  0 disk 
mmcblk0boot1 179:64   0     4M  0 disk 
mmcblk0rpmb  179:96   0     4M  0 disk 
mmcblk1      179:128  0  29.8G  0 disk 
├─mmcblk1p1  179:129  0   240M  0 part /boot
└─mmcblk1p2  179:130  0  29.2G  0 part /
zram1        251:1    0 232.6M  0 disk [SWAP]
zram2        251:2    0 232.6M  0 disk [SWAP]
zram3        251:3    0 232.6M  0 disk [SWAP]
zram4        251:4    0 232.6M  0 disk [SWAP]
khadas@Khadas:~$ 
khadas@Khadas:~$ cat /mnt/emmc/hello.txt 
hello khadas
1 Like

Yes, I had tried something similar. However, it seems after a reboot that I was getting errors and had to reflash everything. I now seem to be having an issue with the h264 hardware encoding, as it appears the Gstreamer amlvenc plugin is not working at all. Looking at dmesg, the encoder module seems to fail to reserve memory.

@Anthony_McGivern please migrate to 22.04 images, 20.04 image is not recommended to use.

@Electr1 Ok I will try this. I found the cause of the amlvenc issue anyway. By default, the libvpcodec.so is located in /usr/lib/aarch64-linux-gnu, but a quick GST_DEBUG told me it was looking for it in /usr/lib

I think for now I am going to have to stick to Ubuntu 20.04, as the 22.04 build does not include the Gstreamer Amlogic plugins such as amlvenc, meaning I cannot do hardware H264 encoding. I saw there was a 5.4 Kernel released recently for VIM3, but this image was with Android. If an image becomes available for Ubuntu I will probably switch to that.