VIM3 U-BOOT刷写后无fastboot,无法刷写镜像

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

Android

分支:repo init -u GitHub - khadas/android_manifest: AOSP for Khadas VIMs & Edges -b khadas-vim3-p-64bit

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

编译u-boot环境:5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64
usb连接vim3环境:Mac 15.2

Please describe your issue below:

问题是我的vim3屏ts050不亮,因为之前刷成aosp master分支了,网上找不到合适的方法。
现在想换成khadas-vim3-p-64bit分支,用于验证屏。

求助:怎么才能刷写成功khadas-vim3-p-64bit分支的镜像?感谢!

如下是详细操作过程:

由于uboot刷新成了aosp master编译的u-boot_kvim3_noab.bin,网上下载的镜像无法刷写,打印如下:
U-Boot 2021.07-00051-g79f19c6307 (Jul 12 2021 - 12:25:19 +0200) khadas-vim3

Model: Khadas VIM3
SoC: Amlogic Meson G12B (A311D) Revision 29:b (10:2)
DRAM: 2 GiB
MMC: sd@ffe03000: 0, sd@ffe05000: 1, mmc@ffe07000: 2
Loading Environment from MMC… *** Warning - bad CRC, using default environment

In: serial
Out: serial
Err: serial
Net: eth0: ethernet@ff3f0000
Hit any key to stop autoboot: 0
Verify GPT: success!
BCB: Bootloader boot…
Running Fastboot…
crq->brequest:0x0
command flashing unlock_critical not recognized.
command flashing unlock not recognized.
** Bad device specification mmc bootloader_a **
Couldn’t find partition mmc bootloader_a
** Bad device specification mmc bootloader **
Couldn’t find partition mmc bootloader
Starting download of 1600368 bytes

downloading of 1600368 bytes finished
… wrote 1600512 bytes to EMMC_BOOT1 at offset 1
** Bad device specification mmc bootloader-boot0_a **
Couldn’t find partition mmc bootloader-boot0_a
** Bad device specification mmc bootloader-boot0 **
Couldn’t find partition mmc bootloader-boot0
Starting download of 1600368 bytes

downloading of 1600368 bytes finished
** Bad device specification mmc bootloader-boot0 **
Couldn’t find partition mmc bootloader-boot0
** Bad device specification mmc bootloader-boot1_a **
Couldn’t find partition mmc bootloader-boot1_a
** Bad device specification mmc bootloader-boot1 **
Couldn’t find partition mmc bootloader-boot1
Starting download of 1600368 bytes

downloading of 1600368 bytes finished
** Bad device specification mmc bootloader-boot1 **
Couldn’t find partition mmc bootloader-boot1
** Bad device specification mmc env_a **
Couldn’t find partition mmc env_a
** Bad device specification mmc env **
Couldn’t find partition mmc env
** Bad device specification mmc env **
Couldn’t find partition mmc env
** Bad device specification mmc env **
Couldn’t find partition mmc env
resetting …
bl31 reboot reason: 0xd
……

于是在khadas-vim3-p-64bit分支上编译uboot:

source build/envsetup.sh
lunch kvim3-userdebug
cd bootloader/uboot/
./mk kvim3

将bootloader/uboot/build/u-boot.bin文件copy到MAC电脑
通过:python boot-g12.py u-boot.bin 刷写到vim3后,无fastboot,无法刷写后续的镜像;

在AOSP master分支上编译的u-boot_kvim3_noab.bin通过上述脚本刷写后,是有fastboot的。

Post a console log of your issue below:

如下串口打印,是刷写u-boot.bin过程的打印:
bl2_sta1
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: 19876780

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: 012f953e
board id: 8
Cfg max: 12, cur: 1. Board id: 255. Force loop cfg
DATA transfer complete…
Get wrong ddr fw magic! Error!!
fw parse done
DATA transfer complete…
AML DDR FW load done
DATA transfer complete…
PIEI prepare done
LPDDR4 probe

LPDDR4_PHY_V_0_1_22-Built : 14:57:26, Sep 1 2020. g12b g3c95fed - gongwei.chenz
ddr clk to 1608MHz
DATA transfer complete…

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 : ERROR : Training has failed!
Check phy result
INFO : End of initialization
INFO : End of MPR read delay center optimization
INFO : ERROR : Training has failed!
Cfg max: 12, cur: 2. Board id: 255. Force loop cfg
ddr probe id done
DATA transfer complete…
Get wrong ddr fw magic! Error!!
fw parse done
DATA transfer complete…
AML DDR FW load done
DATA transfer complete…
PIEI prepare done
LPDDR4 probe

LPDDR4_PHY_V_0_1_22-Built : 14:57:26, Sep 1 2020. g12b g3c95fed - gongwei.chenz
ddr clk to 1608MHz
DATA transfer complete…

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 : ERROR : Training has failed!
Check phy result
INFO : End of initialization
INFO : End of MPR read delay center optimization
INFO : ERROR : Training has failed!
Cfg max: 12, cur: 3. Board id: 255. Force loop cfg
ddr probe id done
DATA transfer complete…
Get wrong ddr fw magic! Error!!
fw parse done
DATA transfer complete…
AML DDR FW load done
DATA transfer complete…
PIEI prepare done
DDR4 probe

LPDDR4_PHY_V_0_1_22-Built : 14:57:26, Sep 1 2020. g12b g3c95fed - gongwei.chenz
ddr clk to 1320MHz
DATA transfer complete…

dmc_version 0001
Check phy result
INFO : End of initialization
INFO : End of read enable training
INFO : End of fine write leveling
INFO : ERROR : Training has failed!
Cfg max: 12, cur: 4. Board id: 255. Force loop cfg
ddr probe id done
DATA transfer complete…
Get wrong ddr fw magic! Error!!
fw parse done
DATA transfer complete…
AML DDR FW load done
DATA transfer complete…
PIEI prepare done
DDR4 probe

LPDDR4_PHY_V_0_1_22-Built : 14:57:26, Sep 1 2020. g12b g3c95fed - gongwei.chenz
ddr clk to 1320MHz
DATA transfer complete…

dmc_version 0001
Check phy result
INFO : End of initialization
INFO : End of read enable training
INFO : End of fine write leveling
INFO : ERROR : Training has failed!
Cfg max: 12, cur: 5. Board id: 255. Force loop cfg
ddr probe id done
DATA transfer complete…
Get wrong ddr fw magic! Error!!
fw parse done
DATA transfer complete…
AML DDR FW load done
DATA transfer complete…
PIEI prepare done
DDR3 probe

LPDDR4_PHY_V_0_1_22-Built : 14:57:26, Sep 1 2020. g12b g3c95fed - gongwei.chenz
ddr clk to 912MHz
DATA transfer complete…

dmc_version 0001
Check phy result
INFO : End of initialization
INFO : ERROR : Training has failed!
Cfg max: 12, cur: 6. Board id: 255. Force loop cfg
ddr probe id done
DATA transfer complete…
Get wrong ddr fw magic! Error!!
fw parse done
DATA transfer complete…
AML DDR FW load done
DATA transfer complete…
PIEI prepare done
DDR3 probe

LPDDR4_PHY_V_0_1_22-Built : 14:57:26, Sep 1 2020. g12b g3c95fed - gongwei.chenz
ddr clk to 912MHz
DATA transfer complete…

dmc_version 0001
Check phy result
INFO : End of initialization
INFO : ERROR : Training has failed!
Cfg max: 12, cur: 7. Board id: 255. Force loop cfg
ddr probe id done
DATA transfer complete…
Get wrong ddr fw magic! Error!!
fw parse done
DATA transfer complete…
AML DDR FW load done
DATA transfer complete…
PIEI prepare done
LPDDR4 probe

LPDDR4_PHY_V_0_1_22-Built : 14:57:26, Sep 1 2020. g12b g3c95fed - gongwei.chenz
ddr clk to 1392MHz
DATA transfer complete…

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 init succeed
DATA transfer complete…
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 0000001c 0000001b 0000001b 0000001b 0000001c 0000001b 000
dram_vref_reg_value 0x 00000061
2D init succeed
ddr init done, boot next stage
result report
auto size-- 65535DDR cs0 size: 1024MB
DDR cs1 size: 1024MB
DMC_DDR_CTRL: 00e0001bDDR size: 2048MB
cs0 DataBus test pass
cs1 DataBus test pass
cs0 AddrBus test pass
cs1 AddrBus test pass
DATA transfer complete…
DATA transfer complete…
Data req end
DATA transfer complete…
RUN bl2 usb boot
0.0;M3 CHK:0;cm4_sp_mode 0
[Image: g12b_v1.1.3396-c893a7153 2020-11-11 13:54:36 gongwei.chen@droid11-sz]
OPS=0x10
ring efuse init
chipver efuse init
29 0b 10 00 01 29 11 00 00 07 34 36 41 34 56 50
[0.016083 Inits done]
secure task start!
high task start!
low task start!
run into bl31
NOTICE: BL31: v1.3(release):5c909a099
NOTICE: BL31: Built : 17:18:21, Nov 20 2020
NOTICE: BL31: G12A normal boot!
NOTICE: BL31: BL33 decompress pass
ERROR: Error initializing runtime service opteed_fast

U-Boot 2015.01-ga584e58b128-dirty (Feb 01 2025 - 04:01:01)

DRAM: 2 GiB
Relocation Offset is: 76e23000
mmu cfg end: 0x80000000
mmu cfg end: 0x80000000
spi_post_bind(spifc): req_seq = 0
board init
[MSG]MMC init in usb
aml_priv->desc_buf = 0x0000000073e13a70
aml_priv->desc_buf = 0x0000000073e15db0
SDIO Port B: 0, SDIO Port C: 1
InUsbBurn
wait for phy ready count is 0
[MSG]sof
Set Addr 37
Get DT cfg
Get DT cfg
set CFG

Sounds like the issue mentioned here - VIM3 and VIM3L v14 [Khadas Docs]

Probably you can try reverting back to the u-boot from above link and then flash the u-boot that you are trying to flash.
Link to usb flash tool can be found here - VIM3/3L Install OS into eMMC via USB Flash Tool [Khadas Docs]

第一步:aml-burn-tool这个包不知道从哪里下载,并且我的网络有点问题,那个VIM3.uboot-mainline.emmc.aml.img也下载不了,这一步先没有做;
第二步:我直接先试了这里,工具刷第一遍试,提示:[0x10302001]Romcode/状态切换/等待设备接入/设备枚举异常,然后我又重新刷了一遍,提示烧录成功了。这一步做完之后,屏幕可以点亮了;

感谢你的提示,让我看到了曙光。

接上文,虽然屏幕能点亮,但是adb看不到

试验在vim3串口reboot fastboot后,可以看到停在了fastboot,但是fastboot在MAC上也发现不了。

这时我有点怀疑是环境问题了,重新连了一根usb线也是不行的。

但是看串口有打印类似这样的东西:
行 801: [ 4.976036@3] usb usb2: We don’t know the algorithms for LPM for this host, .
行 801: [ 4.976036@3] usb usb2: We don’t know the algorithms for LPM for this host, .
行 802: [ 4.976332@4] hub 2-0:1.0: USB hub found
行 812: [ 4.982204@4] dwc_otg: usb0: type: 2 speed: 0, config: 0, dma: 0, id: 0, phy0
行 844: [ 5.301190@3] usb 1-1: new high-speed USB device number 2 using xhci-hcd
行 844: [ 5.301190@3] usb 1-1: new high-speed USB device number 2 using xhci-hcd
行 845: [ 5.456151@3] hub 1-1:1.0: USB hub found

我怀疑是不是android P的版本、以及这个老版本的u-boot对MAC PC的usb兼容性不好,于是换到Windows PC上试了下,adb是能发现的……

这证明了我的猜想,于是我把vim3的接法在MAC PC的接法改了下,adb/fastboot也OK了,接法:
MAC PC – 扩展坞 – VIM3
(猜想扩展坞的USB相比MAC PC的USB更好被VIM3兼容)

总结下前面遇到的问题以及答案:
问题1:用aosp master编出来的u-boot_kvim3_noab.bin可以发现fastboot,而用khadas-vim3-p-64bit分支编出的u-boot.bin不能发现fastboot,是上面写的USB兼容性导致的问题,更换合适的PC或PC USB端口就可以了;
问题2:在u-boot_kvim3_noab.bin中刷bootloader.img提示Bad device specification mmc bootloader-boot0_a,是因为分区表不匹配,只能先python boot-g12.py u-boot.bin刷后,再刷写;(之前是因为问题1导致的失败,问题1解决后,这个实际是可以的)

1 Like