Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


Sidebar

products:sbc:common:development:create-flash-card

Create Flash Card

Introduction

Linux users can follow this guide to create a special TF card for “flashing” an OS into the eMMC. Windows users may use the following guides: Install OS into External Storage.

The process for VIM1, VIM2, VIM3 and VIM4 is similar, so we will use VIM1 as an example.

OS Installation TF Cards must use the FAT32 filesystem. Therefore, because the Ubuntu desktop image is larger then 4GB, it cannot be burned to the eMMC using this method.

Preparation

Prepare Your TF Card

Backup all important data, then remove all partitions on your TF card.

$ sudo fdisk /dev/sdX

Then create just 1 partition:

$ sudo fdisk /dev/sdX

Set the first sector to 4096.

The single partition should look like this:

Command (m for help): p
 
Disk /dev/sdc: 14.86 GiB, 15931539456 bytes, 31116288 sectors
Disk model: SD Card Reader
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x2914f327
 
Device     Boot Start      End  Sectors  Size Id Type
/dev/sdc1        4096 31116287 31112192 14.9G 83 Linux

The partition must start from 4096.

Create the Flash TF Card

Insert the TF card into your PC, make sure it is unmounted:

$ sudo umount /dev/sdX1

Format the TF card to FAT32:

$ sudo mkfs.vfat /dev/sdX1

Replace sdX with the correct device node on your PC.

Use dd to write the Bootloader/U-boot to the first sector of the TF card:

$ sudo dd if=u-boot.bin.sd.bin of=/dev/sdX conv=fsync,notrunc bs=1 count=444
$ sudo dd if=u-boot.bin.sd.bin of=/dev/sdX conv=fsync,notrunc bs=512 skip=1 seek=1

The U-Boot file u-boot.bin.sd.bin is built for TF card. The U-Boot file u-boot.bin is built for the eMMC.

Copy the OS image to your TF card.

Build the image yourself or download from our server.

Insert the TF card again, then run the following command:

$ cp -a aml_sdc_burn.ini update.img /media/XXX/9CE9-3938/

The file aml_sdc_burn.ini is a configuration file for U-Boot, it's purpose is to burn images into the eMMC. You can find it here.

The package in aml_sdc_burn.ini should match your OS image!

For example, the name of the OS image is update.img. So the package variable in aml_sdc_burn.ini should be specified as package = update.img.

Eject the TF card:

$ sudo eject /dev/sdX

Upgrade Using Your Flash TF Card

  1. Insert your OS installation TF card into your SBC, and power-on.
  2. Boot into upgrade mode.
  3. Wait till the flashing process completes.
  4. Eject the TF card, and reboot your SBC.
Last modified: 2022/07/06 05:31 by nick