Android 12 aosp Flashing Instructions (FAIL) at: Issue:

Have a VIM3 Pro, I have built Android 12 from AOSP source a few times, anyhow,
When I follow these Instructions:

Flash Android Bootloader

cd path/to/aosp/device/amlogic/yukawa/bootloader/
./tools/update write u-boot_kvim3_noab.bin 0xfffa0000 0x10000
./tools/update run 0xfffa0000
./tools/update bl2_boot u-boot_kvim3_noab.bin

I get stuck here:

Transfer Complete! total size is 65536 Bytes
[update]Run at Addr fffa0000
AmlUsbRunBinCode:ram_addr=fffa0000
[LUSB][AMLC]dataSize=16384, offset=65536, seq 0
[LUSB]requestType=0
[LUSB]before wait sum
[LUSB]check sum OKAY
[LUSB][AMLC]dataSize=49152, offset=393216, seq 1
[LUSB]requestType=0
[LUSB]before wait sum
[LUSB]check sum OKAY
[LUSB][AMLC]dataSize=16384, offset=229376, seq 2
[LUSB]requestType=0
[LUSB]before wait sum
[LUSB]check sum OKAY
[LUSB][AMLC]dataSize=49152, offset=245760, seq 3
[LUSB]requestType=0
[LUSB]before wait sum
[LUSB]check sum OKAY
[LUSB][AMLC]dataSize=49152, offset=294912, seq 4
[LUSB]requestType=0
[LUSB]before wait sum
[LUSB]check sum OKAY
[LUSB][AMLC]dataSize=16384, offset=65536, seq 5
[LUSB]requestType=0
[LUSB]before wait sum
[LUSB]check sum OKAY
[LUSB][AMLC]dataSize=1135472, offset=81920, seq 6
[LUSB]requestType=0
[LUSB]before wait sum
[LUSB]check sum OKAY
[LUSB]BL2 END, waiting TPL plug-in...

I have even tried using: boot-g12.py u-boot_kvim3_noab.bin

and got this:

Firmware Version :
ROM: 3.2 Stage: 0.0
Need Password: 0 Password OK: 1
Writing u-boot_kvim3_noab.bin at 0xfffa0000...
[DONE]
Running at 0xfffa0000...
[DONE]
AMLC dataSize=16384, offset=65536, seq=0...
[DONE]
AMLC dataSize=49152, offset=393216, seq=1...
[DONE]
AMLC dataSize=16384, offset=229376, seq=2...
[DONE]
AMLC dataSize=49152, offset=245760, seq=3...
[DONE]
AMLC dataSize=49152, offset=294912, seq=4...
[DONE]
AMLC dataSize=16384, offset=65536, seq=5...
[DONE]
AMLC dataSize=1135472, offset=81920, seq=6...
[DONE]
[BL2 END]

But it seems to stick there, Never seems to inter fastboot mode so I can do the next set of commands:

fastboot oem format
fastboot flash bootloader u-boot_kvim3_noab.bin
fastboot erase bootenv
fastboot reboot bootloader

My TTL UART Screen is showing this:

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

BL2 Built : 16:01:39, May 25 2020. g12b gb6bfa83 - 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: 032825b0
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 : 16:01:44, May 25 2020. g12b gb6bfa83 - gongwei.chen@droid11-sz
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 : 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 00000029 00000029 00000028 00000029 00000029 00000029 00000028 00000028 00000028 00000027 00000026 00000028 0000002a 0000002a 0000002a 0000002a 00000028 00000028 0000 
 dram_vref_reg_value 0x 00000012
2D init succeed
ddr init done, boot next stage
result report
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
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.3394-7d43064d5 2020-05-07 15:37:11 gongwei.chen@droid11-sz]
OPS=0x10
ring efuse init
chipver efuse init
29 0b 10 00 01 12 08 00 00 17 31 34 32 58 33 50 
[0.016082 Inits done]
secure task start!
high task start!
low task start!
run into bl31
NOTICE:  BL31: v1.3(release):d9e1bbe85
NOTICE:  BL31: Built : 19:07:43, Sep  7 2020
NOTICE:  BL31: G12A normal boot!
NOTICE:  BL31: BL33 decompress pass
ERROR:   Error initializing runtime service opteed_fast


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:  3.8 GiB
MMC:   sd@ffe03000: 0, sd@ffe05000: 1, mmc@ffe07000: 2
Loading Environment from MMC... MMC partition switch failed
*** Warning - MMC partition switch failed, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   eth0: ethernet@ff3f0000
Hit any key to stop autoboot:  0 
Fastboot forced by usb rom boot
Running Fastboot...
crq->brequest:0x0

I am new to this device, and just need a push in the right direction. Have looked and googled and searched and anything else I can try… but No avail…

So could someone tell me what I need to flash this to my device…

I am unable to flash Android 12 AOSP firmware using the instructions provided for Windows.

VIM3_T_AOSP_V211126\fastboot_update\tools>flash_uboot_vim3.bat

Transfer Complete! total size is 65536 Bytes
[update]:Run at Addr fffa0000
AmlUsbRunBinCode:ram_addr=fffa0000
[LUSB]ERR(L1069):Fail in start cmd, ret=-5
[LUSB]ERR(L1172):fail in parse cmd, ret=-1070
errorlevel -1173
!!!Flash uboot failed!!!
Press any key to continue . . .

If I execute the commands one at a time:

  1. update write u-boot_kvim3_noab.bin 0xfffa0000 0x10000

    Transfer Complete! total size is 65536 Bytes

  2. update run 0xfffa0000
    [update]:Run at Addr fffa0000
    AmlUsbRunBinCode:ram_addr=fffa0000

The VIM3 reboots into Android 9 already installed on the eMMC. I can’t do anything about this. Please help. Thanks in advance.

@Eliminater74 - After attempting the first three basic instructions using Windows:

  1. update write u-boot_kvim3_noab.bin 0xfffa0000 0x10000
  2. update run 0xfffa0000
  3. update bl2_boot u-boot_kvim3_noab.bin

I was able to complete step 3:

VIM3_T_AOSP_V211126\fastboot_update\tools>update bl2_boot u-boot_kvim3_noab.bin
[LUSB]:[AMLC]dataSize=16384, offset=65536, seq 0
[LUSB]:requestType=0
[LUSB]:before wait sum
[LUSB]:check sum OKAY
[LUSB]:[AMLC]dataSize=49152, offset=393216, seq 1
[LUSB]:requestType=0
[LUSB]:before wait sum
[LUSB]:check sum OKAY
[LUSB]:[AMLC]dataSize=16384, offset=229376, seq 2
[LUSB]:requestType=0
[LUSB]:before wait sum
[LUSB]:check sum OKAY
[LUSB]:[AMLC]dataSize=49152, offset=245760, seq 3
[LUSB]:requestType=0
[LUSB]:before wait sum
[LUSB]:check sum OKAY
[LUSB]:[AMLC]dataSize=49152, offset=294912, seq 4
[LUSB]:requestType=0
[LUSB]:before wait sum
[LUSB]:check sum OKAY
[LUSB]:[AMLC]dataSize=16384, offset=65536, seq 5
[LUSB]:requestType=0
[LUSB]:before wait sum
[LUSB]:check sum OKAY
[LUSB]:[AMLC]dataSize=1110384, offset=81920, seq 6
[LUSB]:requestType=0
[LUSB]:before wait sum
[LUSB]:check sum OKAY
[LUSB]:BL2 END, waiting TPL plug-in…

Now I am in the same situation that you are in, my Vim3 fails to enter fastboot mode.

  1. fastboot devices
    {no devices}

Did you ever find a solution?

Installing Android 12 AOSP preview on Vim3 using Windows

Downloads:

  1. Install AMLogic WorldCup USB driver. This gets installed automatically when you install the AMLogic USB Burning Tool v2.2 for windows . At the end of the installation process, the WorldCup USB driver for windows will be installed. You need that to begin.
  2. Download [Firmware Page ].
  3. (https://dl.khadas.com/products/vim3/firmware/Android/VIM3_R_AOSP_V210604.tar.xz) to download the ROM.
  4. Download fastboot_update/tools for Windows here: Tools Page to download the flash tools.
  5. Download the “Google ADB Interface” driver from Khadas. They have a USB dirver .

Steps:

  1. Install AMLogic USB Burning Tool v2.2
  2. Unzip Android 12 ROM
  3. Unzip fastboot_update tools
  4. Unzip Vim3 AOSP USB Driver (Google ADB Interface)
  5. Open Command Terminal in Windows
  6. CD to /path/to/windows/fastboot_update directory
  7. Insert Vim3 into the Windows USB port and press the middle (of the three buttons) 3 times (1-2-3 press the middle button.
  8. Run set_path.bat (run as administrator just once)
  9. cd /path/to/AndroidROM and run “flash_vim3.bat”

IMPORTANT NOTE: At this point, the Vim3 is going to change how it reports to Windows as a USB device. Follow these steps:

  • Right click on Windows icon (bottom left)
  • Open Device Manager
  • You will see, “Other devices → USB download gadget” (see image)

Vim3USBDownloadGadget

Right click “USB download gadget” and “Update driver”
Select the USB folder that you just unzipped

You should see:


Unplug the Vim3 and plug it back in. Make sure you power cycle the Vim3.

:shushing_face:
At this point, you are ready to flash the ROM:

  1. Run flash_img.bat

EXPECTED OUTPUT:
λ flash_uboot_vim3.bat

Transfer Complete! total size is 65536 Bytes
[update]:Run at Addr fffa0000
AmlUsbRunBinCode:ram_addr=fffa0000
[LUSB]:[AMLC]dataSize=16384, offset=65536, seq 0
[LUSB]:requestType=0
[LUSB]:before wait sum
[LUSB]:check sum OKAY
[LUSB]:[AMLC]dataSize=49152, offset=393216, seq 1
[LUSB]:requestType=0
[LUSB]:before wait sum
[LUSB]:check sum OKAY
[LUSB]:[AMLC]dataSize=16384, offset=229376, seq 2
[LUSB]:requestType=0
[LUSB]:before wait sum
[LUSB]:check sum OKAY
[LUSB]:[AMLC]dataSize=49152, offset=245760, seq 3
[LUSB]:requestType=0
[LUSB]:before wait sum
[LUSB]:check sum OKAY
[LUSB]:[AMLC]dataSize=49152, offset=294912, seq 4
[LUSB]:requestType=0
[LUSB]:before wait sum
[LUSB]:check sum OKAY
[LUSB]:[AMLC]dataSize=16384, offset=65536, seq 5
[LUSB]:requestType=0
[LUSB]:before wait sum
[LUSB]:check sum OKAY
[LUSB]:[AMLC]dataSize=1110384, offset=81920, seq 6
[LUSB]:requestType=0
[LUSB]:before wait sum
[LUSB]:check sum OKAY
[LUSB]:BL2 END, waiting TPL plug-in…
< waiting for any device >

OKAY [ 0.030s]
finished. total time: 0.033s
target reported max download size of 117440512 bytes
sending ‘bootloader’ (1164 KB)…
OKAY [ 0.055s]
writing ‘bootloader’…
OKAY [ 0.113s]
finished. total time: 0.186s
erasing ‘bootenv’…
OKAY [ 0.235s]
finished. total time: 0.238s
rebooting into bootloader…
OKAY [ 0.005s]
finished. total time: 0.005s
!!!Flash uboot successfully!!!

λ fastboot devices
{cleaned-device} fastboot

λ flash_img.bat
target reported max download size of 117440512 bytes
sending ‘boot’ (22322 KB)…
OKAY [ 0.992s]
writing ‘boot’…
OKAY [ 1.179s]
finished. total time: 2.188s
target reported max download size of 117440512 bytes
sending sparse ‘super’ 1/13 (114684 KB)…
OKAY [ 5.546s]
writing ‘super’ 1/13…
OKAY [ 6.222s]
sending sparse ‘super’ 2/13 (114684 KB)…
OKAY [ 5.527s]
writing ‘super’ 2/13…
OKAY [ 6.116s]
sending sparse ‘super’ 3/13 (114684 KB)…
OKAY [ 5.380s]
writing ‘super’ 3/13…
OKAY [ 6.174s]
sending sparse ‘super’ 4/13 (114684 KB)…
OKAY [ 5.522s]
writing ‘super’ 4/13…
OKAY [ 6.331s]
sending sparse ‘super’ 5/13 (114685 KB)…
OKAY [ 5.833s]
writing ‘super’ 5/13…
OKAY [ 9.412s]
sending sparse ‘super’ 6/13 (114684 KB)…
OKAY [ 5.568s]
writing ‘super’ 6/13…
OKAY [ 6.063s]
sending sparse ‘super’ 7/13 (113860 KB)…
OKAY [ 5.509s]
writing ‘super’ 7/13…
OKAY [ 6.173s]
sending sparse ‘super’ 8/13 (113092 KB)…
OKAY [ 5.483s]
writing ‘super’ 8/13…
OKAY [ 6.216s]
sending sparse ‘super’ 9/13 (114684 KB)…
OKAY [ 5.527s]
writing ‘super’ 9/13…
OKAY [ 6.401s]
sending sparse ‘super’ 10/13 (112456 KB)…
OKAY [ 5.402s]
writing ‘super’ 10/13…
OKAY [ 5.856s]
sending sparse ‘super’ 11/13 (108412 KB)…
OKAY [ 5.309s]
writing ‘super’ 11/13…
OKAY [ 7.444s]
sending sparse ‘super’ 12/13 (114684 KB)…
OKAY [ 5.538s]
writing ‘super’ 12/13…
OKAY [ 6.089s]
sending sparse ‘super’ 13/13 (10216 KB)…
OKAY [ 0.500s]
writing ‘super’ 13/13…
OKAY [ 0.611s]
finished. total time: 145.923s
target reported max download size of 117440512 bytes
sending ‘cache’ (56 KB)…
OKAY [ 0.016s]
writing ‘cache’…
OKAY [ 0.017s]
finished. total time: 0.033s
target reported max download size of 117440512 bytes
sending ‘userdata’ (128 KB)…
OKAY [ 0.000s]
writing ‘userdata’…
OKAY [ 0.017s]
finished. total time: 0.049s
target reported max download size of 117440512 bytes
sending ‘recovery’ (30114 KB)…
OKAY [ 1.398s]
writing ‘recovery’…
OKAY [ 1.540s]
finished. total time: 2.954s
target reported max download size of 117440512 bytes
sending ‘dtbo’ (8 KB)…
OKAY [ 0.018s]
writing ‘dtbo’…
OKAY [ 0.000s]
finished. total time: 0.020s
rebooting…

finished. total time: 0.000s
!!!Flash some img successfully!!!

QUESTION?
I am receiving the following Android System message upon first boot of Android 12 preview. Is this expected? I read that the preview has known issues. Is there a list and when do we expect another release?

@byob11 Nice sharing. I am trying to reproduce steps in your post, but cannot download USB driver. Seems the link http://dl.khadas.com/test/androidusbdeviceclass_4.1.0.0_WHQL_105737.7z is not available now. Do you know where I can download it?

Hello @byob11

Thanks for sharing the steps.

I follow all the steps as you describe bellow, and the process is waiting for device…and stop here.

any suggestion to tackle this issue? It would be very appreciated for my side.

C:\khadas\VIM3_R_AOSP_V210604>flash_vim3.bat

Transfer Complete! total size is 65536 Bytes
[update]:Run at Addr fffa0000
AmlUsbRunBinCode:ram_addr=fffa0000
[LUSB]:[AMLC]dataSize=16384, offset=65536, seq 0
[LUSB]:requestType=0
[LUSB]:before wait sum
[LUSB]:check sum OKAY
[LUSB]:[AMLC]dataSize=49152, offset=393216, seq 1
[LUSB]:requestType=0
[LUSB]:before wait sum
[LUSB]:check sum OKAY
[LUSB]:[AMLC]dataSize=16384, offset=229376, seq 2
[LUSB]:requestType=0
[LUSB]:before wait sum
[LUSB]:check sum OKAY
[LUSB]:[AMLC]dataSize=49152, offset=245760, seq 3
[LUSB]:requestType=0
[LUSB]:before wait sum
[LUSB]:check sum OKAY
[LUSB]:[AMLC]dataSize=49152, offset=294912, seq 4
[LUSB]:requestType=0
[LUSB]:before wait sum
[LUSB]:check sum OKAY
[LUSB]:[AMLC]dataSize=16384, offset=65536, seq 5
[LUSB]:requestType=0
[LUSB]:before wait sum
[LUSB]:check sum OKAY
[LUSB]:[AMLC]dataSize=1122160, offset=81920, seq 6
[LUSB]:requestType=0
[LUSB]:before wait sum
[LUSB]:check sum OKAY
[LUSB]:BL2 END, waiting TPL plug-in…
< waiting for any device >

Another thing: the link of USB Drivers from Khadas is already down. Could you share the new one?

Thanks in advance