Dev/BeagleBone/BBB/From Scratch

From Embeded Linux (and more) Wiki by Nathael
< Dev‎ | BeagleBone‎ | BBB
Revision as of 16:30, 16 October 2019 by Drizzt (talk | contribs) (Created page with "== u-boot == Full [processors.wiki.ti.com/index.php/AM335x_U-Boot_User's_Guide AM335x U-Boot User's Guide] on ti wiki. === Grab the sources === git clone git://git.denx.de/u...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

u-boot

Full [processors.wiki.ti.com/index.php/AM335x_U-Boot_User's_Guide AM335x U-Boot User's Guide] on ti wiki.

Grab the sources

git clone git://git.denx.de/u-boot.git
cd u-boot/
git checkout v2017.03

Optional :

git checkout -b new_branch
(Replace "new_branch" with the name of your choice !)

Patches:

wget https://raw.github.com/eewiki/u-boot-patches/master/v2013.10/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch
patch -p1 < 0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch

Patched sources can be recovered on my server : uboot_***.tar.bz2.

Compile

Configure and Build:

mkdir -p ../Build/uboot/ ../Build/results/
rm -rf ../Build/uboot/*
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- O=../Build/uboot/ distclean
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- O=../Build/uboot/ am335x_boneblack_defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- O=../Build/uboot/ -j 8
cp ../Build/uboot/MLO ../Build/uboot/u-boot.img ../Build/results/

The resulting binaries are part of the results.tar.bz2 archive on my server.

You need both binaries as the BeagleBone Black processor (Texas Instrument AM335x), in SD card boot mode, will look for a file named "MLO", which must fit on the only available memory at this point : the instruction cache (128k minus 19k reserved for boot rom).

MLO stand for "Memory Locator" and is a "Secondary Program Loader (SPL)". It is in fact a reduced "1st stage" u-boot image, which in turns looks for a file named "u-boot.img" which the "2nd stage" uboot.

When always booting in the same known configuration it is possible to avoid the second stage u-boot and change the MLO configuration to look for a fixed name Linux kernel image and device tree and immediately load and run these instead.

Use

The MLO file must be on the first partition of the µSD card, which must be formated as FAT32 and flaged as bootable.

Configuration

Create the file ../Build/results/uEnv.txt
An example file can be found in the results.tar.bz2 archive on my server.

Linux Kernel

SD Card creation

Rootfs