U-Boot v2024.10 Failing, BeagleBone-AI

Hi,

Apologies, as this is likely me :frowning:. But stuck, so hoping someone has some debug thoughts / pointers. I am trying to build (compile) my own U-Boot, for BeagleBone-AI (not 64). I built (cross-compiled) as below (from stock U-Boot code) ā€¦ it seems to build fine,

sudo aptinstall gcc-arm-linux-gnueabihf
export CROSS_COMPILE=arm-linux-gnueabihf-
export ARCH=arm
make distclean
make am57xx_evm_defconfig
make -j16

FYI, I did build ā€œhello.cā€ as a test also ā€¦ copied the output over, and it runs fine (on the bbai). So thinking cross-compiling is working?

But on U-Boot, I have tried to install it 2 ways,

  1. Use the flasher image, but replace MLO and u-boot-dtb.img with my files. Flashes, but boot after ā€¦ just hangs.
  2. Manually flash to eMMC, the two noted files using dd commands (from install-mmcblk0.sh ā€¦ the same result, And I admit, the dd commands confuse me just a bit, regarding offsets LOL

So looking for any and all pointers - thanks in advance! BTW, in case it helps, here is the file listing from cross-compiling, in case this is part of the issue (i.e. file size?). I ask this because u-boot-dtb.img is > 4x 384k blocks?

127648 Dec 14 11:56 MLO
1603724 Dec 14 11:56 u-boot-dtb.img

That might need to be ARCH=arch64
armhf is 32 and it might be confused??? Just a guess.

Nope, itā€™s arch32ā€¦

Last branch i tested on BeagleBone AI is v2022.04: Files Ā· v2022.04-bbb.io-am335x-am57xx Ā· BeagleBoard.org / u-boot Ā· GitLab

Iā€™ve always seen an issue with reading the ā€˜eMMCā€™ for the board ID, so i just force it: am57xx/board.c: assume on failure its a BBONE-AI (0b161f8e) Ā· Commits Ā· BeagleBoard.org / u-boot Ā· GitLab

This has a side affect that any board not detected will be a BeagleBone AIā€¦

Regards,

Iā€™ll give that a try, NP at all - thanks! BTW, it doesnā€™t even start, meaning no U-Boot version number or anything displayed. Would this align with failed board detection?

Thanks again.

Are you asking if the board died?, if none of the leds are on it is dead. We had 2 ai64 die on us and they were not in a case I cannot blame anyone other than myself for the failure. Have an ai64 production server all boxed up and its a workhorseā€¦

If the led is on and its stuck you will have to go in on the debug port and wipe out some emmc. Use the latest flasher image to install a fresh uboot and image.

The BBAI uses the wrong serial port, so if detection fails no serial information will dump to the debug port.

Regards,

Yep, and Iā€™m connected to the debug port - that works great :smile:. I think I know whatā€™s going on. So the MLO and u-boot.img files that I built ā€¦ I tried (with dd) writing MLO - works great. Then u-boot-img ā€¦ issues. But here is what I think is going on,

  1. using count=4 seek=1 bs=384k ā€¦ the write is smaller than the u-boot.img file. So that hangs on boot. Makes sense, the full file wasnā€™t written, so corrupt.
  2. using count=5 seek=1 bs=384k ā€¦ yep, the write is the full file, but it shows mmc issues on boot (but does start up!)

Log from the boot (partial),

U-Boot 2024.10-dirty (Dec 17 2024 - 06:32:49 -0600)

CPU  : DRA752-GP ES2.0
Model: BeagleBoard.org BeagleBone AI
Board: BeagleBone AI REV A
DRAM:  1 GiB
Core:  70 devices, 19 uclasses, devicetree: separate
MMC:   no pinctrl state for default mode
omap_hsmmc_init_setup: timedout waiting for cc2!
no pinctrl state for default mode
omap_hsmmc_init_setup: timedout waiting for cc2!
mmc@480d1000 - probe failed: -110
OMAP SD/MMC: 0, OMAP SD/MMC: 1no pinctrl state for default mode
omap_hsmmc_init_setup: timedout waiting for cc2!

Loading Environment from FAT... MMC: no card present
** Bad device specification mmc 0 **
Loading Environment from MMC... *** Warning - bad CRC, using default environment

Reading from MMC(1)... Net:   eth2: ethernet@48484000
Hit any key to stop autoboot:  0
MMC: no card present
** Bad device specification mmc 0 **
MMC: no card present
switch to partitions #0, OK
mmc1(part 0) is current device
Scanning mmc 1:1...
MMC: no card present
no pinctrl state for default mode
omap_hsmmc_init_setup: timedout waiting for cc2!
No EFI system partition
No EFI system partition
Failed to persist EFI variables
No EFI system partition
Failed to persist EFI variables
No EFI system partition
Failed to persist EFI variables
Loading Boot0000 'mmc 1' failed
EFI boot manager: Cannot load any image
starting USB...
Bus usb@488d0000: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus usb@488d0000 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
ethernet@48484000 Waiting for PHY auto negotiation to complete..... done
link up on port 0, speed 1000, full duplex
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
BOOTP broadcast 5
DHCP client bound to address 192.168.0.88 (3762 ms)
*** Warning: no boot file name; using 'C0A80058.img'
Using ethernet@48484000 device
TFTP from server 192.168.0.1; our IP address is 192.168.0.88
Filename 'C0A80058.img'.
Load address: 0x82000000
Loading: *

So it seems the larger file is part of the issue - and writing 5 blocks (384k each) causes grief? Any thoughts how to deal with that?

Thanks!

looks to be starting up just fine.

Sort of :laughing:. By writing 5 (384k) blocks, u-boot comes up ā€¦ but that write seems to mess up the eMMC partitioning? From the console log,

mmc1(part 0) is current device
Scanning mmc 1:1...
MMC: no card present

So then it tries to TFTP boot ā€¦ but it should boot from eMMC (i.e. mmc1). I admit, the partitioning approach is a bit confusing to me, I would have thought that 5 block write would be OK - but it seems to mess up the rest of the boot?

Thanks!

Mainline u-boot is looking for /extlinux/extlinux.conf

Regards,

OK, I wonā€™t lie - but you lost me on that one LOL. I did some searching, but I admit ā€¦ not finding the partitioning info. It seems like there is a ā€œhardā€ write of MLO and u-boot.img ā€¦ and that extending the latter to 6 blocks (vs. the ā€œstockā€ 4 blocks) somehow messes up the eMMC? But - everything I find says that 4 MB should be available there, so itā€™s not quite making sense. Hmmm.

OK, I think this is the key! When I update u-boot, even with a 4 block version (I rebuilt v2022.04) ā€¦ it seems to mess up the eMMC, flash partitioning and/or CRC. Any way to avoid this?

Thanks!

Itā€™s okay to ignore thatā€¦ ā€œbad CRCā€ is the same error when itā€™s ā€˜blankā€™ and not usedā€¦

Regards,

Makes sense. A bit more debugging ā€¦ if I replace the u-boot files (MLO, u-boot-dtb.img) on the flasher image (MicroSD) ā€¦ flash and boot => I get this mmc related error message. Itā€™s like the mmc format needs to be in u-boot somehow / somewhere, but itā€™s not with stock u-boot? I admit, pulling my hair out trying to figure that one out, and I donā€™t have enough (hair) to spare LOL.

Thanks!

please post the full serial log.

Sorry, just saw this - my bad! :frowning_face:. But a bit more debugging, this is very odd - and likely me, but not sure what Iā€™m doing wrong.

If I flash MLO, the one I built - it works fine. But, my u-boot.img fails ā€¦ and I think itā€™s somehow flashing related. I say that because if I have a working eMMC boot, but then do,

sudo dd of=u-boot-dtb.img if=/dev/mmcblk1 count=4 seek=1 bs=384k
sudo dd if=u-boot-dtb.img of=/dev/mmcblk1 count=4 seek=1 bs=384k

So really, just reading the u-boot that is there, to a file and flash it back. Then boot fails (hangs). Huh?!?! Am I doing something stupid? Likely :laughing:. But until I get this figured out, I donā€™t see how my (5 sector!) u-boot.img will work.

Thanks!

Yep, me being stupid LOL. Needed to change seek to skip on the first one, then the file I ā€œdownloadā€ from flash looks right, and writing it back is fine, nothing broken. So the commands need to be,

sudo dd of=u-boot-dtb.img if=/dev/mmcblk1 count=4 skip=1 bs=384k
sudo dd if=u-boot-dtb.img of=/dev/mmcblk1 count=4 seek=1 bs=384k

But, the u-boot I build - I went back to v2022.04, so it fits in 4 blocks ā€¦ still an issue. I write that file (u-boot-dtb.img) out, and it does start to boot (as below, I can see my version of u-boot!). But ā€¦ still the mmc issue, so somehow the write is breaking ā€œpartitioningā€ (though there is only 1 partition, with fixed offsets it seems somehow!!!).

U-Boot 2022.04-dirty (Jan 07 2025 - 14:07:01 -0600)

CPU  : DRA752-GP ES2.0
Model: BeagleBoard.org BeagleBone AI
Board: BeagleBone AI REV A
DRAM:  1 GiB
Core:  60 devices, 16 uclasses, devicetree: separate
MMC:   no pinctrl state for default mode
omap_hsmmc_init_setup: timedout waiting for cc2!
no pinctrl state for default mode
omap_hsmmc_init_setup: timedout waiting for cc2!
mmc@480d1000 - probe failed: -110
OMAP SD/MMC: 0, OMAP SD/MMC: 1no pinctrl state for default mode
omap_hsmmc_init_setup: timedout waiting for cc2!

Loading Environment from FAT... MMC: no card present
Loading Environment from MMC... *** Warning - bad CRC, using default environment

Net:   eth2: ethernet@48484000
Hit any key to stop autoboot:  0
MMC: no card present
MMC: no card present
switch to partitions #0, OK
mmc1(part 0) is current device
Scanning mmc 1:1...
MMC: no card present
Scanning disk mmc@4809c000.blk...
Disk mmc@4809c000.blk not ready
Scanning disk mmc@480b4000.blk...
no pinctrl state for default mode
omap_hsmmc_init_setup: timedout waiting for cc2!
Scanning disk mmc@480d1000.blk...
Disk mmc@480d1000.blk not ready
Found 2 disks
No EFI system partition
BootOrder not defined
EFI boot manager: Cannot load any image
starting USB...
Bus usb@488d0000: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus usb@488d0000 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
ethernet@48484000 Waiting for PHY auto negotiation to complete. done
link up on port 0, speed 100, full duplex
BOOTP broadcast 1
DHCP client bound to address 192.168.0.88 (4 ms)
*** Warning: no boot file name; using 'C0A80058.img'
Using ethernet@48484000 device
TFTP from server 192.168.0.1; our IP address is 192.168.0.88
Filename 'C0A80058.img'.
Load address: 0x82000000
Loading: T T T T T T T T T T T T T T T T T T T T
Retry count exceeded; starting again
missing environment variable: pxeuuid
Retrieving file: pxelinux.cfg/01-28-ec-9a-f1-02-f0
link up on port 0, speed 100, full duplex
Using ethernet@48484000 device
TFTP from server 192.168.0.1; our IP address is 192.168.0.88
Filename 'pxelinux.cfg/01-28-ec-9a-f1-02-f0'.
Load address: 0x80100000
Loading: T T T T T T T T T T T T T T T T T T T T

Pulling my hair out :frowning_face:. Iā€™m not sure if itā€™s a DTB issue, or something else. Any pointers would be appreciated. Thanks!

OK, slight update :laughing:. I did also clone and build the beagleboard.org version of u-boot (from here). I can flash and run this one, no issues. So some progress, but still odd - what is messing up the eMMC format or files? Thinking this is the key open item here.

Thanks!!

Still trying to debug, LOL. I have been hunting around, but does anyone know how to mount the .img file (e.g. u-boot-dtb.img, output from build process)? To be able to check it in more detail.

Thanks!