Khadas VIM3/VIM3L and VIM4 contains a 16 MB and 32 MB SPI-Flash that’s used as boot storage; so you can boot from it. This guide is about how to boot from the on-board SPI-Flash. Take VIM4 as a example.
note warn The U-Boot firmware that VIM3/VIM3L can use to burn to SPI is named
u-boot.bin, VIM4 is
The U-Boot for SPI-Flash is the same as eMMC U-Boot. We recommend using Fenix Script to build U-Boot, as it’s easy this way.
This guide assumes that you have already setup a basic build environment. If not, please refer to Fenix Usage.
- Setup Environment:
$ cd fenix
- Build U-Boot
$ make uboot
If successful, you will get a U-Boot for the SPI-Flash
u-boot.bin.spi.bin.signed, in the directory
u-boot.bin.signed to an SD-Card or Thumbdrive (U-Disk) and insert it into your board or load it via TFTP.
Setup serial debugging tool and boot to the U-Boot Command Line.
- Load U-Boot from SD-Card:
kvim4# load mmc 0 1080000 u-boot.bin.spi.bin.signed
- Load U-Boot from Thumbdrive (U-Disk):
kvim4# usb start
- Load U-Boot via TFTP
Please refer here about how to setup the TFTP.
kvim4# tftp 1080000 u-boot.bin.spi.bin.signed
kvim4# sf probe
If you want to boot from SPI-Flash, you have to setup the bootmode to SPI. The default bootmode is boot from eMMC.
- Check current bootmode:
kvim4# kbi bootmode r
Current bootmode is boot from eMMC.
- Setup bootmode to SPI:
kvim4# kbi bootmode w spi
Poweroff the system to make it available:
kvim4# kbi poweroff
POWER key to bootup, you will boot from the SPI-Flash.
kvim4# sf probe
Bootmode is boot from SPI, but the u-boot in SPI flash is corrupted, can’t enter u-boot command line.
1. If u-boot in eMMC is correct, you can try TST mode or try SPI MASKROM to boot from eMMC, then enter u-boot command line, erase the SPI flash or burn the new u-boot to SPI flash.
Don’t use your PC to supply the power, or you will enter usb burning mode!
2. U-Boot in eMMC is also corrupted, you have to try TST mode to enter usb burning mode, and flash the image to emmc, then follow
You need to connect the board to your host PC!