In this example the BBB will be booted using an SD card with a BOOT partition (FAT16) with an u-boot.img, MLO, linux kernel image (uImage) and device tree files. The u-boot will load the linux kernel and the device stored in the BOOT partition and will mount the root file system stored in the ROOTFS partition, also created in the SD card.
For this example I will use this versions:
| Software | Version |
|---|---|
| u-boot | v2020.10 |
| linux | 5.10.87-ti-r33 |
| gcc-linaro-gnueabihf | 12.0.0-2022.01 |
For removing previously compiled/generated object files:
make CROSS_COMPILE=arm-linux-gnueabihf- distcleanFor applying the default configuration for beaglebone black:
make CROSS_COMPILE=arm-linux-gnueabihf- am335x_evm_defconfigIf you want to configure any u-boot option:
make CROSS_COMPILE=arm-linux-gnueabihf- menuconfigFor compiling (using 4 threads, for other number of threads change -j4 option):
make CROSS_COMPILE=arm-linux-gnueabihf- -j4For removing previously compiled/generated object files:
make CROSS_COMPILE=arm-linux-gnueabihf- distcleanFor applying the default configuration:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- omap2plus_defconfigIf you want to configure any kernel option:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfigFor compiling:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- uImage dtbs LOADADDR=0x80008000 -j4For generating the kernel modules:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 modulesFor installing the kernel modules in the root file system (in this case the busybox compilation output):
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=<path of the RFS> modules_installYou need to create a BOOT partition format as FAT16 and a ROOTF partition format as EXT3.
Copy into the BOOT partition the MLO and the u-boot.img files generated from u-boot compilation process, you need to copy the uImage and the am335x-boneblack.dtb also. Finally copy the extlinux.conf file from this repository into a named folder extlinux, in the BOOT partition also (BOOT/extlinux/extlinux.conf).
Copy the root file system you want to use into the ROOTFS partition (for example, you can use root file system generated with busybox or using buildroot).
Refer to this link
For getting the project:
git clone git://git.buildroot.net/buildrootConfiguring for Beaglebone Black:
make beaglebone_defconfigConfiguring extra settings:
make menuconfig
Here you can disable the linux kernel and bootloader compilations. For taget options you can select NEON as floating point strategy and Thumb2 as ARM instruction set. And you need to select the filesystem images, ext2/3/4 variant (ext4), and select the format you use in the ROOTFS in your SD card.
For compiling:
makeFor copying the output root file system into the SD card (you can use lsblk command for knowing the mmc device in your PC):
sudo dd if=buildroot/output/images/rootfs.ext4 of=/dev/mmcblk0p2