BeagleBone Black and U-boot

I have a BeagleBone Black (BBB) board and I am trying to use a toolkit called Depthcharge to evaluate U-boot. I downloaded the following image for BBB and flashed it to an SD Card and inserted it in the board.
Depthcharge has a Python script that needs to reach the U-boot shell in order to work, but it can’t do it. When I manually observe the booting sequence, I notice

Press SPACE to abort autoboot in 0 seconds

and when I still manage to get to the shell (manuallyby holding SPACE immediately when the boot starts) and try to setenv bootdelay to five, which I am not sure is the right approach, I get the following when the SD card is still inserted:

Saving Environment to EXT4… Unsupported feature metadata_csum found, not writ.
** Unable to write “/boot/uboot.env” from mmc0:1 **
Failed (1)
After I flash the eMMC and remove the SD Card and try the same thing, this is the output:
=> setenv bootdelay 5
=> saveenv
Saving Environment to EXT4… Failed (1)
Another thing worth mentioning is that when I flash the SD Card (using Etcher), I only get one ext4 rootfs partition with the boot flag, and I am not sure if another bootfs partition (FAT16?) is required, and if so, how to go about it.
Any kind of help would be very appreciated. Please keep in mind that I am still a newbie regarding the scope of embedded security.

Here is the complete Boot sequence from the SD Card in case it is needed to derive more information. Followed by the boot sequence from the eMMC.

U-Boot SPL 2022.04-ge0d31da5 (Aug 04 2023 - 18:48:26 +0000)
Trying to boot from MMC2

U-Boot 2022.04-ge0d31da5 (Aug 04 2023 - 18:48:26 +0000)

CPU : AM335X-GP rev 2.1
Model: TI AM335x BeagleBone Black
DRAM: 512 MiB
Reset Source: Power-on reset has occurred.
RTC 32KCLK Source: External.
Core: 150 devices, 14 uclasses, devicetree: separate
WDT: Started wdt@44e35000 with servicing (60s timeout)
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
Loading Environment from EXT4… ** File not found /boot/uboot.env **

** Unable to read “/boot/uboot.env” from mmc0:1 **
Board: BeagleBone Black
not set. Validating first E-fuse MAC
BeagleBone Black:
BeagleBone Cape EEPROM: no EEPROM at address: 0x54
BeagleBone Cape EEPROM: no EEPROM at address: 0x55
BeagleBone Cape EEPROM: no EEPROM at address: 0x56
BeagleBone Cape EEPROM: no EEPROM at address: 0x57
Net: eth2: ethernet@4a100000, eth3: usb_ether
Press SPACE to abort autoboot in 0 seconds
board_name=[A335BNLT] …
board_rev=[000C] …
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
Couldn’t find partition 0:2 0x82000000
Can’t set block device
Couldn’t find partition 0:2 0x82000000
Can’t set block device
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1…
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Scanning disk mmc@48060000.blk…
Scanning disk mmc@481d8000.blk…
Found 4 disks
No EFI system partition
BootOrder not defined
EFI boot manager: Cannot load any image
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 …
Checking for: /boot/uEnv.txt …
gpio: pin 55 (gpio 55) value is 1
1713 bytes read in 3 ms (557.6 KiB/s)
Loaded environment from /boot/uEnv.txt
Checking if uname_r is set in /boot/uEnv.txt…
gpio: pin 56 (gpio 56) value is 1
Running uname_boot …
loading /boot/vmlinuz-5.10.168-ti-r72 …
11325952 bytes read in 719 ms (15 MiB/s)
debug: [enable_uboot_overlays=1] …
debug: [enable_uboot_cape_universal=1] …
debug: [uboot_base_dtb_univ=am335x-boneblack-uboot-univ.dtb] …
uboot_overlays: [uboot_base_dtb=am335x-boneblack-uboot-univ.dtb] …
uboot_overlays: Switching too: dtb=am335x-boneblack-uboot-univ.dtb …
loading /boot/dtbs/5.10.168-ti-r72/am335x-boneblack-uboot-univ.dtb …
210757 bytes read in 18 ms (11.2 MiB/s)
Found 0 extension board(s).
uboot_overlays: [fdt_buffer=0x60000] …
uboot_overlays: loading /boot/dtbs/5.10.168-ti-r72/overlays/BB-ADC-00A0.dtbo …
645 bytes read in 5 ms (126 KiB/s)
uboot_overlays: loading /boot/dtbs/5.10.168-ti-r72/overlays/BB-BONE-eMMC1-01-00.
1605 bytes read in 6 ms (260.7 KiB/s)
uboot_overlays: loading /boot/dtbs/5.10.168-ti-r72/overlays/BB-HDMI-TDA998x-00A.
5321 bytes read in 5 ms (1 MiB/s)
loading /boot/initrd.img-5.10.168-ti-r72 …
7844660 bytes read in 503 ms (14.9 MiB/s)
debug: [console=ttyS0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/m.
debug: [bootz 0x82000000 0x88080000:77b334 88000000] …
Kernel image @ 0x82000000 [ 0x000000 - 0xacd200 ]

Flattened Device Tree blob at 88000000

Booting using the fdt blob at 0x88000000
Loading Ramdisk to 8f884000, end 8ffff334 … OK
Loading Device Tree to 8f7ec000, end 8f883fff … OK

Starting kernel …

[ 0.151535] l3-aon-clkctrl:0000:0: failed to disable
[ 8.531942] debugfs: Directory ‘49000000.dma’ with parent ‘dmaengine’ alread!
[ 8.563979] gpio-of-helper ocp:cape-universal: Failed to get gpio property o’
[ 8.564008] gpio-of-helper ocp:cape-universal: Failed to create gpio entry
[ 8.928376] mdio_bus 4a101000.mdio: mii_bus 4a101000.mdio couldn’t get resetO
[ 9.139058] omap_voltage_late_init: Voltage driver support not added
trap: EXIT: bad trap

The boot sequence from the eMMC.

U-Boot SPL 2022.04-ge0d31da5 (Aug 04 2023 - 18:48:26 +0000)
Trying to boot from MMC2

U-Boot 2022.04-ge0d31da5 (Aug 04 2023 - 18:48:26 +0000)

CPU : AM335X-GP rev 2.1
Model: TI AM335x BeagleBone Black
DRAM: 512 MiB
Reset Source: Global external warm reset has occurred.
Reset Source: Power-on reset has occurred.
RTC 32KCLK Source: External.
Core: 150 devices, 14 uclasses, devicetree: separate
WDT: Started wdt@44e35000 with servicing (60s timeout)
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
Loading Environment from EXT4… Board: BeagleBone Black
not set. Validating first E-fuse MAC
BeagleBone Black:
BeagleBone Cape EEPROM: no EEPROM at address: 0x54
BeagleBone Cape EEPROM: no EEPROM at address: 0x55
BeagleBone Cape EEPROM: no EEPROM at address: 0x56
BeagleBone Cape EEPROM: no EEPROM at address: 0x57
Net: eth2: ethernet@4a100000, eth3: usb_ether
Press SPACE to abort autoboot in 0 seconds
board_name=[A335BNLT] …
board_rev=[000C] …
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
mmc1(part 0) is current device
Scanning mmc 1:1…
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Scanning disk mmc@48060000.blk…
Disk mmc@48060000.blk not ready
Scanning disk mmc@481d8000.blk…
Found 2 disks
No EFI system partition
BootOrder not defined
EFI boot manager: Cannot load any image
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
mmc1(part 0) is current device
gpio: pin 54 (gpio 54) value is 1
Checking for: /uEnv.txt …
Checking for: /boot/uEnv.txt …
gpio: pin 55 (gpio 55) value is 1
1725 bytes read in 3 ms (561.5 KiB/s)
Loaded environment from /boot/uEnv.txt
Checking if uname_r is set in /boot/uEnv.txt…
gpio: pin 56 (gpio 56) value is 1
Running uname_boot …
loading /boot/vmlinuz-5.10.168-ti-r72 …
11325952 bytes read in 716 ms (15.1 MiB/s)
debug: [enable_uboot_overlays=1] …
debug: [enable_uboot_cape_universal=1] …
debug: [uboot_base_dtb_univ=am335x-boneblack-uboot-univ.dtb] …
uboot_overlays: [uboot_base_dtb=am335x-boneblack-uboot-univ.dtb] …
uboot_overlays: Switching too: dtb=am335x-boneblack-uboot-univ.dtb …
loading /boot/dtbs/5.10.168-ti-r72/am335x-boneblack-uboot-univ.dtb …
210757 bytes read in 17 ms (11.8 MiB/s)
Found 0 extension board(s).
uboot_overlays: [fdt_buffer=0x60000] …
uboot_overlays: loading /boot/dtbs/5.10.168-ti-r72/overlays/BB-ADC-00A0.dtbo …
645 bytes read in 4 ms (157.2 KiB/s)
uboot_overlays: loading /boot/dtbs/5.10.168-ti-r72/overlays/BB-BONE-eMMC1-01-00A0.dtbo …
1605 bytes read in 4 ms (391.6 KiB/s)
uboot_overlays: loading /boot/dtbs/5.10.168-ti-r72/overlays/BB-HDMI-TDA998x-00A0.dtbo …

Booting using the fdt blob at 0x88000000
Loading Ramdisk to 8f884000, end 8ffff334 … OK
Loading Device Tree to 8f7ec000, end 8f883fff … OK

Starting kernel …

[ 0.151629] l3-aon-clkctrl:0000:0: failed to disable
[ 8.536489] debugfs: Directory ‘49000000.dma’ with parent ‘dmaengine’ already present!
[ 8.568468] gpio-of-helper ocp:cape-universal: Failed to get gpio property of ‘P8_03’
[ 8.568494] gpio-of-helper ocp:cape-universal: Failed to create gpio entry
[ 8.932269] mdio_bus 4a101000.mdio: mii_bus 4a101000.mdio couldn’t get reset GPIO
[ 9.142889] omap_voltage_late_init: Voltage driver support not added
trap: EXIT: bad trap

I see the issue, with newer versions of mkfs.ext4, metadata_csum was not being disabled… I pushed two updates, will have an image to test in a few hours…

image generator: sdcard: ext4 partitions dd_spl_uboot_boot disable metadata_csum,64bit… · RobertCNelson/omap-image-builder@b5cef55 · GitHub

flasher: bb-beagle-flasher (1.20231211.0) · rcn-ee/repos@fd605f9 · GitHub

Regards,

Thank you for your reply, I appreciate it!

okay seems to be working…

am335x-debian-12.2-minimal-armhf-2023-10-07-2gb.img.xz

Press SPACE to abort autoboot in 0 seconds
=> setenv bootdelay 5
=> saveenv
Saving Environment to EXT4... Unsupported feature metadata_csum found, not writing.

** Unable to write "/boot/uboot.env" from mmc0:1 **
Failed (1)

am335x-debian-12.4-minimal-armhf-2023-12-11-2gb.img.xz

Press SPACE to abort autoboot in 0 seconds
=> setenv bootdelay 5
=> saveenv
Saving Environment to EXT4... File System is consistent
update journal finished
done
OK
=> 

My plan was to release… Index of /rootfs/release/2023-12-09 but let’s just switch to Index of /rootfs/snapshot/2023-12-11 (need to rsync snapshot → release later tonight…)… But yeah, lets scratch the 2023-12-09 and just call it 2023-12-11

Regards,

1 Like

Thank you so much for working on it. I unfortunately still have a problem that I hope you can help with.
When using am335x-debian-12.4-iot-armhf-2023-12-11-4gb.img.xz, I was able to replicate your output when booting from the SD card and I get a delay of five seconds.
But when I try to flash the eMMc with /usr/sbin/init-beagle-flasher and then boot the board without the SD card, I get the same previous error:

Press SPACE to abort autoboot in 0 seconds
=> setenv bootdelay 5
=> saveenv
Saving Environment to EXT4… Failed (1)

The same problem persists with am335x-eMMC-flasher-debian-12.4-iot-armhf-2023-12-11-4gb.img.xz

Thanks again.

This is a current limitation of the v2022.04 version of u-boot, you get one location for storage of the environment. Since we share u-boot with the BeagleBone White and PocketBeagle, (both without eMMC) we defaulted to storing on microSD (0:1)

Current Branch: Files · v2022.04-bbb.io-am335x-am57xx · BeagleBoard.org / u-boot · GitLab
ENV settings: bbb.io: am335x_evm set default env file /boot/uboot.env in microsd 0:1 ext4 (38275734) · Commits · BeagleBoard.org / u-boot · GitLab

If you want to store the env on emmc, just change:

CONFIG_ENV_EXT4_DEVICE_AND_PART="0:1"
CONFIG_ENV_EXT4_DEVICE_AND_PART="1:1"

Regards,