# Buildroot on Beaglebone?

**URL:** <https://forum.digikey.com/t/buildroot-on-beaglebone/8675>\
**Category:** Linux Discussions\
**Created:** [September 14, 2020, 11:09am UTC](https://forum.digikey.com/t/buildroot-on-beaglebone/8675 "2020-09-14T11:09:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sam-bristow](https://sea2.discourse-cdn.com/digikey/user_avatar/forum.digikey.com/sam-bristow/32/9533_2.png) [@sam-bristow](https://forum.digikey.com/u/sam-bristow)\
**Post date:** [September 14, 2020, 11:09am UTC](https://forum.digikey.com/t/buildroot-on-beaglebone/8675/1 "2020-09-14T11:09:05Z")

</div>

I’m trying to get a Buildroot-based image working for the Beaglebone Green and Beaglebone Green Wireless.

I’m a bit confused about what’s required to get cape support working.

As far as I can tell the device-tree overlay stuff is handled by u-boot and then handed off to the Kernel as a Flattened Device Tree. Are the `CapeMgr` patches still required for both the kernel and u-boot?

Is there any up-to-date documentation about how the various parts are supposed to work together?

I’m using the **2020.05.x** LTS branch of Buildroot with the **5.6** kernel and **2020.04** u-boot.

---

<div class="post-metadata">

**Author:** ![RobertCNelson](https://sea2.discourse-cdn.com/digikey/user_avatar/forum.digikey.com/robertcnelson/32/12_2.png) [@RobertCNelson](https://forum.digikey.com/u/RobertCNelson)\
**Post date:** [September 14, 2020, 2:41pm UTC](https://forum.digikey.com/t/buildroot-on-beaglebone/8675/2 "2020-09-14T14:41:04Z")

</div>

> [@sam-bristow](#):
>
> As far as I can tell the device-tree overlay stuff is handled by u-boot and then handed off to the Kernel as a Flattened Device Tree. Are the `CapeMgr` patches still required for both the kernel and u-boot?
> 
> Is there any up-to-date documentation about how the various parts are supposed to work together?
> 
> I’m using the **2020.05.x** LTS branch of Buildroot with the **5.6** kernel and **2020.04** u-boot.

We only support u-boot overlays, with a single patch to the linux kernel “-@” for exporting the device tree label’s..

[https://github.com/RobertCNelson/bb-kernel/blob/am33x-v5.6/patches/drivers/ti/overlays/0001-ARM-DT-Enable-symbols-when-CONFIG\_OF\_OVERLAY-is-used.patch](https://github.com/RobertCNelson/bb-kernel/blob/am33x-v5.6/patches/drivers/ti/overlays/0001-ARM-DT-Enable-symbols-when-CONFIG_OF_OVERLAY-is-used.patch)

then you just need the 2 u-boot patches:

> [@Debian: Getting Started with the BeagleBone Black](https://forum.digikey.com/t/debian-getting-started-with-the-beaglebone-black/12967):
>
> This is a page about BeagleBoard’s TI Cortex-A8 based; BeagleBone Black. Availability Boards: [BeagleBone Black (Seeed)](https://www.digikey.com/en/products/detail/beagleboard-by-seeed-studio/102110420/12719590) at DigiKey [BeagleBone Black (GHI RevC)](https://www.digikey.com/en/products/detail/ghi-electronics-llc/BBB01-SC-505/6210999) at DigiKey [BeagleBone Black Industrial (Seeed RevD)](https://www.digikey.com/en/products/detail/beagleboard-by-seeed-studio/102110423/12342853) at DigiKey [BeagleBone Green (Seeed)](https://www.digikey.com/en/products/detail/seeed-technology-co-ltd/102010027/5482485) at DigiKey [BeagleBone Green Wireless (Seeed)](https://www.digikey.com/en/products/detail/seeed-technology-co-ltd/102010048/5965297) at DigiKey Power Supplies: [USB Micro for BeagleBone Green](https://www.digikey.com/en/products/detail/phihong-usa/PSA10F-050-R/4935858) at DigiKey Serial Cable: [(USB to serial adapter) TTL-232R-3V3](https://www.digikey.com/en/products/detail/ftdi-future-technology-devices-international-ltd/TTL-232R-3V3/1836393) at DigiKey [Raspberry Pi Serial Probe](https://www.digikey.com/en/products/detail/raspberry-pi/SC0889/17877576) at DigiKey Basic Requirements Running a…

Regards,

---

<div class="post-metadata">

**Author:** ![syrp](https://avatars.discourse-cdn.com/v4/letter/s/3bc359/32.png) [@syrp](https://forum.digikey.com/u/syrp)\
**Post date:** [September 28, 2020, 10:25pm UTC](https://forum.digikey.com/t/buildroot-on-beaglebone/8675/3 "2020-09-28T22:25:14Z")

</div>

Thanks for the quick response. I managed to get the patches applied and it looks like uboot is successfully querying the EEPROM. However, it doesn’t seem to actually load the firmware.

```
U-Boot SPL 2019.04-00002-g07d5700e21 (Mar 06 2020 - 11:24:55 -0600)
Trying to boot from MMC2
Loading Environment from EXT4... 
**Unable to use mmc 0:1 for loading the env**

U-Boot 2019.04-00002-g07d5700e21 (Mar 06 2020 - 11:24:55 -0600), Build: jenkins-github_Bootloader-Builder-137

CPU : AM335X-GP rev 2.1
I2C: ready
DRAM: 512 MiB
No match for driver 'omap_hsmmc'
No match for driver 'omap_hsmmc'
Some drivers were not found
Reset Source: Global external warm reset has occurred.
Reset Source: Global warm SW reset has occurred.
Reset Source: Power-on reset has occurred.
RTC 32KCLK Source: External.
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
Loading Environment from EXT4... 
**Unable to use mmc 0:1 for loading the env**
Board: BeagleBone Black
<ethaddr> not set. Validating first E-fuse MAC
BeagleBone Black:
Model: SeeedStudio BeagleBone Green:
debug: process_cape_part_number:[0060-0701]
debug: process_cape_part_number:[303036302d30373031]
BeagleBone: cape eeprom: i2c_probe: 0x54: /lib/firmware/0060-0701-00A0.dtbo [0x6b10b6f]
BeagleBone: cape eeprom: i2c_probe: 0x55:
BeagleBone: cape eeprom: i2c_probe: 0x56:
BeagleBone: cape eeprom: i2c_probe: 0x57:
Net: eth0: MII MODE
cpsw, usb_ether
Press SPACE to abort autoboot in 0 seconds
board_name=[BBG1] ...
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
83026 bytes read in 8 ms (9.9 MiB/s)
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc0 is current device
gpio: pin 54 (gpio 54) value is 1
Checking for: /uEnv.txt ...
434 bytes read in 2 ms (211.9 KiB/s)
gpio: pin 55 (gpio 55) value is 1
Loaded environment from /uEnv.txt
Importing environment from mmc ...
Checking if uenvcmd is set ...
gpio: pin 56 (gpio 56) value is 1
Running uenvcmd ...
5905032 bytes read in 372 ms (15.1 MiB/s)
loading /am335x-bonegreen.dtb ...
83026 bytes read in 9 ms (8.8 MiB/s)
bootargs=console=ttyS0,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait
## Flattened Device Tree blob at 88000000
   Booting using the fdt blob at 0x88000000
   Loading Device Tree to 8ffe8000, end 8ffff451 ... OK

Starting kernel ...

```

The `0060-0701-00A0.dtbo` is built from `BB-UART2-00A1.dts` in the the `bb.org-overlays` repo and with the part number and version changed before compiling it.

I can see the dtbo file in the right spot when I’m logged in:

```
$ ls -l /lib/firmware
total 1
-rw-r--r-- 1 root root 1024 Sep 15 2020 0060-0701-00A0.dtbo

```

If it matters, I’m using a merged /usr layout:

```
$ ls -l /lib
lrwxrwxrwx 1 root root 7 Sep 15 2020 /lib -> usr/lib

```

Do I need to do something else to get uboot to actually load the firmware?

---

<div class="post-metadata">

**Author:** ![RobertCNelson](https://sea2.discourse-cdn.com/digikey/user_avatar/forum.digikey.com/robertcnelson/32/12_2.png) [@RobertCNelson](https://forum.digikey.com/u/RobertCNelson)\
**Post date:** [September 29, 2020, 1:04am UTC](https://forum.digikey.com/t/buildroot-on-beaglebone/8675/4 "2020-09-29T01:04:14Z")

</div>

> [@syrp](#):
>
> ```auto
> hecking if uenvcmd is set ...
> gpio: pin 56 (gpio 56) value is 1
> Running uenvcmd ...
> 5905032 bytes read in 372 ms (15.1 MiB/s)
> loading /am335x-bonegreen.dtb ...
> 83026 bytes read in 9 ms (8.8 MiB/s)
> bootargs=console=ttyS0,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait
> ## Flattened Device Tree blob at 88000000
> Booting using the fdt blob at 0x88000000
> Loading Device Tree to 8ffe8000, end 8ffff451 ... OK
> 
> ```

“Running uenvcmd …” this means in your /uEnv.txt file you have the uenvcmd variable defined. This takes u-boot down a path to be compatible with anything ancient. Not use new things like overlays…

To make things work, please remove /uEnv.txt from your fat parition…

On your ext4 partition, create /boot/uEnv.txt

In it set these 3 variables:

```auto
uname_r=4.9.x
enable_uboot_overlays=1
uenv_root=/dev/mmcblk0p2

```

The uname\_r is really important, as that starts the search in the new path, u-boot is expecting: (So please take a look how you named zImage/vmlinuz-xyz)

```auto
rootfs: / (ext2/ext3/ext4) (btrfs supported in u-boot v2018.03+ (with both compression options))
/boot/uEnv.txt (priority 4)
/boot/vmlinuz-$(uname -r)
/boot/initrd.img-$(uname -r) (optional, but needed for uuid cases)
/boot/dtbs/$(uname -r)/*.dtb (or one of the 7 locations below)

```

device tree’s can be here:

```auto
(1) Mainline: /boot/dtbs/$(uname -r)/*.dtb
(2) Debian: /usr/lib/linux-image-$(uname -r)/*.dtb
(3) Ubuntu: /lib/firmware/$(uname -r)/device-tree/*.dtb
(4) Fedora: /boot/dtb-$(uname -r)/*.dtb
(5) archlinux: /boot/dtbs/*.dtb
(6) openSUSE: /boot/dtb/*.dtb
(7) OpenEmbedded: /boot/*.dtb

```

and sorry, this line needs to be changed:

> <https://github.com/RobertCNelson/Bootloader-Builder/blob/master/patches/v2019.04/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch#L1113>

“ro” → “rw” in debian we always mount ro, with buildroot this needs to be changed…

There’s currently a developer starting to make this generic and merge in upstream u-boot…

Regards,
