Armbian doesn't boot from SD without erase EMMC

Hello,
I have noticed that the SD card with Khadas Rescue system booted always
when it is inserted, but Armbian not.

For successful booting Armbian from SD card (Bookworm OS, for example)
recommend full erase of EMMC.

Is it possible boot OS from SD without the erasing EMMC?
Thank you!

Hello @sergetsp

@Electr1 will help you with this issue later.

1 Like

Hi @sergetsp what kind of firmware have you installed on the eMMC, using the upgrade mode method with long hold of the power button and a short press of the reset button should work.

Hello.
thank you, I have installed on EMMC the
vim3-ubuntu-20.04-server-linux-4.9-fenix-1.4-221229-emmc.raw.img
image, it is working fine.

I try to switch to Upgrade mode (pressed the Func button 3 times in 2 sec) and
long press pwr botton and short reset btn, but no correct loading the Armbian
(Armbian_24.5.3_Khadas-vim3_noble_current_6.6.36_minimal.oowow.img.xz)
from
[https://dl.armbian.com/khadas-vim3/archive/Armbian_24.5.3_Khadas-vim3_noble_current_6.6.36_minimal.oowow.img.xz]

The loading of Armbian Ubuntu Server is started, but no success,
and with erasing the emmc - loaded ok.

I have attached my armbian boot log in console

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

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: 0002ecfa
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
00000000
emmc switch 2 ok
 NO find ddr boot_info from eMMC
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
00000000
emmc switch 0 ok

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 00000024 00000025 00000023 00000025 00000024 00000025 00000025 00000025 00000022 00000024 00000025 00000023 00000023 0000002 
 dram_vref_reg_value 0x 00000016
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== 403
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 16 21 00 00 13 31 34 32 58 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 (Apr 25 2023 - 08:45:03)

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() 282: PART_TYPE_DOS
[mmc_init] mmc init success
start dts,buffer=00000000d3e37620,dt_addr=00000000d3e37620
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, B|
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 246059d0, store 913a2021
update_dtb_info()-3585: cpy 1 is not valid
_verify_dtb_checksum()-3477: calc 46fea92b, store aa1303e0
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
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 40
[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 <address>" 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
hdmitx: edid: change preferred_mode from 782 to 0
edid preferred_mode is <NULL>[0]
hdr mode is 0
dv  mode is ver:0  len: 0
hdr10+ mode is 0
edid extension block number : 1
Dump EDID Rawdata
00ffffffffffff004c2de20037314944260e010380221b782aee95a3544c9926
0f5054bfef808180714f010101010101010101010101302a009851002a403070
1300520e1100001e000000fd00384b1e510e000a202020202020000000fc0053
796e634d61737465720a2020000000ff00485343583930303931380a2020002d
Manufacturer: SAM Model e2 Serial Number 1145647415
EDID version: 1.3
Established timings supported:
  720x400@70Hz
  640x480@60Hz
  640x480@67Hz
  640x480@72Hz
  640x480@75Hz
  800x600@56Hz
  800x600@60Hz
  800x600@72Hz
  800x600@75Hz
  832x624@75Hz
  1024x768@60Hz
  1024x768@70Hz
  1024x768@75Hz
  1280x1024@75Hz
  1152x870@75Hz
Standard timings supported:
  1280x1024@60Hz
  1152x864@75Hz
Detailed mode (1) : Clock 108 MHz, 338 mm x 270 mm
               1280 1328 1440 1688 hborder 0
               1024 1025 1028 1066 vborder 0
               +hsync +vsync 
Monitor ranges (GTF): 56-75Hz V, 30-81kHz H, max dotclock 140MHz
Monitor name: SyncMaster
Serial number: HSCX900918
Checksum: 0x2d (valid)
khadas_support_mode 1280x1024p60hz
bestmode is 1280x1024p60hz, IEEEOUI 0x000000
DVI Mode
hpd_state=1
[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
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
** Invalid partition 2 **
** File not found /usr/share/fenix/logo/logo.bmp **
** Invalid partition 5 **
cvbs: outputmode[1280x1024p60hz] is invalid
vpp: vpp_matrix_update: 2
set hdmitx VIC = 782
config HPLL = 1080000 frac_rate = 1
pll[0xff63c320] reset 1 times
HPLL: 0xdb0004b3
config HPLL done
j = 21  vid_clk_div = 2
hdmitx: set enc for VIC: 782
hdmitx phy setting done
enc_vpu_bridge_reset[1312]
rx version is 1.4 or below  div=10
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 0
detect upgrade key
gpio: pin GPIOAO_4 (gpio 4) value is 1
InUsbBurn
noSof
sof timeout, reset usb phy tuning
Device: SDIO Port B
Manufacturer ID: 27
OEM: 5048
Name: SD32G 
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 29 GiB
mmc clock: 40000000
Bus Width: 4-bit
** Unrecognized filesystem type **
Device: SDIO Port B
Manufacturer ID: 27
OEM: 5048
Name: SD32G 
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 29 GiB
mmc clock: 40000000
Bus Width: 4-bit
** Unrecognized filesystem type **
** Unrecognized filesystem type **
(Re)start USB...
USB0:   USB3.0 XHCI init start
Register 3000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
scanning bus 0 for devices... 4 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 <NULL> 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 <size>
        read/write dtb, size is optional 
store key read/write addr <size>
        read/write key, size is optional 
store ddr_parameter read/write addr <size>
        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 0xd3e30ac0  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 <NULL> 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 <size>
        read/write dtb, size is optional 
store key read/write addr <size>
        read/write key, size is optional 
store ddr_parameter read/write addr <size>
        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 0xd3e30ac0  0x0  0x820] failed active slot = 0
active_slot: normal
Cannot find dev.
amlmmc cmd <NULL> 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 <size>
        read/write dtb, size is optional 
store key read/write addr <size>
        read/write key, size is optional 
store ddr_parameter read/write addr <size>
        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
saradc: 0x287, 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 <address>" command.
Aborting!
No FDT memory address configured. Please configure
the FDT address via "fdt addr <address>" command.
Aborting!
Hit Enter or space or Ctrl+C key to stop autoboot -- :  0 
pll tsensor avg: 0x1fff, u_efuse: 0x8158
temp1: 34
ddr tsensor avg: 0x203b, u_efuse: 0x814f
temp2: 36
device cool done
cfgload: start ...
cfgload: reading /boot.ini from mmc 0:1 ...
** File not found /boot.ini **
cfgload: no /boot.ini or empty file on mmc 0:1
cfgload: reading /boot/boot.ini from mmc 0:1 ...
G12B:BL:6e7c85:2a3b91;FEAT:E0F83180:402000;POC:F;RCY:0;EMMC:0;READ:0;0.

That might be from U-Boot. Some of the args are not the same between u-boot versions, hence, erase emmc to force a complete boot from SD.

1 Like