Problem loading correct overlay to use the config-pin tool

I am a newbie when it comes to how the Device tree overlay really works, so sorry in advance.

I would like to use the config-pin tool to configure gpio’s on my BBB.

I am using the Debian Buster IOT image.

Trying to query pin P8.11
debian@beaglebone:~$ config-pin -q p8.11
ERROR: open() for /sys/devices/platform/ocp/ocp:P8_11_pinmux/state failed, No such file or directory

I am able to query pin P9.20
config-pin -q p9.20
Current mode for P9_20 is: default

So I guess this means that the correct overlay file is not loaded to support P8.11 etc ?

The /boot/uEnv.txt is unchanged (came with Buster IOT), and it does have
enable_uboot_overlays=1
and
enable_uboot_cape_universal=1
I am unsure which dts this setting loads ? cape-universal-00A0.dts ?

Are all overlay files placed in /boot/dtbs/4.19.94-ti-r42 ?
I can see that BB_ADC-00A0 is loaded, but where is it placed, since it is not in above path ?

debian@beaglebone:~$ sudo /opt/scripts/tools/version.sh
[sudo] password for debian:
git:/opt/scripts/:[b39ec679648a6be8f25f48bd1c9784c1fc5a0c46]
eeprom:[A335BNLTEIA02046SBI10516]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[BeagleBoard.org Debian Buster IoT Image 2020-04-06]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2019.04-00002-g07d5700e21]:[location: dd MBR]
UBOOT: Booted Device-Tree:[am335x-boneblack.dts]
UBOOT: Loaded Overlay:[AM335X-PRU-RPROC-4-19-TI-00A0]
UBOOT: Loaded Overlay:[BB-ADC-00A0]
kernel:[4.19.94-ti-r42]
/boot/uEnv.txt Settings:
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-19-TI-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade <pkg>]
pkg:[bb-cape-overlays]:[4.14.20200403.0-0rcnee0~buster+20200403]
WARNING:pkg:[bb-wl18xx-firmware]:[NOT_INSTALLED]
pkg:[kmod]:[26-1]
pkg:[librobotcontrol]:[1.0.4-git20190227.1-0rcnee0~buster+20190327]
pkg:[firmware-ti-connectivity]:[20190717-2rcnee1~buster+20200305]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal bluetooth netdev i2c gpio pwm eqep remoteproc admin spi iio docker tisdk weston-launch xenomai cloud9ide]
cmdline:[console=ttyO0,115200n8 root=/dev/mmcblk1p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet]
dmesg | grep remote
[   30.550838] remoteproc remoteproc0: wkup_m3 is available
[   30.613455] remoteproc remoteproc0: powering up wkup_m3
[   30.613491] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217168
[   30.613788] remoteproc remoteproc0: remote processor wkup_m3 is now up
[   34.230521] remoteproc remoteproc1: 4a334000.pru is available
[   34.243524] remoteproc remoteproc2: 4a338000.pru is available
dmesg | grep pru
[   34.230521] remoteproc remoteproc1: 4a334000.pru is available
[   34.230682] pru-rproc 4a334000.pru: PRU rproc node pru@4a334000 probed successfully
[   34.243524] remoteproc remoteproc2: 4a338000.pru is available
[   34.243709] pru-rproc 4a338000.pru: PRU rproc node pru@4a338000 probed successfully
dmesg | grep pinctrl-single
[    0.820304] pinctrl-single 44e10800.pinmux: 142 pins, size 568
dmesg | grep gpio-of-helper
[    0.821903] gpio-of-helper ocp:cape-universal: ready
lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
END

I have tried updating the kernel to R73, no change.
Can anybody here guide me on this ?

Thank you.

Best regards
Brian

This looks fishy… something forced am335x-boneblack.dts please try:

sudo apt update ; sudo apt install bb-u-boot-am335x-evm
sudo /opt/u-boot/bb-u-boot-am335x-evm/install.sh

and reboot, then run that script again…

Regards,

Hi Robert,

Performed the steps outlined, unfortunately no change.
Here is the new output:

debian@beaglebone:/sys/class/gpio$ sudo /opt/scripts/tools/version.sh
git:/opt/scripts/:[b39ec679648a6be8f25f48bd1c9784c1fc5a0c46]
eeprom:[A335BNLTEIA02046SBI10516]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[BeagleBoard.org Debian Buster IoT Image 2020-04-06]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2019.04-g923f8b8]:[location: dd MBR]
UBOOT: Booted Device-Tree:[am335x-boneblack.dts]
UBOOT: Loaded Overlay:[AM335X-PRU-RPROC-4-19-TI-00A0]
UBOOT: Loaded Overlay:[BB-ADC-00A0]
kernel:[4.19.94-ti-r42]
/boot/uEnv.txt Settings:
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-19-TI-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade <pkg>]
pkg:[bb-cape-overlays]:[4.14.20200403.0-0rcnee0~buster+20200403]
WARNING:pkg:[bb-wl18xx-firmware]:[NOT_INSTALLED]
pkg:[kmod]:[26-1]
pkg:[librobotcontrol]:[1.0.4-git20190227.1-0rcnee0~buster+20190327]
pkg:[firmware-ti-connectivity]:[20190717-2rcnee1~buster+20200305]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal bluetooth netdev i2c gpio pwm eqep remoteproc admin spi iio docker tisdk weston-launch xenomai cloud9ide]
cmdline:[console=ttyS0,115200n8 root=/dev/mmcblk1p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet]
dmesg | grep remote
[   24.436923] remoteproc remoteproc0: wkup_m3 is available
[   24.502451] remoteproc remoteproc0: powering up wkup_m3
[   24.502483] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217168
[   24.502767] remoteproc remoteproc0: remote processor wkup_m3 is now up
[   26.121487] remoteproc remoteproc1: 4a334000.pru is available
[   26.123565] remoteproc remoteproc2: 4a338000.pru is available
dmesg | grep pru
[   26.121487] remoteproc remoteproc1: 4a334000.pru is available
[   26.121662] pru-rproc 4a334000.pru: PRU rproc node pru@4a334000 probed successfully
[   26.123565] remoteproc remoteproc2: 4a338000.pru is available
[   26.123733] pru-rproc 4a338000.pru: PRU rproc node pru@4a338000 probed successfully
dmesg | grep pinctrl-single
[    0.820012] pinctrl-single 44e10800.pinmux: 142 pins, size 568
dmesg | grep gpio-of-helper
[    0.821758] gpio-of-helper ocp:cape-universal: ready
lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
END

Thanks

Odd… can you please post your /boot/uEnv.txt

Do you have a usb-serial adapter that can be plugged into J1?

Regards,

Thanks for helping, I really appreciate it.

Here’s uEnv.txt

debian@beaglebone:/boot$ cat uEnv.txt
#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0

uname_r=4.19.94-ti-r42
#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/<file0>.dtbo
#uboot_overlay_addr1=/lib/firmware/<file1>.dtbo
#uboot_overlay_addr2=/lib/firmware/<file2>.dtbo
#uboot_overlay_addr3=/lib/firmware/<file3>.dtbo
###
###Additional custom capes
#uboot_overlay_addr4=/lib/firmware/<file4>.dtbo
#uboot_overlay_addr5=/lib/firmware/<file5>.dtbo
#uboot_overlay_addr6=/lib/firmware/<file6>.dtbo
#uboot_overlay_addr7=/lib/firmware/<file7>.dtbo
###
###Custom Cape
#dtb_overlay=/lib/firmware/<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
###
###PRUSS OPTIONS
###pru_rproc (4.14.x-ti kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo
###pru_rproc (4.19.x-ti kernel)
uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-19-TI-00A0.dtbo
###pru_uio (4.14.x-ti, 4.19.x-ti & mainline/bone kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo
###
###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###

cmdline=coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet

#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

##enable Generic eMMC Flasher:
##make sure, these tools are installed: dosfstools rsync
#cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh

and yes, I do have access to the serial terminal ?

Thanks

Ah perfect, let’s see what u-boot is doing!

Regards,

I hope you mean a dump of the boot messages, else please tell me.
Looking at the boot data, I am wondering about
debug: [enable_uboot_cape_universal=1] …
debug: [uboot_base_dtb_univ=] .

Should uboot_base_dtb_univ be blank ?
What are you focusing on ? I am trying to learn this.

Boot messages:

U-Boot 2019.04-g923f8b8 (Jan 02 2022 - 19:05:15 +0000)

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 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... Card did not respond to voltage select!
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
i2c_read: error waiting for addr ACK (status=0x116)
BeagleBone: cape eeprom: Could not read the EEPROM; something fundamentally wrong on the I2C bus.
Net:   eth0: MII MODE
cpsw, usb_ether
Press SPACE to abort autoboot in 0 seconds
board_name=[A335BNLT] ...
board_rev=[EIA0] ...
Card did not respond to voltage select!
Card did not respond to voltage select!
Card did not respond to voltage select!
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
Card did not respond to voltage select!
Card did not respond to voltage select!
switch to partitions #0, OK
mmc1(part 0) is current device
Scanning mmc 1: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
mmc1(part 0) 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
2062 bytes read in 12 ms (167 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-4.19.94-ti-r42 ...
10095592 bytes read in 651 ms (14.8 MiB/s)
debug: [enable_uboot_overlays=1] ...
debug: [enable_uboot_cape_universal=1] ...
debug: [uboot_base_dtb_univ=] ...
loading /boot/dtbs/4.19.94-ti-r42/am335x-boneblack.dtb ...
59483 bytes read in 25 ms (2.3 MiB/s)
uboot_overlays: [fdt_buffer=0x60000] ...
uboot_overlays: loading /lib/firmware/BB-ADC-00A0.dtbo ...
867 bytes read in 340 ms (2 KiB/s)
uboot_overlays: loading /lib/firmware/AM335X-PRU-RPROC-4-19-TI-00A0.dtbo ...
3801 bytes read in 223 ms (16.6 KiB/s)
loading /boot/initrd.img-4.19.94-ti-r42 ...
6589689 bytes read in 429 ms (14.6 MiB/s)
debug: [console=ttyS0,115200n8 root=/dev/mmcblk1p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet] ...
debug: [bootz 0x82000000 0x88080000:648cf9 88000000] ...
## Flattened Device Tree blob at 88000000
   Booting using the fdt blob at 0x88000000
   Loading Ramdisk to 8f9b7000, end 8ffffcf9 ... OK
   Loading Device Tree to 8f945000, end 8f9b6fff ... OK

Starting kernel ...

U-Boot 2019.04-g923f8b8 (Jan 02 2022 - 19:05:15 +0000)

BeagleBone Black:
Model: BeagleBone Black Industrial:
board_name=[A335BNLT] ...
board_rev=[EIA0] ...
Running uname_boot ...
loading /boot/vmlinuz-4.19.94-ti-r42 ...
10095592 bytes read in 651 ms (14.8 MiB/s)
debug: [enable_uboot_overlays=1] ...
debug: [enable_uboot_cape_universal=1] ...
debug: [uboot_base_dtb_univ=] ...
loading /boot/dtbs/4.19.94-ti-r42/am335x-boneblack.dtb ...
59483 bytes read in 25 ms (2.3 MiB/s)
uboot_overlays: [fdt_buffer=0x60000] ...
uboot_overlays: loading /lib/firmware/BB-ADC-00A0.dtbo ...
867 bytes read in 340 ms (2 KiB/s)
uboot_overlays: loading /lib/firmware/AM335X-PRU-RPROC-4-19-TI-00A0.dtbo ...
3801 bytes read in 223 ms (16.6 KiB/s)
loading /boot/initrd.img-4.19.94-ti-r42 ...
6589689 bytes read in 429 ms (14.6 MiB/s)

Okay, something broke… the default version of u-boot did:

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

BeagleBone Black:
Model: Element14 BeagleBone Black Industrial:
board_name=[A335BNLT] ...
board_rev=[EIA0] ...

Running uname_boot ...
loading /boot/vmlinuz-4.19.94-ti-r42 ...
10095592 bytes read in 658 ms (14.6 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/4.19.94-ti-r42/am335x-boneblack-uboot-univ.dtb ...

testing… and after…

sudo apt update ; sudo apt install bb-u-boot-am335x-evm
sudo /opt/u-boot/bb-u-boot-am335x-evm/install.sh
U-Boot 2019.04-g923f8b8 (Jan 02 2022 - 19:05:15 +0000)

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 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... ** 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:   eth0: MII MODE
cpsw, 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
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
2062 bytes read in 28 ms (71.3 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-4.19.94-ti-r42 ...
10095592 bytes read in 658 ms (14.6 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/4.19.94-ti-r42/am335x-boneblack-uboot-univ.dtb ...
162266 bytes read in 53 ms (2.9 MiB/s)
uboot_overlays: [fdt_buffer=0x60000] ...
uboot_overlays: loading /lib/firmware/BB-ADC-00A0.dtbo ...
867 bytes read in 132 ms (5.9 KiB/s)
uboot_overlays: loading /lib/firmware/BB-BONE-eMMC1-01-00A0.dtbo ...
1584 bytes read in 258 ms (5.9 KiB/s)
uboot_overlays: loading /lib/firmware/BB-HDMI-TDA998x-00A0.dtbo ...
4915 bytes read in 201 ms (23.4 KiB/s)
uboot_overlays: loading /lib/firmware/AM335X-PRU-RPROC-4-19-TI-00A0.dtbo ...
3801 bytes read in 350 ms (9.8 KiB/s)
loading /boot/initrd.img-4.19.94-ti-r42 ...
6589689 bytes read in 439 ms (14.3 MiB/s)
debug: [console=ttyS0,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:648cf9 88000000] ...
## Flattened Device Tree blob at 88000000
   Booting using the fdt blob at 0x88000000
   Loading Ramdisk to 8f9b7000, end 8ffffcf9 ... OK
   Loading Device Tree to 8f92b000, end 8f9b6fff ... OK

Starting kernel ...

idk…

MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Loading Environment from EXT4... Card did not respond to voltage select!
Board: BeagleBone Black

vs:

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

any chance do you have a “/boot/uboot.env” file??

Regards,

enable_uboot_cape_universal=1
I am unsure which dts this setting loads ? cape-universal-00A0.dts ?

it triggers a seriously convoluted set of logic that’s all done via
u-boot scripting. there’s also some ugly interaction between that option
and the cape_uboot variable and the function capeloadoverlay.

i’ve had the joy snort of having to debug these aspects a few times:

to figure out how that bit of magic works i’d suggest that you
run a “printenv” while in u-boot and save the output (you indicated you
have console access); the loooong sections of not-quite-normal-shell
programs can then be massaged and perused with an editor that does syntax
highlighting. (your other option to find out what is going on there is
USTL: u-boot sources, include/configs/ti_armv7_common.h. without the values of the
variables on your bbX that’ll be of limited usefulness.)

Are all overlay files placed in /boot/dtbs/4.19.94-ti-r42 ?
I can see that BB_ADC-00A0 is loaded, but where is it placed, since it is not i
n above path ?

find /lib /boot/ -iname adc.dt*

/lib/firmware/BB-ADC-00A0.dtbo
/boot/dtbs/4.19.94-ti-r67/overlays/BB-ADC-00A0.dtbo
/boot/dtbs/4.19.94-ti-r67/overlays/BONE-ADC.dtbo

maybe helpful, possible not 100% applicable to your situation:
for us, one thing that has caused overlay loading mismatches/kabooms
on some bb board types was a dud/outdated uboot environment
(e.g. an old uboot_wireless variable setting caused attempts to load the WL1835
overlay on a bbe that has a totally different wireless chip).

i don’t recall what your duster-generation u-boot uses to park its environment
(note that “uboot environment” != uEnv.txt), so YMMV:
we did the moral equivalent of an “env erase”, followed by “env default -f -a”
and a “saveenv” on the uboot console to get back to a more reasonable state of
affairs.

(as you can see from robert nelson’s latest post in your thread, newer builds of
the uboot save their env within the ext4 filesystem at /boot/uboot.env;
see also fw_printenv from the u-boot-tools package.)

1 Like

@az143 ,

Thank you.

Seth

P.S. Nothing is easy when someone has created something away from another person and does not have 100% undivided attention to pay. So w/ that idea, thank you for the ideas and facts.

As you probable have noticed, I am booting from the eMMC.
Found another thread that mentions uBoot not being able to write to a different device than the sd-card.

So tried booting from the sd-card, entering uBoot and resetting the environment.

=> env default -f -a
 Resetting to default environment
=> saveenv
Saving Environment to EXT4... File System is consistent
Unsupported feature metadata_csum found, not writing.

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

Not sure what to make of this ?

Everybody,

Finally discovered that the problem is somewhat hardware related.
My beaglebone is plugged into our own “interface board” utilizing some of the P8 and P9 header pins.
I have an i2c RTC (MCP79400) connected to P9.19 (I2C2 SCL) and P9.20 (I2C2 SDA), this somehow trigs
uboot not to load am335x-boneblack-uboot-univ.dtb although enable_uboot_cape_universal=1.
I now realize that these pins are used for cape eeproms, and this is probably why uboot gets confused ?
I disconnected the RTC, and now the correct overlay is loaded !

I did expect that uboot would detect that the device connected on I2C2 is not an eeprom, and does not match any of the cape configuration strings identifying a particular cape ?

Does anybody know if this uboot behavior can be disabled ? or do I need to move my RTC to I2C1 instead ?

Thank you everybody for helping me out :slightly_smiling_face:

Hi Az143,

Thanks for taking the time, and giving your inputs.

find /lib /boot/ -iname adc.dt*

/lib/firmware/BB-ADC-00A0.dtbo
/boot/dtbs/4.19.94-ti-r67/overlays/BB-ADC-00A0.dtbo
/boot/dtbs/4.19.94-ti-r67/overlays/BONE-ADC.dtbo

In my case I only find it under
/lib/firmware/BB-ADC-00A0.dtbo
and since it seem to be loaded ok, that must be fine.

I tried booting to the uBoot terminal, and executed

=> env default -f -a
Resetting to default environment
=> saveenv
Saving Environment to EXT4… Card did not respond to voltage select!
Failed (1)

I do see a few changes in the printenv output:

This line was changed:
board_name=A335BNLT
to
board_name=am335x

These lines were removed:
board_rev=EIA0
board_serial=2046SBI10516
bootcount=7
eth1addr=2c:ab:33:6a:bb:60
ethact=cpsw
ethaddr=2c:ab:33:6a:bb:5e
serial#=2046SBI10516
stderr=ns16550_serial
stdin=ns16550_serial
stdout=ns16550_serial
usbnet_devaddr=2c:ab:33:6a:bb:5e
ver=U-Boot 2019.04-g923f8b8 (Jan 02 2022 - 19:05:15 +0000)

So not a lot of changes …
Rebooting after this did not change anything, but I guess the change was not saved !

I have inserted the printenv out put below this line

=> printenv

arch=arm

args_mmc=run finduuid;setenv bootargs console=${console} ${cape_uboot} root=PARTUUID=${uuid} ro rootfstype=${mmcrootfstype} ${uboot_detected_capes} ${cmdline}

args_mmc_old=setenv bootargs console=${console} ${optargs} ${cape_uboot} root=${oldroot} ro rootfstype=${mmcrootfstype} ${uboot_detected_capes} ${cmdline}

args_mmc_uuid=setenv bootargs console=${console} ${optargs} ${cape_uboot} root=UUID=${uuid} ro rootfstype=${mmcrootfstype} ${uboot_detected_capes} ${cmdline}

args_netinstall=setenv bootargs ${netinstall_bootargs} ${optargs} ${cape_uboot} root=/dev/ram rw ${uboot_detected_capes} ${cmdline}

args_uenv_root=setenv bootargs console=${console} ${optargs} ${cape_uboot} root=${uenv_root} ro rootfstype=${mmcrootfstype} ${uboot_detected_capes} ${cmdline}

baudrate=115200

board=am335x

board_eeprom_header=undefined

board_name=A335BNLT

board_rev=EIA0

board_serial=2046SBI10516

boot=${devtype} dev ${mmcdev}; if ${devtype} rescan; then gpio set 54;setenv bootpart ${mmcdev}:1; if test -e ${devtype} ${bootpart} /etc/fstab; then setenv mmcpart 1;fi; echo Checking for: /uEnv.txt …;if test -e ${devtype} ${bootpart} /uEnv.txt; then if run loadbootenv; then gpio set 55;echo Loaded environment from /uEnv.txt;run importbootenv;fi;echo Checking if uenvcmd is set …;if test -n ${uenvcmd}; then gpio set 56; echo Running uenvcmd …;run uenvcmd;fi;fi; echo Checking for: /${script} …;if test -e ${devtype} ${bootpart} /${script}; then gpio set 55;setenv scriptfile ${script};run loadbootscript;echo Loaded script from ${scriptfile};gpio set 56; run bootscript;fi; echo Checking for: /boot/${script} …;if test -e ${devtype} ${bootpart} /boot/${script}; then gpio set 55;setenv scriptfile /boot/${script};run loadbootscript;echo Loaded script from ${scriptfile};gpio set 56; run bootscript;fi; echo Checking for: /boot/uEnv.txt …;for i in 1 2 3 4 5 6 7 ; do setenv mmcpart ${i};setenv bootpart ${mmcdev}:${mmcpart};if test -e ${devtype} ${bootpart} /boot/uEnv.txt; then gpio set 55;load ${devtype} ${bootpart} ${loadaddr} /boot/uEnv.txt;env import -t ${loadaddr} ${filesize};echo Loaded environment from /boot/uEnv.txt;if test -n ${dtb}; then echo debug: [dtb=${dtb}] … ;setenv fdtfile ${dtb};echo Using: dtb=${fdtfile} …;fi;echo Checking if uname_r is set in /boot/uEnv.txt…;if test -n ${uname_r}; then gpio set 56; setenv oldroot /dev/mmcblk${mmcdev}p${mmcpart};echo Running uname_boot …;run uname_boot;fi;fi;done;fi;

boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}

boot_efi_binary=if fdt addr ${fdt_addr_r}; then bootefi bootmgr ${fdt_addr_r};else bootefi bootmgr ${fdtcontroladdr};fi;load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootarm.efi; if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi

boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf}

boot_fdt=try

boot_fit=0

boot_net_usb_start=usb start

boot_prefixes=/ /boot/

boot_script_dhcp=boot.scr.uimg

boot_scripts=boot.scr.uimg boot.scr

boot_syslinux_conf=extlinux/extlinux.conf

boot_targets=mmc0 legacy_mmc0 mmc1 legacy_mmc1 pxe dhcp

bootcmd=if test ${boot_fit} -eq 1; then run update_to_fit; fi; run findfdt; run init_console; run envboot; run distro_bootcmd

bootcmd_dhcp=run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; if test -z “${fdtfile}” -a -n “${soc}”; then setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; fi; setenv efi_old_vci ${bootp_vci};setenv efi_old_arch ${bootp_arch};setenv bootp_vci PXEClient:Arch:00010:UNDI:003000;setenv bootp_arch 0xa;if dhcp ${kernel_addr_r}; then tftpboot ${fdt_addr_r} dtb/${efi_fdtfile};if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r}; else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi;fi;setenv bootp_vci ${efi_old_vci};setenv bootp_arch ${efi_old_arch};setenv efi_fdtfile;setenv efi_old_arch;setenv efi_old_vci;

bootcmd_legacy_mmc0=gpio clear 56; gpio clear 55; gpio clear 54; gpio set 53; setenv devtype mmc; setenv mmcdev 0; setenv bootpart 0:1 ; run boot

bootcmd_legacy_mmc1=gpio clear 56; gpio clear 55; gpio clear 54; gpio set 53; setenv devtype mmc; setenv mmcdev 1; setenv bootpart 1:1 ; run boot

bootcmd_mmc0=devnum=0; run mmc_boot

bootcmd_mmc1=devnum=1; run mmc_boot

bootcmd_pxe=run boot_net_usb_start; dhcp; if pxe get; then pxe boot; fi

bootcount=5

bootdelay=0

bootdir=/boot

bootenv=uEnv.txt

bootenvfile=uEnv.txt

bootfile=zImage

bootm_size=0x10000000

bootpart=0:2

bootscript=echo Running bootscript from mmc${bootpart} …; source ${loadaddr}

console=ttyS0,115200n8

cpu=armv7

dfu_alt_info_emmc=rawemmc raw 0 3751936;boot part 1 1;rootfs part 1 2;MLO fat 1 1;MLO.raw raw 0x100 0x100;u-boot.img.raw raw 0x300 0x1000;u-env.raw raw 0x1300 0x200;spl-os-args.raw raw 0x1500 0x200;spl-os-image.raw raw 0x1700 0x6900;spl-os-args fat 1 1;spl-os-image fat 1 1;u-boot.img fat 1 1;uEnv.txt fat 1 1

dfu_alt_info_mmc=boot part 0 1;rootfs part 0 2;MLO fat 0 1;MLO.raw raw 0x100 0x100;u-boot.img.raw raw 0x300 0x1000;u-env.raw raw 0x1300 0x200;spl-os-args.raw raw 0x1500 0x200;spl-os-image.raw raw 0x1700 0x6900;spl-os-args fat 0 1;spl-os-image fat 0 1;u-boot.img fat 0 1;uEnv.txt fat 0 1

dfu_alt_info_ram=kernel ram 0x80200000 0x4000000;fdt ram 0x80f80000 0x80000;ramdisk ram 0x81000000 0x4000000

distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done

eeprom_bbb_header=i2c dev 0; i2c mw 0x50 0x00.2 aa; i2c mw 0x50 0x01.2 55; i2c mw 0x50 0x02.2 33; i2c mw 0x50 0x03.2 ee; i2c mw 0x50 0x04.2 41; i2c mw 0x50 0x05.2 33; i2c mw 0x50 0x06.2 33; i2c mw 0x50 0x07.2 35; i2c mw 0x50 0x08.2 42; i2c mw 0x50 0x09.2 4e; i2c mw 0x50 0x0a.2 4c; i2c mw 0x50 0x0b.2 54;

eeprom_bbbl_footer= i2c mw 0x50 0x0c.2 42; i2c mw 0x50 0x0d.2 4c; i2c mw 0x50 0x0e.2 41; i2c mw 0x50 0x0f.2 32;

eeprom_bbbw_footer= i2c mw 0x50 0x0c.2 42; i2c mw 0x50 0x0d.2 57; i2c mw 0x50 0x0e.2 41; i2c mw 0x50 0x0f.2 35;

eeprom_bbgg_footer= i2c mw 0x50 0x0c.2 47; i2c mw 0x50 0x0d.2 47; i2c mw 0x50 0x0e.2 31; i2c mw 0x50 0x0f.2 41;

eeprom_beaglelogic= i2c mw 0x50 0x00.2 aa; i2c mw 0x50 0x01.2 55; i2c mw 0x50 0x02.2 33; i2c mw 0x50 0x03.2 ee; i2c mw 0x50 0x04.2 41; i2c mw 0x50 0x05.2 33; i2c mw 0x50 0x06.2 33; i2c mw 0x50 0x07.2 35; i2c mw 0x50 0x08.2 42; i2c mw 0x50 0x09.2 4c; i2c mw 0x50 0x0a.2 47; i2c mw 0x50 0x0b.2 43; i2c mw 0x50 0x0c.2 30; i2c mw 0x50 0x0d.2 30; i2c mw 0x50 0x0e.2 30; i2c mw 0x50 0x0f.2 41;

eeprom_blank=i2c dev 0; i2c mw 0x50 0x00.2 ff; i2c mw 0x50 0x01.2 ff; i2c mw 0x50 0x02.2 ff; i2c mw 0x50 0x03.2 ff; i2c mw 0x50 0x04.2 ff; i2c mw 0x50 0x05.2 ff; i2c mw 0x50 0x06.2 ff; i2c mw 0x50 0x07.2 ff; i2c mw 0x50 0x08.2 ff; i2c mw 0x50 0x09.2 ff; i2c mw 0x50 0x0a.2 ff; i2c mw 0x50 0x0b.2 ff; i2c mw 0x50 0x0c.2 ff; i2c mw 0x50 0x0d.2 ff; i2c mw 0x50 0x0e.2 ff; i2c mw 0x50 0x0f.2 ff; i2c mw 0x50 0x10.2 ff; i2c mw 0x50 0x11.2 ff; i2c mw 0x50 0x12.2 ff; i2c mw 0x50 0x13.2 ff; i2c mw 0x50 0x14.2 ff; i2c mw 0x50 0x15.2 ff; i2c mw 0x50 0x16.2 ff; i2c mw 0x50 0x17.2 ff; i2c mw 0x50 0x18.2 ff; i2c mw 0x50 0x19.2 ff; i2c mw 0x50 0x1a.2 ff; i2c mw 0x50 0x1b.2 ff; i2c mw 0x50 0x1c.2 ff; i2c mw 0x50 0x1d.2 ff; i2c mw 0x50 0x1e.2 ff; i2c mw 0x50 0x1f.2 ff;

eeprom_dump=i2c dev 0; i2c md 0x50 0x00.2 20;

eeprom_pocketbeagle= i2c mw 0x50 0x00.2 aa; i2c mw 0x50 0x01.2 55; i2c mw 0x50 0x02.2 33; i2c mw 0x50 0x03.2 ee; i2c mw 0x50 0x04.2 41; i2c mw 0x50 0x05.2 33; i2c mw 0x50 0x06.2 33; i2c mw 0x50 0x07.2 35; i2c mw 0x50 0x08.2 50; i2c mw 0x50 0x09.2 42; i2c mw 0x50 0x0a.2 47; i2c mw 0x50 0x0b.2 4c; i2c mw 0x50 0x0c.2 30; i2c mw 0x50 0x0d.2 30; i2c mw 0x50 0x0e.2 41; i2c mw 0x50 0x0f.2 32;

eeprom_program=if test $board_eeprom_header = bbb_blank; then run eeprom_dump; run eeprom_blank; run eeprom_bbb_header; run eeprom_dump; reset; fi; if test $board_eeprom_header = bbbl_blank; then run eeprom_dump; run eeprom_blank; run eeprom_bbb_header; run eeprom_bbbl_footer; run eeprom_dump; reset; fi; if test $board_eeprom_header = bbbw_blank; then run eeprom_dump; run eeprom_blank; run eeprom_bbb_header; run eeprom_bbbw_footer; run eeprom_dump; reset; fi; if test $board_eeprom_header = pocketbeagle_blank; then run eeprom_dump; run eeprom_blank; run eeprom_pocketbeagle; run eeprom_dump; reset; fi; if test $board_eeprom_header = bbgg_blank; then run eeprom_dump; run eeprom_blank; run eeprom_bbb_header; run eeprom_bbgg_footer; run eeprom_dump; reset; fi; if test $board_eeprom_header = beaglelogic_blank; then run eeprom_dump; run eeprom_blank; run eeprom_beaglelogic; run eeprom_dump; reset; fi;

efi_dtb_prefixes=/ /dtb/ /dtb/current/

envboot=mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadbootscript; then run bootscript;else if run loadbootenv; then echo Loaded env from ${bootenvfile};run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd …;run uenvcmd;fi;fi;fi;

eth1addr=2c:ab:33:6a:bb:60

ethact=cpsw

ethaddr=2c:ab:33:6a:bb:5e

failumsboot=echo; echo FAILSAFE: U-Boot UMS (USB Mass Storage) enabled, media now available over the usb slave port …; ums 0 ${devtype} 1;

fdt_addr_r=0x88000000

fdtaddr=0x88000000

fdtfile=undefined

findfdt=echo board_name=[$board_name] …; if test $board_name = A335BLGC; then setenv fdtfile am335x-beaglelogic.dtb; fi; if test $board_name = A335BONE; then setenv fdtfile am335x-bone.dtb; fi; if test $board_name = A335BNLT; then echo board_rev=[$board_rev] …; if test $board_rev = GH01; then setenv fdtfile am335x-boneblack.dtb; elif test $board_rev = BBG1; then setenv fdtfile am335x-bonegreen.dtb; elif test $board_rev = BP00; then setenv fdtfile am335x-pocketbone.dtb; elif test $board_rev = GW1A; then setenv fdtfile am335x-bonegreen-wireless.dtb; elif test $board_rev = GG1A; then setenv fdtfile am335x-bonegreen-gateway.dtb; elif test $board_rev = AIA0; then setenv fdtfile am335x-abbbi.dtb; elif test $board_rev = EIA0; then setenv fdtfile am335x-boneblack.dtb; elif test $board_rev = ME06; then setenv fdtfile am335x-bonegreen.dtb; elif test $board_rev = OS00; then setenv fdtfile am335x-osd3358-sm-red.dtb; elif test $board_rev = OS01; then setenv fdtfile am335x-osd3358-sm-red-v4.dtb; else setenv fdtfile am335x-boneblack.dtb; fi; fi; if test $board_name = A335PBGL; then setenv fdtfile am335x-pocketbeagle.dtb; fi; if test $board_name = BBBW; then setenv fdtfile am335x-boneblack-wireless.dtb; fi; if test $board_name = BBG1; then setenv fdtfile am335x-bonegreen.dtb; fi; if test $board_name = BBGW; then setenv fdtfile am335x-bonegreen-wireless.dtb; fi; if test $board_name = BBGG; then setenv fdtfile am335x-bonegreen-gateway.dtb; fi; if test $board_name = BBBL; then setenv fdtfile am335x-boneblue.dtb; fi; if test $board_name = BBEN; then setenv fdtfile am335x-sancloud-bbe.dtb; fi; if test $board_name = BBELITE; then setenv fdtfile am335x-sancloud-bbe-lite.dtb; fi; if test $board_name = OS00; then setenv fdtfile am335x-osd3358-sm-red.dtb; fi; if test $board_name = OS01; then setenv fdtfile am335x-osd3358-sm-red-v4.dtb; fi; if test $board_name = A33515BB; then setenv fdtfile am335x-evm.dtb; fi; if test $board_name = A335X_SK; then setenv fdtfile am335x-evmsk.dtb; fi; if test $board_name = A335_ICE; then setenv fdtfile am335x-icev2.dtb; fi; if test $fdtfile = undefined; then setenv board_name A335BNLT; setenv board_rev EMMC; setenv fdtfile am335x-bonegreen.dtb; fi;

finduuid=part uuid ${devtype} ${bootpart} uuid

fit_bootfile=fitImage

fit_loadaddr=0x90000000

if_netconsole=ping $serverip

importbootenv=echo Importing environment from ${devtype} …; env import -t ${loadaddr} ${filesize}

init_console=if test $board_name = A335_ICE; then setenv console ttyS3,115200n8;elif test $board_name = A335BLGC; then setenv console ttyS4,115200n8;else setenv console ttyS0,115200n8;fi;

ipaddr=192.168.1.2

kernel_addr_r=0x82000000

load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}

loadaddr=0x82000000

loadbootenv=load ${devtype} ${bootpart} ${loadaddr} ${bootenvfile}

loadbootscript=load ${devtype} ${bootpart} ${loadaddr} ${scriptfile};

loadfdt=echo loading ${fdtdir}/${fdtfile} …; load ${devtype} ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile}

loadfit=run args_mmc; bootm ${loadaddr}#${fdtfile};

loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}

loadoverlay=echo uboot_overlays: loading ${actual_uboot_overlay} …; load ${devtype} ${bootpart} ${rdaddr} ${actual_uboot_overlay}; fdt addr ${fdtaddr}; fdt resize ${fdt_buffer}; fdt apply ${rdaddr}; fdt resize ${fdt_buffer};

loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz

loadrd=load ${devtype} ${bootpart} ${rdaddr} ${bootdir}/${rdfile}; setenv rdsize ${filesize}

mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run scan_dev_for_boot_part; fi

mmcboot=mmc dev ${mmcdev}; setenv devnum ${mmcdev}; setenv devtype mmc; if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadimage; then if test ${boot_fit} -eq 1; then run loadfit; else run mmcloados;fi;fi;fi;

mmcdev=0

mmcloados=run args_mmc; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then if test -n ${uname_r}; then bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; else bootz ${loadaddr} - ${fdtaddr}; fi; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;

mmcrootfstype=ext4 rootwait

netargs=setenv bootargs console=${console} ${optargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp

netboot=echo Booting from network …; setenv autoload no; dhcp; run netloadimage; run netloadfdt; run netargs; bootz ${loadaddr} - ${fdtaddr}

netloadfdt=tftp ${fdtaddr} ${fdtfile}

netloadimage=tftp ${loadaddr} ${bootfile}

nfsopts=nolock

partitions=uuid_disk=${uuid_gpt_disk};name=bootloader,start=384K,size=1792K,uuid=${uuid_gpt_bootloader};name=rootfs,start=2688K,size=-,uuid=${uuid_gpt_rootfs}

pb_eeprom_hdr=mw 82001000 ee3355aa; mw 82001004 35333341; mw 82001008 4c474250

preboot=run if_netconsole start_netconsole

pxefile_addr_r=0x80100000

ramargs=setenv bootargs console=${console} ${optargs} root=${ramroot} rootfstype=${ramrootfstype}

ramboot=echo Booting from ramdisk …; run ramargs; bootz ${loadaddr} ${rdaddr} ${fdtaddr}

ramdisk_addr_r=0x88080000

ramroot=/dev/ram0 rw

ramrootfstype=ext2

rdaddr=0x88080000

rootpath=/export/rootfs

scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}…; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;

scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done; setenv devplist

scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; if test -z “${fdtfile}” -a -n “${soc}”; then setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; fi; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;if test -e ${devtype} ${devnum}:${distro_bootpart} efi/boot/bootarm.efi; then echo Found EFI removable media binary efi/boot/bootarm.efi; run boot_efi_binary; echo EFI LOAD FAILED: continuing…; fi; setenv efi_fdtfile

scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${boot_syslinux_conf}; then echo Found ${prefix}${boot_syslinux_conf}; run boot_extlinux; echo SCRIPT FAILED: continuing…; fi

scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing…; fi; done

script=boot.scr

scriptaddr=0x80000000

scriptfile=${script}

serial#=2046SBI10516

serverip=192.168.1.1

soc=am33xx

spiargs=setenv bootargs console=${console} ${optargs} root=${spiroot} rootfstype=${spirootfstype}

spiboot=echo Booting from spi …; run spiargs; sf probe ${spibusno}:0; sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; bootz ${loadaddr}

spibusno=0

spiimgsize=0x362000

spiroot=/dev/mtdblock4 rw

spirootfstype=jffs2

spisrcaddr=0xe0000

start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin serial,nc; setenv stdout serial,nc; setenv stderr serial,nc; version

static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off

stderr=ns16550_serial

stdin=ns16550_serial

stdout=ns16550_serial

uname_boot=setenv bootdir /boot; setenv bootfile vmlinuz-${uname_r}; if test -e ${devtype} ${bootpart} ${bootdir}/${bootfile}; then echo loading ${bootdir}/${bootfile} …; run loadimage;setenv fdtdir /boot/dtbs/${uname_r}; echo debug: [enable_uboot_overlays=${enable_uboot_overlays}] … ;if test -n ${enable_uboot_overlays}; then echo debug: [enable_uboot_cape_universal=${enable_uboot_cape_universal}] … ;if test -n ${enable_uboot_cape_universal}; then echo debug: [uboot_base_dtb_univ=${uboot_base_dtb_univ}] … ;if test -n ${uboot_base_dtb_univ}; then echo uboot_overlays: [uboot_base_dtb=${uboot_base_dtb_univ}] … ;if test -e ${devtype} ${bootpart} ${fdtdir}/${uboot_base_dtb_univ}; then setenv fdtfile ${uboot_base_dtb_univ};echo uboot_overlays: Switching too: dtb=${fdtfile} …;setenv cape_uboot bone_capemgr.uboot_capemgr_enabled=1; else echo debug: unable to find [${uboot_base_dtb_univ}] using [${uboot_base_dtb}] instead … ;echo debug: [uboot_base_dtb_univ=${uboot_base_dtb}] … ;if test -n ${uboot_base_dtb}; then echo uboot_overlays: [uboot_base_dtb=${uboot_base_dtb}] … ;if test -e ${devtype} ${bootpart} ${fdtdir}/${uboot_base_dtb}; then setenv fdtfile ${uboot_base_dtb};echo uboot_overlays: Switching too: dtb=${fdtfile} …;fi;fi;fi;fi;else echo debug: [uboot_base_dtb_univ=${uboot_base_dtb}] … ;if test -n ${uboot_base_dtb}; then echo uboot_overlays: [uboot_base_dtb=${uboot_base_dtb}] … ;if test -e ${devtype} ${bootpart} ${fdtdir}/${uboot_base_dtb}; then setenv fdtfile ${uboot_base_dtb};echo uboot_overlays: Switching too: dtb=${fdtfile} …;fi;fi;fi;fi;if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then run loadfdt;else setenv fdtdir /usr/lib/linux-image-${uname_r}; if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then run loadfdt;else setenv fdtdir /lib/firmware/${uname_r}/device-tree; if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then run loadfdt;else setenv fdtdir /boot/dtb-${uname_r}; if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then run loadfdt;else setenv fdtdir /boot/dtbs; if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then run loadfdt;else setenv fdtdir /boot/dtb; if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then run loadfdt;else setenv fdtdir /boot; if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then run loadfdt;else if test -e ${devtype} ${bootpart} ${fdtfile}; then run loadfdt;else echo; echo unable to find [dtb=${fdtfile}] did you name it correctly? …; run failumsboot;fi;fi;fi;fi;fi;fi;fi;fi; if test -n ${enable_uboot_overlays}; then setenv fdt_buffer 0x60000;if test -n ${uboot_fdt_buffer}; then setenv fdt_buffer ${uboot_fdt_buffer};fi;echo uboot_overlays: [fdt_buffer=${fdt_buffer}] … ;if test -n ${uboot_silicon}; then setenv uboot_overlay ${uboot_silicon}; run virtualloadoverlay;fi;if test -n ${uboot_model}; then setenv uboot_overlay ${uboot_model}; run virtualloadoverlay;fi;if test -n ${disable_uboot_overlay_adc}; then echo uboot_overlays: uboot loading of [BB-ADC-00A0.dtbo] disabled by /boot/uEnv.txt [disable_uboot_overlay_adc=1]…;else setenv uboot_overlay BB-ADC-00A0.dtbo; run virtualloadoverlay;fi;if test -n ${uboot_overlay_addr0}; then if test -n ${disable_uboot_overlay_addr0}; then echo uboot_overlays: uboot loading of [${uboot_overlay_addr0}] disabled by /boot/uEnv.txt [disable_uboot_overlay_addr0=1]…;else setenv uboot_overlay ${uboot_overlay_addr0}; run virtualloadoverlay;fi;fi;if test -n ${uboot_overlay_addr1}; then if test -n ${disable_uboot_overlay_addr1}; then echo uboot_overlays: uboot loading of [${uboot_overlay_addr1}] disabled by /boot/uEnv.txt [disable_uboot_overlay_addr1=1]…;else setenv uboot_overlay ${uboot_overlay_addr1}; run virtualloadoverlay;fi;fi;if test -n ${uboot_overlay_addr2}; then if test -n ${disable_uboot_overlay_addr2}; then echo uboot_overlays: uboot loading of [${uboot_overlay_addr2}] disabled by /boot/uEnv.txt [disable_uboot_overlay_addr2=1]…;else setenv uboot_overlay ${uboot_overlay_addr2}; run virtualloadoverlay;fi;fi;if test -n ${uboot_overlay_addr3}; then if test -n ${disable_uboot_overlay_addr3}; then echo uboot_overlays: uboot loading of [${uboot_overlay_addr3}] disabled by /boot/uEnv.txt [disable_uboot_overlay_addr3=1]…;else setenv uboot_overlay ${uboot_overlay_addr3}; run virtualloadoverlay;fi;fi;if test -n ${uboot_overlay_addr4}; then setenv uboot_overlay ${uboot_overlay_addr4}; run virtualloadoverlay;fi;if test -n ${uboot_overlay_addr5}; then setenv uboot_overlay ${uboot_overlay_addr5}; run virtualloadoverlay;fi;if test -n ${uboot_overlay_addr6}; then setenv uboot_overlay ${uboot_overlay_addr6}; run virtualloadoverlay;fi;if test -n ${uboot_overlay_addr7}; then setenv uboot_overlay ${uboot_overlay_addr7}; run virtualloadoverlay;fi;if test -n ${uboot_emmc}; then if test -n ${disable_uboot_overlay_emmc}; then echo uboot_overlays: uboot loading of [${uboot_emmc}] disabled by /boot/uEnv.txt [disable_uboot_overlay_emmc=1]…;else setenv uboot_overlay ${uboot_emmc}; run virtualloadoverlay;fi;fi;if test -n ${uboot_video}; then if test -n ${disable_uboot_overlay_video}; then echo uboot_overlays: uboot loading of [${uboot_video}] disabled by /boot/uEnv.txt [disable_uboot_overlay_video=1]…;else if test -n ${disable_uboot_overlay_audio}; then echo uboot_overlays: uboot loading of [${uboot_video}] disabled by /boot/uEnv.txt [disable_uboot_overlay_audio=1]…;setenv uboot_overlay ${uboot_video_naudio}; run virtualloadoverlay;else setenv uboot_overlay ${uboot_video}; run virtualloadoverlay;fi;fi;fi;if test -n ${uboot_wireless}; then if test -n ${disable_uboot_overlay_wireless}; then echo uboot_overlays: uboot loading of [${uboot_wireless}] disabled by /boot/uEnv.txt [disable_uboot_overlay_wireless=1]…;else setenv uboot_overlay ${uboot_wireless}; run virtualloadoverlay;fi;fi;if test -n ${uboot_overlay_pru}; then setenv uboot_overlay ${uboot_overlay_pru}; run virtualloadoverlay;fi;if test -n ${uboot_overlay_pru_add}; then setenv uboot_overlay ${uboot_overlay_pru_add}; run virtualloadoverlay;fi;if test -n ${dtb_overlay}; then setenv uboot_overlay ${dtb_overlay}; echo uboot_overlays: [dtb_overlay=${uboot_overlay}] … ;run virtualloadoverlay;fi;else echo uboot_overlays: add [enable_uboot_overlays=1] to /boot/uEnv.txt to enable…;fi;if test -n ${uboot_detected_capes}; then echo uboot_overlays: [uboot_detected_capes=${uboot_detected_capes_addr0}${uboot_detected_capes_addr1}${uboot_detected_capes_addr2}${uboot_detected_capes_addr3}] … ;setenv uboot_detected_capes uboot_detected_capes=${uboot_detected_capes_addr0}${uboot_detected_capes_addr1}${uboot_detected_capes_addr2}${uboot_detected_capes_addr3}; fi;setenv rdfile initrd.img-${uname_r}; if test -e ${devtype} ${bootpart} ${bootdir}/${rdfile}; then echo loading ${bootdir}/${rdfile} …; run loadrd;if test -n ${netinstall_enable}; then run args_netinstall; run message;echo debug: [${bootargs}] … ;echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] … ;bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; fi;if test -n ${uenv_root}; then run args_uenv_root;echo debug: [${bootargs}] … ;echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] … ;bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; fi;if test -n ${uuid}; then run args_mmc_uuid;echo debug: [${bootargs}] … ;echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] … ;bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; fi;run args_mmc_old;echo debug: [${bootargs}] … ;echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] … ;bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; else if test -n ${uenv_root}; then run args_uenv_root;echo debug: [${bootargs}] … ;echo debug: [bootz ${loadaddr} - ${fdtaddr}] … ;bootz ${loadaddr} - ${fdtaddr}; fi;run args_mmc_old;echo debug: [${bootargs}] … ;echo debug: [bootz ${loadaddr} - ${fdtaddr}] … ;bootz ${loadaddr} - ${fdtaddr}; fi;fi;

update_to_fit=setenv loadaddr ${fit_loadaddr}; setenv bootfile ${fit_bootfile}

usb_boot=usb start; if usb dev ${devnum}; then devtype=usb; run scan_dev_for_boot_part; fi

usbnet_devaddr=2c:ab:33:6a:bb:5e

vendor=ti

ver=U-Boot 2019.04-g923f8b8 (Jan 02 2022 - 19:05:15 +0000)

virtualloadoverlay=if test -e ${devtype} ${bootpart} ${fdtdir}/overlays/${uboot_overlay}; then setenv actual_uboot_overlay ${fdtdir}/overlays/${uboot_overlay}; run loadoverlay;else if test -e ${devtype} ${bootpart} /lib/firmware/${uboot_overlay}; then setenv actual_uboot_overlay /lib/firmware/${uboot_overlay}; run loadoverlay;else if test -e ${devtype} ${bootpart} ${uboot_overlay}; then setenv actual_uboot_overlay ${uboot_overlay}; run loadoverlay;else echo uboot_overlays: unable to find [${devtype} ${bootpart} ${uboot_overlay}]…;fi;fi;fi;

Environment size: 25272/131068 bytes

=>

Sorry No, I don’t have a /boot/uboot.env file.

As you probable have noticed, I am booting from the eMMC.
Found another thread that mentions uBoot not being able to write to a different
device than the sd-card.

afaik the 2019-x u-boot versions don’t have the smarts to handle the
environment in more than one location, ie. no fallback.
at work we’re working around this by compiling two u-boot binaries, one
for our flashbable images which looks for its env on the sd card, and
one that gets installed on flashing which then solely consults the emmc.

Saving Environment to EXT4… File System is consistent
Unsupported feature metadata_csum found, not writing.

** Unable to write “/boot/uboot.env” from mmc0:1 **

that’s a known stuffup in the defaults shipped on many beagle images: u-boot
dislikes ext4 if the the metadata_csum feature is on. /etc/mke2fs.conf should
loooong ago have been fixed to not enable that when making filesystems on/for
beagles (but the bug report for that is unactioned).

if you can access the filesystem in question without booting from it,
then

tune2fs -O ^64bit,^metadata_csum /dev/… and resize2fs -s /dev/…

fixes that one.

1 Like