How does Beagleboard determine if S2 is pressed during boot?

Hello,

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.

The S2 button is wired to SYS_BOOT2, all this does is change the boot rom’s boot sequence.

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…

Regards,

2 Likes

What are you using for encryption and how is it being enabled?

1 Like

Here’s one of them: cryptsetup / cryptsetup · GitLab

Hi @RobertCNelson,

Here are both boot logs,

SD card with Encryption (Not working)

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]

Kind regards,
Ciaran

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

uboot and kernel root on command line are mmcblk0
your errors are for mmcblk1

Shouldn’t they both be the same ?

1 Like

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.

Hi @RobertCNelson @benedict.hewson,

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?

Those files are packaged and stored under /opt/u-boot/bb-u-boot-am335x-evm/

debian@21-am335x-bbb:~$ tree /opt/u-boot/bb-u-boot-am335x-evm/
/opt/u-boot/bb-u-boot-am335x-evm/
├── install-mmcblk0.sh
├── install-mmcblk1.sh
├── install.sh
├── MLO
├── u-boot-dtb.img
└── u-boot.img

0 directories, 6 files

Regards,

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?

Thanks :slight_smile:

What exactly shows up in your serial boot log in this situation…

Regards,

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):


It’s booting fine, this isn’t a problem with u-boot, it’s a problem with the boot args…

Looking at above:

root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet those are default,

root=/dev/mapper/cryptarch rw that’s your’s…

So by making things easy for the every day user, i make things difficult for users wanting to do something else…

Looking at my old git log, you should be able to bypass these defaults with, in /boot/uEnv.txt

bootargs=console=ttyO0,115200n8 rootwait root=/dev/mapper/cryptarch rw

so try that to see what happens next…

Regards,

This is my existing uEnv.txt. It looks like it already contains what you’ve mentioned in the ‘setenv bootargs’ section .

However it’s possible you might see something else incorrect here.

#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0

uname_r=5.10.168-ti-r71
#uuid=
#dtb=

###U-Boot Overlays###
###Documentation: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays
###Master Enable
enable_uboot_overlays=1
###
###Overide capes with eeprom
uboot_overlay_addr0=/lib/firmware/BB-UART2-RS485-00A1.dtb
#uboot_overlay_addr1=<file1>.dtbo
#uboot_overlay_addr2=<file2>.dtbo
#uboot_overlay_addr3=<file3>.dtbo
###
###Additional custom capes
#uboot_overlay_addr4=<file4>.dtbo
#uboot_overlay_addr5=<file5>.dtbo
#uboot_overlay_addr6=<file6>.dtbo
#uboot_overlay_addr7=<file7>.dtbo
###
###Custom Cape
#dtb_overlay=<file8>.dtbo
###
###Disable auto loading of virtual capes (emmc/video/wireless/adc)
#disable_uboot_overlay_emmc=1
disable_uboot_overlay_video=1
#disable_uboot_overlay_audio=1
#disable_uboot_overlay_wireless=1
#disable_uboot_overlay_adc=1
###
###Cape Universal Enable
enable_uboot_cape_universal=1
###
###Debug: disable uboot autoload of Cape
#disable_uboot_overlay_addr0=1
#disable_uboot_overlay_addr1=1
#disable_uboot_overlay_addr2=1
#disable_uboot_overlay_addr3=1
###
###U-Boot fdt tweaks... (60000 = 384KB)
#uboot_fdt_buffer=0x60000
###U-Boot Overlays###

console=ttyO0,115200n8
#cmdline=coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet

bootcmd=echo RUNNING BOOT COMMAND!; mmc dev ${mmcdev}; if mmc rescan; then \
  if test -e ${devtype} ${mmcdev}:1 /uEnv.txt; then \
    setenv devtype mmc; \
    setenv bootpart 1; \
  else \
    setenv devtype mmc; \
    setenv bootpart 0; \
  fi; \
  setenv bootargs cryptdevice=UUID=b959fe48-451f-4f35-a6b6-e328eff1ac8b:cryptarch root=/dev/mapper/cryptarch rw keyfile=/keyfile rootwait console=ttyO0,115200n8 \
  if load mmc 0:1 0x81000000 vmlinuz-5.10.168-ti-r71; then\
      if load mmc 0:1 0x82000000 /dtbs/5.10.168-ti-r71/am335x-boneblack.dtb; then \
          if load mmc 0:1 0x82100000 initrd.img-5.10.168-ti-r71; then \
             bootz 0x81000000 0x82100000:${filesize} 0x82000000; \
          fi \
      fi \
  fi \
fi

uenvcmd=run bootcmd
#bootargs=console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait rw

cmdline=coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet root=/dev/mapper/cryptarch rw

#In the event of edid real failures, uncomment this next line:
#cmdline=coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet video=HDMI-A-1:1024x768@60e

#Use an overlayfs on top of a read-only root filesystem:
#cmdline=coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet overlayroot=tmpfs

##enable Generic eMMC Flasher:
#cmdline=init=/usr/sbin/init-beagle-flasher

OH dang! if your going to do that, just create /uEnv.txt and use the uenvcmd entry point:

				"echo Checking if uenvcmd is set ...;" \
				"if test -n ${uenvcmd}; then " \
					"gpio set 56;" \
					"echo Running uenvcmd ...;" \
					"run uenvcmd;" \
				"fi;" \

Regards,

Could you elaborate on this? I’m not familiar with uenvcmd

Making a second /uEnv.txt? Separate to /boot/uEnv.txt ?

Anything in the root directory won’t be available until later in boot because I have it encrypted.

Sorry I think I’m misunderstanding this :slight_smile:

its looking for /uEnv.txt in the first partition, as long as it’s fat32 and your encrypted partition is number 2: include/configs/ti_armv7_common.h · v2022.04-bbb.io-am335x-am57xx · BeagleBoard.org / u-boot · GitLab

uenvcmd=run my_custom_bootup

Regards,

Ok, so move my /boot/uEnv.txt to /uEnv.txt and include the uenvcmd=run my_custom_bootup.

How does this help getting the board to boot? Does my_custom_bootup just contain the same things I currently have in /boot/uEnv.txt

My boot partition is first but isn’t fat32, it’s nfts. And yes, my encrypted partition is partition 2.

it’ll allow you to specify your bootargs with out it being overridden behind the scene.

Regards,

1 Like