3. Building Buildroot Images

This document provides a step-by-step guide to build a Buildroot image using the buildroot-external-TI tree.

3.1. Prerequisites

  1. A Linux-based development environment.

  2. Required packages Required Packages.

For Debian/Ubuntu distributions, the necessary packages can be installed with the following command:

$ sudo apt install debianutils sed make binutils build-essential gcc g++ bash patch gzip bzip2 perl tar cpio unzip rsync file bc git

3.2. Steps to Build the Image

3.2.1. Setting up the External Tree

To set up and use the buildroot-external-ti external tree, follow these steps:

  1. Clone the Buildroot and external tree repositories:

$ git clone -b 2024.05.1 https://github.com/buildroot/buildroot
$ git clone -b 10.00.07 https://github.com/TexasInstruments/buildroot-external-TI.git
  1. Configure Buildroot to use the external tree and choose a configuration file

$ cd buildroot
During configuration
$ make BR2_EXTERNAL=<path to external tree>/buildroot-external-TI <configuration file>
OR
export BR2_EXTERNAL=<path to external tree>/buildroot-external-TI

3.2.2. Select the Build Configuration

Buildroot uses a configuration file to determine which packages and settings to use for the build. The buildroot-external-TI repository should provide one or more configuration files tailored to a specific board. Select the appropriate configuration file for your target device.

$ cd buildroot
$ make <defconfig>
For example, for AM62X-SK Linux build use ti_release_am62x_sk_defconfig
$ make ti_release_am62x_sk_defconfig

3.2.3. Customize the Configuration

If necessary, you can customize the configuration further using the menuconfig interface. This step is optional but useful if you need to make specific adjustments.

$ make menuconfig

3.2.4. Build the Image

With the configuration set, you can now build the image. This process compiles the necessary components and creates the root filesystem, kernel, and bootloader.

$ make TI_K3_BOOT_FIRMWARE_VERSION=10.00.07

The build process can take some time, depending on your system’s resources and the complexity of the configuration.

3.2.5. Locate the Output Files

Once the build is complete, the generated files will be located in the output/images directory. These files typically include the root filesystem image, the kernel image, and the bootloader.

You will find files ex. flashable SD card image sdcard.img, root filesytems rootfs.ext4 along with other build output files.

3.2.6. Flash the Image to SD Card

The final step is to flash the generated images to your target device. The specific steps for flashing will depend on your hardware. Common methods include using dd to write the image to an SD card or using a tool like Balena Etcher. for USB flashing.

Example for SD card:

$ sudo dd if=output/images/rootfs.ext2 of=/dev/sdX bs=4M
$ sync
Replace /dev/sdX with the appropriate device identifier for your SD card.

3.2.7. Booting the SD Card Image

After the image is flashed to SD Card. Change the boot mode pins in AM62x board for SD Card boot.

SW1[1:8] = 11000010 and SW2[1:8] = 01000000

Insert the SD Card in SD Card slot in AM62x board. Use a USB Micro-B cable to connect the host PC to the USB Micro-B interface for UART on the EVM then power on the board, the following logs can be observed on the terminal window:

U-Boot SPL 2024.04 (Aug 02 2024 - 09:56:18 +0000)
SYSFW ABI: 4.0 (firmware rev 0x000a '10.0.8--v10.00.08 (Fiery Fox)')
SPL initial stack usage: 13392 bytes
Trying to boot from MMC2
Authentication passed
Authentication passed
Authentication passed
...
...
...
Starting network: [    2.823578] am65-cpsw-nuss 8000000.ethernet eth0: PHY [8000f00.mdio:00] driver [TI DP83867] (irq=POLL)
[    2.823635] am65-cpsw-nuss 8000000.ethernet eth0: configuring for phy/rgmii-rxid link mode
udhcpc: started, v1.36.1
udhcpc: broadcasting discover
udhcpc: no lease, forking to background
[    5.944022] am65-cpsw-nuss 8000000.ethernet eth1: PHY [8000f00.mdio:01] driver [TI DP83867] (irq=POLL)
[    5.944130] am65-cpsw-nuss 8000000.ethernet eth1: configuring for phy/rgmii-rxid link mode
udhcpc: started, v1.36.1
udhcpc: broadcasting discover
udhcpc: no lease, forking to background
OK

Welcome to Buildroot
buildroot login: root
# uname -a
Linux buildroot 6.6.32 #1 SMP PREEMPT Tue Aug  6 11:40:07 UTC 2024 aarch64 GNU/Linux

3.3. Going further

For more detailed information, refer to the Buildroot manual.