Flashing a u-boot when it's failing to boot!

Hi! I’m working on some kernel work on VIM2 in my spare time and I’ve somehow managed to break the u-boot that’s installed on it. It just loops over the ROM boot. I’ve found a variety of instructions online to build recovery SD/USB images that the ROM code can boot but nothing has worked.

Is there a full USB or SD image I can grab that will be recognised by the ROM boot and flash a replacement u-boot? I’d really like to continue hacking on BSD on this thing. :slight_smile:



You need to enter MASKROM mode to reflash the ROM.

You can find some u-boot for Ubuntu here.


1 Like

Hi! thanks for replying! I really appreciate it!

Do you have instructions on what to do with these uboot bin files? I’m sorry, but I’m much more familar with MIPS boards and JTAG/NOR flash programming versus how these android-y boards implement recovery and secure boot.

I have both USB and SD media so I can try both.

For maskrom mode - what’s it do exactly? The site just says it allows the ROM to be flashed. But if I interpret my boot strings correctly, it looks like the ROM is fine and it’s just the second stage bootloader (ie, uboot) that needs replacing?


Just to be clear:

  • ROM boot looks like it’s working:


I’m missing the contents of EMMC, because I think I deleted it whilst tinkering with the SDMMC driver before i had put down a partition table.

I’m looking for how to populate a USB or an SD card with an image that can recover this unit. I’ve found plenty of u-boot images for the VIM2 board but I haven’t found instructions (or an image!) that I can put onto an USB/SD device to boot. Nothing I’ve tried so far has worked.


Hello, for maskrom pin location, see here
I have not flashed or recovered a VIM(2) from SD card, so unfortunately, I cannot help with that.

I have seen posts on this. I think @balbes150 has posts on this. If I find, I will post back.

hi! thanks!

How do you all put images on the EMMC that’s on board?

It looks like I have BL1 in ROM but not BL2 or uboot. Is BL2 in the on-board EMMC flash too? If so, where can I grab that?



When using u-boot-2015 (this version is used in the standard firmware of Khadas and on their website files with this version). You can use this instruction to write u-boot to SD card. To restore u-boot to eMMC, you can either run the firmware installation using a USB cable and the Built Tool, or write a “u-boot.bin” file with one “dd” command in eMMC. Please note, the files for SD card have the extension “u-boot.bin.sd.bin”, and for eMMC “u-boot.bin”. When using u-boot-2018, one common “uboot.bin” file is used for SD and eMMC.

1 Like

When you try to create an MBR partition table on an eMMC with the u-boot-2015 loader, you break the loader (it stops running). For this procedure, you need to use certain steps or a special script “create-mbr-linux.sh” from the Armbian image.

Version images Armbian 5.44 contain built-in u-boot-2015 models VIM2. If you burn the image to an SD card, you will be able to start the Armbian system from the SD card and perform any steps with eMMC (including u-boot recovery).

1 Like