Yocto EMMC Burning TI

From Variscite Wiki
Revision as of 21:03, 28 April 2023 by Nate (talk | contribs) (→‎Flashing eMMC using scripts)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Warning: This page is designed to be used with a 'release' URL parameter.

This page is using the default release am62-yocto-dunfell-5.10.168_08.06.00.42-v1.0.
To view this page for a specific Variscite SoM and software release, please follow these steps:

  1. Visit variwiki.com
  2. Select your SoM
  3. Select the software release
Installing Yocto to the SOM's internal storage

Introduction

The VAR-SOM-AM62 can boot from an SD card or from internal storage.

The Variscite VAR-SOM-AM62 comes with eMMC, which holds U-Boot, the kernel image and the ext4 root file system.

eMMC structure

The eMMC has the following structure:

Offset Address Offset (MiB) Size
Partition
Description
0x0 0 1 MiB Reserved Reserved
0x100000 1 MiB
128 MiB Boot Boot partition containing U-Boot images
0x8600000 134 MiB 1 MiB U-Boot Env Reserved for U-Boot environment.
0x8700000 135 MiB Rest of eMMC rootfs
An ext4 partition containing the root file system (including Linux image and the device tree blobs under /boot

For example, an 16 GiB eMMC has the following layout:

root@am62x-var-som:~# fdisk -l /dev/mmcblk0
Disk /dev/mmcblk0: 14.69 GiB, 15758000128 bytes, 30777344 sectors
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: 0xe3dbe120

Device         Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk0p1 *      2048   264191   262144  128M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      276480 30777343 30500864 14.6G 83 Linux

Installing the Yocto binaries

If you followed the Create a Recovery SD card steps, the Yocto binaries and the flashing scripts will be included in your SD card.

The flashing scripts are easy-to-use example scripts for flashing images into NAND flash / eMMC.

There is also a section below describing how to flash the images manually.

Images Locations

The following is the directory structure of the SD card, which includes the installation scripts and files for installation:

/usr/bin/install_yocto.sh
/usr/bin/echos.sh
/opt/images/Yocto/
/opt/images/Yocto/boot
/opt/images/Yocto/boot/u-boot.img
/opt/images/Yocto/boot/tiboot3.bin
/opt/images/Yocto/boot/tispl.bin
/opt/images/Yocto/boot/uEnv.txt
/opt/images/Yocto/rootfs.tar.zst

Prepare the images for flashing to eMMC

If you followed the Create a Recovery SD card steps, the Yocto binaries and the flashing scripts are already included in the sD card.

If you wish to add them manually, you can follow these steps to manually copy the mentioned yocto-built binaries to the SD card. The following steps assume the SD card is mounted on /media/rootfs:

Setup environment variables:

$ export YOCTO_IMGS_PATH=arago-tmp-external-arm-glibc/deploy/images/am62x-var-som
$ export P2_MOUNT_DIR=/media/rootfs/

Make directory for Yocto images:

$ sudo mkdir -p ${P2_MOUNT_DIR}/opt/images/Yocto/boot

Copy the images:

U-Boot:
$ sudo cp ${YOCTO_IMGS_PATH}/tiboot3-am62x-gp-evm.bin ${P2_MOUNT_DIR}/opt/images/Yocto/boot/tiboot3.bin
$ sudo cp ${YOCTO_IMGS_PATH}/tispl.bin ${P2_MOUNT_DIR}/opt/images/Yocto/boot/
$ sudo cp ${YOCTO_IMGS_PATH}/u-boot.img ${P2_MOUNT_DIR}/opt/images/Yocto/boot/
$ sudo cp ${YOCTO_IMGS_PATH}/uEnv.txt ${P2_MOUNT_DIR}/opt/images/Yocto/boot/

Filesystem:
$ sudo cp ${YOCTO_IMGS_PATH}/var-default-image-am62x-var-som.tar.zst ${P2_MOUNT_DIR}/opt/images/Yocto/rootfs.tar.zst

Flashing eMMC using scripts

The flashing scripts are located on the SD card at /usr/bin/:

install_yocto.sh	- Flash Yocto into eMMC (Run and follow usage instructions)

Flashing eMMC manually

Flashing the eMMC requires several steps including partitioning, file system formatting and image extraction.

Varsicite recommends using the provided scripts to perform this task. To flash it manually, you may review Variscite's example script: https://github.com/varigit/meta-variscite-sdk-ti/blob/dunfell_var01/scripts/variscite/am6_install_yocto.sh