Reflash factory firmware via fastboot?

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

Android13 from Khadas Github, built locally.

Which version of system do you use? Please provide the version of the system here:

khadas-edge2-android13 branch of android-manifest

Please describe your issue below:

Attempted to run adb reboot-bootloader followed by fastboot flashall with the images from the out folder. Got stuck on usermode fastboot, now the device will start booting the kernel, then suddenly reset to fastboot. Tried to manually flash the partition .img files from out/ but it didn’t help.

What’s the correct way to reflash the factory firmware via fastboot? In general, what’s the recommended way of flashing a custom Android13, when you have only USB connection, no network, no HDMI, no direct input?

Post a console log of your issue below:


...
[    6.034011][    T1] mpp_rkvenc2 fdbe0000.rkvenc-core: shutdown device
[    6.034587][    T1] mpp_rkvenc2 fdbe0000.rkvenc-core: shutdown success
[    6.035166][    T1] mpp_rkvenc2 fdbd0000.rkvenc-core: shutdown device
[    6.035728][    T1] mpp_rkvenc2 fdbd0000.rkvenc-core: shutdown success
[    6.089312][    T1] rk860-regulator 2-0042: rk860..... reset
[    6.090819][    T1] rk860-regulator 2-0042: force rk860x_reset ok!
[    6.091372][    T1] rk860-regulator 0-0043: rk860..... reset
[    6.092774][    T1] rk860-regulator 0-0043: force rk860x_reset ok!
[    6.093333][    T1] rk860-regulator 0-0042: rk860..... reset
[    6.094834][    T1] rk860-regulator 0-0042: force rk860x_reset ok!
[    6.096016][    T1] mpp_av1dec av1d-master: shutdown device
[    6.096534][    T1] mpp_av1dec av1d-master: shutdown success
[    6.097204][    T1] [WLAN_RFKILL]: Enter rfkill_wlan_shutdown
[    6.097711][    T1] [WLAN_RFKILL]: rockchip_wifi_power: 0
[    6.098186][    T1] [WLAN_RFKILL]: rockchip_wifi_power: toggle = false
[    6.098756][    T1] wifi power off
[    6.203264][    T1] [WLAN_RFKILL]: wifi shut off power [GPIO20-0]
[    6.203805][    T1] [WLAN_RFKILL]: rfkill_set_wifi_bt_power: 0
[    6.204729][    T1] rkisp_hw fdcc0000.rkisp: rkisp_hw_shutdown
[    6.205268][    T1] rkisp_hw fdcb0000.rkisp: rkisp_hw_shutdown
[    6.205821][    T1] mpp_rkvdec2 fdc48100.rkvdec-core: shutdown device
[    6.206385][    T1] mpp_rkvdec2 fdc48100.rkvdec-core: shutdown success
[    6.206990][    T1] mpp_rkvdec2 fdc38100.rkvdec-core: shutdown device
[    6.207562][    T1] mpp_rkvdec2 fdc38100.rkvdec-core: shutdown success
[    6.208231][    T1] mpp-iep2 fdbb0000.iep: shutdown device
[    6.208716][    T1] mpp-iep2 fdbb0000.iep: shutdown success
[    6.209230][    T1] mpp_vepu2 fdbac000.jpege-core: shutdown device
[    6.209771][    T1] mpp_vepu2 fdbac000.jpege-core: shutdown success
[    6.210349][    T1] mpp_vepu2 fdba8000.jpege-core: shutdown device
[    6.210892][    T1] mpp_vepu2 fdba8000.jpege-core: shutdown success
[    6.211462][    T1] mpp_vepu2 fdba4000.jpege-core: shutdown device
[    6.212012][    T1] mpp_vepu2 fdba4000.jpege-core: shutdown success
[    6.212580][    T1] mpp_vepu2 fdba0000.jpege-core: shutdown device
[    6.213130][    T1] mpp_vepu2 fdba0000.jpege-core: shutdown success
[    6.213712][    T1] mpp_jpgdec fdb90000.jpegd: shutdown device
[    6.214230][    T1] mpp_jpgdec fdb90000.jpegd: shutdown success
[    6.214813][    T1] mpp_vepu2 fdb50000.vepu: shutdown device
[    6.215310][    T1] mpp_vepu2 fdb50000.vepu: shutdown success
[    6.215817][    T1] mpp_vdpu2 fdb50400.vdpu: shutdown device
[    6.216312][    T1] mpp_vdpu2 fdb50400.vdpu: shutdown success
[    6.217057][    T1] xhci-hcd xhci-hcd.8.auto: remove, state 4
[    6.217569][    T1] usb usb6: USB disconnect, device number 1
[    6.218557][    T1] xhci-hcd xhci-hcd.8.auto: USB bus 6 deregistered
[    6.219250][    T1] xhci-hcd xhci-hcd.8.auto: remove, state 4
[    6.219762][    T1] usb usb5: USB disconnect, device number 1
[    6.220895][    T1] xhci-hcd xhci-hcd.8.auto: USB bus 5 deregistered
[    6.237358][    T1] reboot: Restarting system with command 'b\xEFDDR Version V1.07 20220412
LPDDR4X, 2112MHz
channel[0] BW=16 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=8 Size=4096MB
channel[1] BW=16 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=8 Size=4096MB
channel[2] BW=16 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=8 Size=4096MB
channel[3] BW=16 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=8 Size=4096MB
change to F1: 528MHz
change to F2: 1068MHz
change to F3: 1560MHz
change to F0: 2112MHz
out
U-Boot SPL board init
U-Boot SPL 2017.09 (Feb 14 2023 - 09:56:01)
Failed to set cpub01
Failed to set cpub23
I2c2 speed: 100000Hz
MCU: bootmode: 1, oowow 3
MCU: oowow 0
board_boot_order: /chosen found, using spl_boot_device()
!!! same-as-spl: 
!!! /mmc@fe2c0000: 
!!! /mmc@fe2e0000: 
!!! /spi@fe2b0000/flash@1: 
Trying to boot from MMC2 :: 0
Card did not respond to voltage select!
mmc_init: -95, time 12
spl: mmc init failed with error: -95
Trying to boot from MMC1 :: 1
Trying fit image at 0x4000 sector
## Verified-boot: 0
## Checking atf-1 0x00040000 ... sha256(241ea1f321...) + OK
## Checking uboot 0x00200000 ... sha256(c8eaebc31b...) + OK
## Checking fdt 0x00349a80 ... sha256(8d7553b27e...) + OK
## Checking atf-2 0x000f0000 ... sha256(aa71013e72...) + OK
## Checking atf-3 0xff100000 ... sha256(af08976afd...) + OK
## Checking optee 0x08400000 ... sha256(66e30bf9e8...) + OK
Jumping to U-Boot(0x00200000) via ARM Trusted Firmware(0x00040000)
Total: 130.20 ms

INFO:    Preloader serial: 2
NOTICE:  BL31: v2.3():v2.3-627-gb7c5102a2:derrick.huang
NOTICE:  BL31: Built : 14:52:40, Aug 10 2023
INFO:    spec: 0x13
INFO:    ext 32k is valid
INFO:    ddr: stride-en 4CH
INFO:    GICv3 without legacy support detected.
INFO:    ARM GICv3 driver initialized in EL3
INFO:    valid_cpu_msk=0xff bcore0_rst = 0x0, bcore1_rst = 0x0
INFO:    l3 cache partition cfg-0
INFO:    system boots from cpu-hwid-0
INFO:    idle_st=0x21fff, pd_st=0x11fff9, repair_st=0xfff70001
ERROR:   dfs get fsp_params[0] error, 0xfead0001 != 0xfead0004
ERROR:   dfs get fsp_params[1] error, 0xa54 != 0xfead0004
ERROR:   dfs get fsp_params[2] error, 0xbc != 0xfead0004
ERROR:   dfs get fsp_params[3] error, 0x3f0033 != 0xfead0004
ERROR:   loader&trust unmatch!!! Please update loader if need enable dmc
ERROR:   current trust bl31 need match with loader ddr bin V1.13 or newer
ERROR:   current loader need match with trust bl31 V1.07-V1.37
INFO:    BL31: Initialising Exception Handling Framework
INFO:    BL31: Initializing runtime services
INFO:    BL31: Initializing BL32
I/TC: 
I/TC: OP-TEE version: 3.13.0-743-gb5340fd65 #hisping.lin (gcc version 10.2.1 20201103 (GNU Toolchain for the A-profile Architecture 10.2-2020.11 (arm-10.16))) #6 Mon Aug 28 18:01:38 CST 2023 aarch64
I/TC: Primary CPU initializing
I/TC: Primary CPU switching to normal world boot
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x200000
INFO:    SPSR = 0x3c9


U-Boot 2017.09-ge3d24d162d-230907 #jk (Jun 18 2024 - 14:09:41 +0200)

Model: Khadas Board
MPIDR: 0x81000000
PreSerial: 2, raw, 0xfeb50000
DRAM:  15.7 GiB
Sysmem: init
Relocation Offset: eda14000
Relocation fdt: eb9fa760 - eb9fece0
CR: M/C/I
Using default environment

optee api revision: 2.0
mmc@fe2c0000: 1, mmc@fe2e0000: 0
Bootdev(atags): mmc 0
MMC0: HS400 Enhanced Strobe, 200Mhz
PartType: EFI
DM: v2
Android 13.0, Build 2023.8, v2
boot mode: bootloader
RESC: 'boot', blk@0x0001da50
Device is: UNLOCKED
DTB: rk-kernel.dtb
HASH(c): OK
ANDROID: fdt overlay OK
I2c0 speed: 100000Hz
vsel-gpios- not found!
en-gpios- not found!
vdd_cpu_big0_s0 800000 uV
vsel-gpios- not found!
en-gpios- not found!
vdd_cpu_big1_s0 800000 uV
I2c2 speed: 100000Hz
vsel-gpios- not found!
en-gpios- not found!
vdd_npu_s0 800000 uV
spi2: RK806: 2
ON=0x80, OFF=0x04
vdd_gpu_s0 750000 uV
vdd_cpu_lit_s0 750000 uV
vdd_log_s0 750000 uV
vdd_vdenc_s0 init 750000 uV
vdd_ddr_s0 850000 uV
gpio: pin 130 (gpio 130) value is 1
gpio: pin 100 (gpio 100) value is 1
I2c6 speed: 100000Hz
Error reading the chip: -121
TP05 id=0xffffff87
Error reading the chip: -121
TP10 id=0xffffff87
hlm khadas_mipi_id=0
old TS050 to parse panel init sequence
get vp0 plane mask:0x5, primary id:2, cursor_plane:-1, from dts
get vp1 plane mask:0xa, primary id:3, cursor_plane:-1, from dts
get vp2 plane mask:0x140, primary id:8, cursor_plane:-1, from dts
get vp3 plane mask:0x280, primary id:9, cursor_plane:-1, from dts
old TS050 to parse panel init sequence
Model: Khadas Edge2
MPIDR: 0x81000000
Rockchip UBOOT DRM driver version: v1.0.1
vp0 have layer nr:2[0 2 ], primary plane: 2
vp1 have layer nr:2[1 3 ], primary plane: 3
vp2 have layer nr:2[6 8 ], primary plane: 8
vp3 have layer nr:2[7 9 ], primary plane: 9
Using display timing dts
dsi@fde20000:  detailed mode clock 152198 kHz, flags[a]
    H: 1080 1184 1188 1315
    V: 1920 1924 1927 1929
bus_format: 100e
VOP update mode to: 1080x1920p60, type: MIPI0 for VP2
VP2 set crtc_clock to 152195KHz
VOP VP2 enable Esmart2[600x600->600x600@240x660] fmt[2] addr[0xedf06000]
final DSI-Link bandwidth: 1014633 Kbps x 4
command interface is busy: 0x10001
No FDT memory address configured. Default at 0x08300000
disable dsi0
(vpx_id=2)==(is_mipi_lcd_exit=0)=vp2 and vp3 status disable
0x8===>mode: 0x0 is_mipi_lcd_exit=0
command interface is busy: 0x10001
failed to write cmd0: -110
failed to send on cmds: -110
Using display timing dts
dsi@fde30000:  detailed mode clock 152198 kHz, flags[a]
    H: 1080 1184 1188 1315
    V: 1920 1924 1927 1929
bus_format: 100e
VOP update mode to: 1080x1920p60, type: MIPI1 for VP3
VP3 set crtc_clock to 150000KHz
VOP VP3 enable Esmart3[600x600->600x600@240x660] fmt[2] addr[0xedf06000]
final DSI-Link bandwidth: 1000000 Kbps x 4
command interface is busy: 0x10001
disable dsi1
(vpx_id=3)==(is_mipi_lcd_exit=0)=vp2 and vp3 status disable
0x8===>mode: 0x0 is_mipi_lcd_exit=0
command interface is busy: 0x10001
failed to write cmd0: -110
failed to send on cmds: -110
disp info 0, type:11, id:0
hdmi@fde80000 disconnected
enter fastboot!
CLK: (sync kernel. arm: enter 1008000 KHz, init 1008000 KHz, kernel 0N/A)
  b0pll 24000 KHz
  b1pll 24000 KHz
  lpll 24000 KHz
  v0pll 608783 KHz
  aupll 786431 KHz
  cpll 1500000 KHz
  gpll 1188000 KHz
  npll 850000 KHz
  ppll 1100000 KHz
  aclk_center_root 702000 KHz
  pclk_center_root 100000 KHz
  hclk_center_root 396000 KHz
  aclk_center_low_root 500000 KHz
  aclk_top_root 750000 KHz
  pclk_top_root 100000 KHz
  aclk_low_top_root 396000 KHz
gpio: pin 138 (gpio 138) value is 0
gpio: pin 139 (gpio 139) value is 1
gpio: pin 140 (gpio 140) value is 0
Net:   No ethernet found.
switch to partitions #0, OK
mmc0(part 0) is current device
Enter fastboot...OK


Hello @jktrx

@william.lin will help you then.

hi @jktrx ,

(1)we recommend flashing a custom rom via USB Flash Tool.
https://docs.khadas.com/products/sbc/edge2/install-os/install-os-into-emmc-via-usb-tool

(2)After compiling, you need to reload update.img when flashing.
the path of update.img:rockdev\Image-kedge2\update.img

https://docs.khadas.com/products/sbc/edge2/development/android/build-android

Thanks a lot @william.lin, I just flashed the official edge2-android-13-v240611.img from the website via rk-burn-tool and it worked! On reboot it started Android normally again and was reachable via ADB.