This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[FAQ] AM625: Generating Sitara AM62x/AM62Ax/AM64x GP Device bootable MMC/SD Card Images using SDK v8.6 and Yocto

Part Number: AM625

(also applicable to other AM62x, AM62Ax, AM64x, AM65x parts with minor changes)

Overview

During recent releases of the Processor SDK Linux SDKs v8.x several AM6x devices such as AM62x and AM64x were transitioned from the GP (General Purpose) device variant being directly supported by the Yocto build output and the SDK-provided binary MMC/SD card images to the HS-FS (High Security - Field Securable) device variant now being the new default. HS-FS device variants are now recommended to be used for both development and production, enabling a more seamless and consistent development experience throughout with a direct path to HS-SE (High Security - Security Enforcing) devices for field deployment after the key programming was performed. Any new Sitara AM6x development board or device obtained from TI should now be the of the HS-FS device variant and work out of the box with the associated/current Processor SDK Linux offering. See the AM62x SDK v8.6 GP to HS-FS Migration Guide for additional background on this.

Unfortunately with this transition any existing GP device based AM62x (and AM64x) boards will no longer boot with MMC/SD card images generated through Yocto or the ones supplied as part of the SDK. The reason for that is the AM6x initial boot binary (tiboot3.bin, this is the only file actually being loaded by ROM!) is specific to GP and HS-FS devices (as well as HS-SE devices), and will not allow booting the processor when used on an incompatible device, leading to a "blank screen" (no UART output or error message) type of experience. Fortunately, GP device-compatible boot binaries are still being provided by the current SDKs for a transitional phase, and the SDK-recommended solution to get existing GP-based boards to work is to manually copy/replace the tiboot3.bin image from a selection of files that is provided as part of the boot partition of the SDK images as follows:

$ ll /media/a0797059/boot/
total 2828
drwxr-xr-x  2 a0797059 a0797059  16384 Dec 31  1969 ./
drwxr-x---+ 3 root     root       4096 Mar 27 20:18 ../
-rw-r--r--  1 a0797059 a0797059 332430 Mar 27 13:50 tiboot3-am62x-gp-evm.bin
-rw-r--r--  1 a0797059 a0797059 335019 Mar 27 13:50 tiboot3-am62x-hs-evm.bin
-rw-r--r--  1 a0797059 a0797059 335019 Mar 27 13:50 tiboot3.bin
-rw-r--r--  1 a0797059 a0797059 961988 Mar 27 13:50 tispl.bin
-rw-r--r--  1 a0797059 a0797059 897880 Mar 27 13:50 u-boot.img
-rw-r--r--  1 a0797059 a0797059   1490 Mar 27 13:50 uEnv.txt

This E2E FAQ here outlines an alternative approach of updating the associated Yocto recipes to make the default image bootable on GP devices on the example of an AM62x device, but equally applies to similar scenarios involving devices like AM62Ax and AM64x after reworking the provided patch accordingly. This approach has the advantage of allowing any existing boards such as earlier versions of the AM62-SK development board that was shipped with a GP device to directly boot from MMC/SD card right out of the box without any manual modifications to the filesystem needed.

ExclamationNote: It is recommended to transition to HS-FS device variant at the earliest by replacing any existing GP device-based boards. Further note that future TI Processor SDK Linux releases (v9.x) will drop support for GP devices altogether, so the approach outlined here will no longer be applicable. This E2E FAQ here is intended to make the transition easier.

Updating the Yocto Recipes to make AM62x GP the Default

In order to switch the build output of the Yocto Dunfell-based SDK v8.6 for AM62x from HS-FS to the GP device variant several recipes need to be updated as follows:

  1. The machine-level configuration file located at meta-ti/conf/machine/include/am62xx.inc
  2. The k3r5 multi-config files used for generating the 3 distinct tiboot3.bin binaries located at meta-ti/conf/machine/am62xx-evm-k3r5-*.conf

While there's several ways to make the needed changes the approach chosen and presented here preserves the SDK-delivered approach of keeping and generating initial boot binaries for all 3 device variants by simply replacing the default "HS-FS" experience with an "GP" experience. This is done to still support HS-FS devices from the same build output. To make the needed changes simply apply the provided patch here to the meta-ti layer as follows:

$ cd sources/meta-ti
$ git am 0001-am62xx-evm-Make-AM62x-GP-device-variant-the-default-.patch

After the change was made you can start a Yocto image build outlined using the steps in the AM62x SDK v8.6 documentation under Building the SDK.

ExclamationWarning: Updating multi-config related recipes after some initial SDK builds were made using the original SDK sources may cause conflicts with existing temporary build files and even the shared state cache. In case you get new error messages trying to make your GP image build including but not limited to error messages along the lines of "The build has stopped, as continuing in this scenario WILL break things - if not now, possibly in the future (we've seen builds fail several months later). If the system knew how to recover from this automatically it would, however there are several different scenarios which can result in this and we don't know which one this is." it is strongly recommended to clean out or delete all temporary build folders including the shared state cache (or setup a new one).

After the build completes successfully and the MMC/SD card image is programmed the boot partition will look as below. Note that there is no longer a tiboot3-am62x-gp-evm.bin file (the tiboot3.bin file now is for GP devices), but instead there now is an extra tiboot3-am62x-hs-fs-evm.bin file not present with this specific name in the original SDK-provided MMC/SD card images.

$ ll /media/a0797059/boot/
total 2828
drwxr-xr-x  2 a0797059 a0797059  16384 Dec 31  1969 ./
drwxr-x---+ 3 root     root       4096 Mar 27 20:21 ../
-rw-r--r--  1 a0797059 a0797059 335019 Mar 27 20:05 tiboot3-am62x-hs-evm.bin
-rw-r--r--  1 a0797059 a0797059 335019 Mar 27 20:05 tiboot3-am62x-hs-fs-evm.bin
-rw-r--r--  1 a0797059 a0797059 332430 Mar 27 20:05 tiboot3.bin
-rw-r--r--  1 a0797059 a0797059 961988 Mar 27 20:05 tispl.bin
-rw-r--r--  1 a0797059 a0797059 897880 Mar 27 20:05 u-boot.img
-rw-r--r--  1 a0797059 a0797059   1490 Mar 27 20:05 uEnv.txt

Booting an AM62-SK GP Board with the SDK v8.6 SD Card Image

Below is a log of booting an MMC/SD card image built using MACHINE=am62xx-evm bitbake -k tisdk-base-image. Note how the AM62 GP device variant is detected and shown in the U-Boot log (SoC: AM62X SR1.0 GP) however the boot still proceeds.

U-Boot SPL 2021.01-g2ee8efd654 (Mar 28 2023 - 00:51:10 +0000)
SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.4--v08.06.04 (Chill Capybar')
SPL initial stack usage: 13424 bytes
Trying to boot from MMC2
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Loading Environment from MMC... *** Warning - No MMC card found, using default environment

Starting ATF on ARM64 core...

NOTICE:  BL31: v2.8(release):v2.8-226-g2fcd408bb3-dirty
NOTICE:  BL31: Built : 00:44:44, Mar 28 2023

U-Boot SPL 2021.01-g2ee8efd654 (Mar 28 2023 - 00:49:05 +0000)
SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.4--v08.06.04 (Chill Capybar')
Trying to boot from MMC2
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted


U-Boot 2021.01-g2ee8efd654 (Mar 28 2023 - 00:49:05 +0000)

SoC:   AM62X SR1.0 GP
Model: Texas Instruments AM625 SK
EEPROM not available at 0x50, trying to read at 0x51
Board: AM62-SKEVM rev E2
DRAM:  2 GiB
MMC:   mmc@fa10000: 0, mmc@fa00000: 1, mmc@fa20000: 2
Loading Environment from MMC... OK
In:    serial@2800000
Out:   serial@2800000
Err:   serial@2800000
Net:   eth0: ethernet@8000000port@1
Hit any key to stop autoboot:  0 
switch to partitions #0, OK
mmc1 is current device
SD/MMC found on device 1
Failed to load 'boot.scr'
1490 bytes read in 3 ms (484.4 KiB/s)
Loaded env from uEnv.txt
Importing environment from mmc1 ...
Running uenvcmd ...
1 bytes read in 3 ms (0 Bytes/s)
Already setup.
19147264 bytes read in 241 ms (75.8 MiB/s)
55666 bytes read in 5 ms (10.6 MiB/s)
## Flattened Device Tree blob at 88000000
   Booting using the fdt blob at 0x88000000
   Loading Device Tree to 000000008feef000, end 000000008fffffff ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 5.10.168-g2c23e6c538 (oe-user@oe-host) (aarch64-none-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10)) 9.2.1 20191025, GNU ld (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10)) 2.33.1.20191209) #1 SMP PREEMPT Tue Mar 28 00:49:42 UTC 2023
[    0.000000] Machine model: Texas Instruments AM625 SK
[    0.000000] earlycon: ns16550a0 at MMIO32 0x0000000002800000 (options '')
[    0.000000] printk: bootconsole [ns16550a0] enabled
[    0.000000] efi: UEFI not found.
[    0.000000] Reserved memory: created DMA memory pool at 0x000000009c800000, size 3 MiB
[    0.000000] OF: reserved mem: initialized node ipc-memories@9c800000, compatible id shared-dma-pool
[    0.000000] Reserved memory: created DMA memory pool at 0x000000009cb00000, size 1 MiB
[    0.000000] OF: reserved mem: initialized node m4f-dma-memory@9cb00000, compatible id shared-dma-pool
[    0.000000] Reserved memory: created DMA memory pool at 0x000000009cc00000, size 14 MiB
[    0.000000] OF: reserved mem: initialized node m4f-memory@9cc00000, compatible id shared-dma-pool
[    0.000000] Reserved memory: created DMA memory pool at 0x000000009da00000, size 1 MiB
[    0.000000] OF: reserved mem: initialized node r5f-dma-memory@9da00000, compatible id shared-dma-pool
[    0.000000] Reserved memory: created DMA memory pool at 0x000000009db00000, size 12 MiB
[    0.000000] OF: reserved mem: initialized node r5f-memory@9db00000, compatible id shared-dma-pool
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000080000000-0x00000000ffffffff]
[    0.000000]   DMA32    empty
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000080000000-0x000000009c7fffff]
[    0.000000]   node   0: [mem 0x000000009c800000-0x000000009e6fffff]
[    0.000000]   node   0: [mem 0x000000009e700000-0x000000009e77ffff]
[    0.000000]   node   0: [mem 0x000000009e780000-0x000000009fffffff]
[    0.000000]   node   0: [mem 0x00000000a0000000-0x00000000ffffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x00000000ffffffff]
[    0.000000] cma: Reserved 512 MiB at 0x00000000dd000000

....

[  OK  ] Started LSB: Expand Rootfs of boot device.

 _____                    _____           _         _   
|  _  |___ ___ ___ ___   |  _  |___ ___  |_|___ ___| |_ 
|     |  _| .'| . | . |  |   __|  _| . | | | -_|  _|  _|
|__|__|_| |__,|_  |___|  |__|  |_| |___|_| |___|___|_|  
              |___|                    |___|            

Arago Project am62xx-evm ttyS2

Arago 2021.09 am62xx-evm ttyS2

am62xx-evm login:


ExclamationNote: The messages "Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted" in the boot log result from running/booting AM62x SDK v08.06 artifacts on a General Purpose (GP) AM62x device variant and can be ignored. This is due to the default target of this SDK version being switched to High Security (HS-FS) device variants. See the AM62x SDK v8.6 GP to HS-FS Migration Guide for more background on this.

1856.0001-am62xx-evm-Make-AM62x-GP-device-variant-the-default-.patch