My question is: Where in ROM / MLO / uboot / other does the beagleboard store the S2 button value at boot time? I’m assuming this value is stored somewhere in the root partition and needs to be accessed during boot and due to my encrypted root partition it’s failing.
I have a beagleboard black industrial (5.10.168-ti-r71) which is booting from an SD card that has 2 partitions. 1: unencrypted boot partition. 2: LUKS encrypted root partition. The device boots as expected and decrypts/mounts the root partition when I boot by holding the S2 button. Since I’ll be booting this device remotely I need it to default to booting from uboot on the SD card so I don’t have to press the S2 button.
I cleared the first mB of memory on the eMMC to force the board to boot from SD card. This works (I can see the uboot version on the SD card being called in serial logs) however the board doesn’t boot and I get a failure to find /dev/mmcblk1p1 (See attached image)
I tried replacing the SD card with the same image, just with one change - no encryption. This SD card boots fully using uboot and all other files on the SD card.
This means your version of u-boot is not passing the correct boot args. Show a more complete serial boot log of before and after and we can help debug it…
U-Boot SPL 2022.04-00038-gbaca7b46 (Apr 05 2024 - 14:58:13 +0200)
Trying to boot from MMC1
U-Boot 2022.04-00038-gbaca7b46 (Apr 05 2024 - 14:58:13 +0200)
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... OK
Board: BeagleBone Black
BeagleBone Black:
Model: BeagleBone Black Industrial:
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=[EIA0] ...
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...
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.scr ...
Checking for: /boot/boot.scr ...
Checking for: /boot/uEnv.txt ...
gpio: pin 55 (gpio 55) value is 1
2669 bytes read in 3 ms (868.2 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-r71 ...
11305472 bytes read in 727 ms (14.8 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-r71/am335x-boneblack-uboot-univ.dtb ...
210757 bytes read in 21 ms (9.6 MiB/s)
uboot_overlays: [fdt_buffer=0x60000] ...
uboot_overlays: unable to find [mmc 0:1 /lib/firmware/BB-ADC-00A0.dtbo]...
uboot_overlays: unable to find [mmc 0:1 /lib/firmware/BB-UART2-RS485-00A1.dtb]...
uboot_overlays: unable to find [mmc 0:1 BB-BONE-eMMC1-01-00A0.dtbo]...
uboot_overlays: uboot loading of [BB-HDMI-TDA998x-00A0.dtbo] disabled by /boot/uEnv.txt [disable_uboot_overlay_video=1]...
loading /boot/initrd.img-5.10.168-ti-r71 ...
7725911 bytes read in 494 ms (14.9 MiB/s)
debug: [console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet root=/dev/mapper/cryptarch rw] ...
debug: [bootz 0x82000000 0x88080000:75e357 0x88000000] ...
Kernel image @ 0x82000000 [ 0x000000 - 0xac8200 ]
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
Loading Ramdisk to 8f8a1000, end 8ffff357 ... OK
Loading Device Tree to 8f86a000, end 8f8a0744 ... OK
Starting kernel ...
[ 0.152400] l3-aon-clkctrl:0000:0: failed to disable
[ 10.450042] debugfs: Directory '49000000.dma' with parent 'dmaengine' already present!
[ 10.482694] gpio-of-helper ocp:cape-universal: Failed to get gpio property of 'P8_03'
[ 10.482722] gpio-of-helper ocp:cape-universal: Failed to create gpio entry
[ 10.933292] mdio_bus 4a101000.mdio: mii_bus 4a101000.mdio couldn't get reset GPIO
[ 11.109353] omap_voltage_late_init: Voltage driver support not added
cryptsetup: cryptarch: set up successfully
[ TIME ] Timed out waiting for device /dev/mmcblk1p1.
[DEPEND] Dependency failed for File…ystem Check on /dev/mmcblk1p1.
[DEPEND] Dependency failed for /media.
[DEPEND] Dependency failed for Local File Systems.
You are in emergency mode. After logging in, type "journalctl -xb" to view
system logs, "systemctl reboot" to reboot, "systemctl default" or "exit"
to boot into default mode.
Give root password for maintenance
(or press Control-D to continue):
SD card without Encryption (Working)
U-Boot SPL 2022.04-ge0d31da5 (Aug 04 2023 - 18:48:26 +0000)
Trying to boot from MMC1
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
<ethaddr> not set. Validating first E-fuse MAC
BeagleBone Black:
Model: BeagleBone Black Industrial:
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=[EIA0] ...
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...
Scanning disk mmc@48060000.blk...
Scanning disk mmc@481d8000.blk...
Found 3 disks
No EFI system partition
fdt_find_or_add_subnode: memory: FDT_ERR_BADSTRUCTURE
ERROR: arch-specific fdt fixup failed
- must RESET the board to recover.
ERROR: failed to process device tree
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
1736 bytes read in 3 ms (564.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-r71 ...
11305472 bytes read in 712 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-r71/am335x-boneblack-uboot-univ.dtb ...
210757 bytes read in 19 ms (10.6 MiB/s)
Found 0 extension board(s).
uboot_overlays: [fdt_buffer=0x60000] ...
uboot_overlays: loading /boot/dtbs/5.10.168-ti-r71/overlays/BB-ADC-00A0.dtbo ...
645 bytes read in 5 ms (126 KiB/s)
uboot_overlays: loading /lib/firmware/BB-UART2-RS485-00A1.dtb ...
1479 bytes read in 10 ms (143.6 KiB/s)
uboot_overlays: loading /boot/dtbs/5.10.168-ti-r71/overlays/BB-BONE-eMMC1-01-00A0.dtbo ...
1605 bytes read in 5 ms (313.5 KiB/s)
uboot_overlays: uboot loading of [BB-HDMI-TDA998x-00A0.dtbo] disabled by /boot/uEnv.txt [disable_uboot_overlay_video=1]...
loading /boot/initrd.img-5.10.168-ti-r71 ...
7719588 bytes read in 493 ms (14.9 MiB/s)
debug: [console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet] ...
debug: [bootz 0x82000000 0x88080000:75caa4 88000000] ...
Kernel image @ 0x82000000 [ 0x000000 - 0xac8200 ]
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
Loading Ramdisk to 8f8a3000, end 8ffffaa4 ... OK
Loading Device Tree to 8f80c000, end 8f8a2fff ... OK
Starting kernel ...
[ 0.152320] l3-aon-clkctrl:0000:0: failed to disable
[ 9.747362] debugfs: Directory '49000000.dma' with parent 'dmaengine' already present!
[ 9.780173] gpio-of-helper ocp:cape-universal: Failed to get gpio property of 'P8_03'
[ 9.780201] gpio-of-helper ocp:cape-universal: Failed to create gpio entry
[ 10.202755] mdio_bus 4a101000.mdio: mii_bus 4a101000.mdio couldn't get reset GPIO
[ 10.399173] omap_voltage_late_init: Voltage driver support not added
Debian GNU/Linux 11 BeagleBone ttyO0
BeagleBoard.org Debian Bullseye IoT Image 2023-09-02
Support: https://bbb.io/debian
default username:password is [debian:temppwd]
I’m using cryptsetup to create a LUKS encrypted partition on the SD card. The decryption is handled by Initramfs during boot. I had to build a custom Initramfs to add cryptographic hook and also edit /etc/fstab /etc/crypttab
My understanding is mmcblk0 refers to the device we boot from in this case the SD card, so mmcblk1 refers to the eMMC. Since I use Initramfs to mount the eMMC during boot (I have files stored here) I think the errors I’m getting are possibly caused when trying to mount eMMC?
But I’m unsure as to how this setup boots successfully when I hold the S2 button but after removing uboot off the eMMC and forcing it to boot from SD card without pressing S2 I get these errors.
Is it possible to download the MLO and .img files for this exact build of uboot: U-Boot SPL 2022.04-ge0d31da5 (Aug 04 2023 - 18:48:26 +0000).
This is built directly into: AM335x 11.7 2023-09-02 4GB microSD IoT so I can’t access these files for copying. Alternatively is there guide to build this myself with the necessary changes?
Thanks, I’ve now flashed these files to SD/eMMC for testing.
Unfortunately I get the same result. I’ve observed the following behavior that might help diagnosing the problem:
When the eMMC contains the uboot it was shipped with (2019.04-00002-g31a8ae0206) and I hold S2 button, the board boots (using 2022 uboot from SD card)
When the first mB of eMMC is cleared and I boot (with or without S2 held), the board doesn’t boot and I get the same errors mentioned previously.
I’m wondering is there anything else on the eMMC that’s necessary other than uboot (MLO and u-boot.img) that’s required to boot? Or can you suggest some u-boot terminal commands to compare both boot arguments?
U-Boot SPL 2022.04-ge0d31da5 (Aug 04 2023 - 18:48:26 +0000)
Trying to boot from MMC1
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
<ethaddr> not set. Validating first E-fuse MAC
BeagleBone Black:
Model: BeagleBone Black Industrial:
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=[EIA0] ...
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
2669 bytes read in 3 ms (868.2 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-r71 ...
11305472 bytes read in 722 ms (14.9 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-r71/am335x-boneblack-uboot-univ.dtb ...
210757 bytes read in 19 ms (10.6 MiB/s)
Found 0 extension board(s).
uboot_overlays: [fdt_buffer=0x60000] ...
uboot_overlays: loading /boot/dtbs/5.10.168-ti-r71/overlays/BB-ADC-00A0.dtbo ...
645 bytes read in 6 ms (104.5 KiB/s)
uboot_overlays: unable to find [mmc 0:1 /lib/firmware/BB-UART2-RS485-00A1.dtb]...
uboot_overlays: loading /boot/dtbs/5.10.168-ti-r71/overlays/BB-BONE-eMMC1-01-00A0.dtbo ...
1605 bytes read in 5 ms (313.5 KiB/s)
uboot_overlays: uboot loading of [BB-HDMI-TDA998x-00A0.dtbo] disabled by /boot/uEnv.txt [disable_uboot_overlay_video=1]...
loading /boot/initrd.img-5.10.168-ti-r71 ...
7725911 bytes read in 494 ms (14.9 MiB/s)
debug: [console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet root=/dev/mapper/cryptarch rw] ...
debug: [bootz 0x82000000 0x88080000:75e357 88000000] ...
Kernel image @ 0x82000000 [ 0x000000 - 0xac8200 ]
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
Loading Ramdisk to 8f8a1000, end 8ffff357 ... OK
Loading Device Tree to 8f80a000, end 8f8a0fff ... OK
Starting kernel ...
[ 0.152264] l3-aon-clkctrl:0000:0: failed to disable
[ 9.969376] debugfs: Directory '49000000.dma' with parent 'dmaengine' already present!
[ 10.002134] gpio-of-helper ocp:cape-universal: Failed to get gpio property of 'P8_03'
[ 10.002162] gpio-of-helper ocp:cape-universal: Failed to create gpio entry
[ 10.433256] mdio_bus 4a101000.mdio: mii_bus 4a101000.mdio couldn't get reset GPIO
[ 10.631901] omap_voltage_late_init: Voltage driver support not added
cryptsetup: cryptarch: set up successfully
[ TIME ] Timed out waiting for device /dev/mmcblk1p1.
[DEPEND] Dependency failed for /media.
[DEPEND] Dependency failed for Local File Systems.
[DEPEND] Dependency failed for File…ystem Check on /dev/mmcblk1p1.
You are in emergency mode. After logging in, type "journalctl -xb" to view
system logs, "systemctl reboot" to reboot, "systemctl default" or "exit"
to boot into default mode.
Give root password for maintenance
(or press Control-D to continue):