I have a beaglebone green and I am looking to update u-boot to the latest (not for any reason in particular other than to learn). I can seem to find a guide that does this though. Below are the steps that I have taken to try to get it to work, but whenever I turn the device on it gets hung at SPL with the following message:
"U-Boot SPL 2022.01-00657-g2d7a463e82 (Feb 16 2022 - 17:42:54 -0500)
Trying to boot from MMC2
"
Steps I have taken:
git clone https://github.com/beagleboard/u-boot.git
cd u-boot
export MAKEFLAGS=-j$(nproc) #make -j $(nproc)
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- distclean
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- O=am335x_evm am335x_evm_defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- O=am335x_evm
sudo cp MLO âŚ/mnt
sudo cp u-boot.img âŚ/mnt
sudo sync
sudo umount ./mnt
sudo dd if=./MLO of=/dev/mmcblk0 count=1 seek=1 bs=128k
sudo dd if=./u-boot.img of=/dev/mmcblk0 count=2 seek=1 bs=384k
In addition to this I have even attempted to drop the MLO and u-boot.img file into the u-boot folder as I saw where someone did that, but nothing worked for me.
@RobertCNelson Am I able to write this to an active device? I have tried a couple times and when I reboot, only the MLO loads. I am able to boot it again using an sd card. When I get to the user space on the sd card if I try to write the u-boot-dtb.img to the eMMC it works. There is no change in the command just from where I am working from. From there I can reboot and the device will load perfectly.
Hey @RobertCNelson I found that 2022 u-boot seems to boot the device well and I have had no issues when it has been written correctly on the device. My issue is that I am booting off of the eMMC and trying to also write there. It doesnât seem like this should be an issue, but again only the MLO is loading when I do the initial flash.
If I boot the beaglebone from a different media device (sd card/NFS), I can flash the same u-boot-dtb.img file that I was attempting to flash previously and it will work. Is there something off with my commands?
In u-boot, on the am335x, the writing instructions are the same for microSD vs eMMC⌠(aka nothing special for eMMC)âŚ
On the AM335x, the bootrom scanâs eMMC first over microSD⌠So if it finds MLO on the eMMC itâll load that first no matter what⌠(The boot button on the BBB changes this order, to help ignore the eMMC, but since itâs sysboot pins, it must be done before power on, as these pins are very special and only scanned by the bootrom early on startupâŚ)
@RobertCNelson
I am sorry, I think I am not getting my point across that well. Thank you for your patience.
My goal in this project is to perform an âOTAâ upgrade for devices going from wheezy to bullseye. Stage one is to update the u-boot on the device, as the u-boot for 2015 doesnât support pxebooting. Stage two is to boot the device using PXE, Stage Three is to flash the device with an updated image.
In stage one, I mount an NFS from the wheezy operating system to a folder that has the u-boot-dtb.img and MLO files.
Not sure if this is related, but this device does have boot partitions. From my understanding there is nothing present in these and that they are not used. (added the underscores to keep it as one block.)
Disk /dev/mmcblk0: 3909 MB, 3909091328 bytes
4 heads, 16 sectors/track, 119296 cylinders, total 7634944 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x82034f61
_
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 * 2048 2099199 1048576 83 Linux
/dev/mmcblk0p2 2099200 4196351 1048576 83 Linux
/dev/mmcblk0p3 4196352 6293503 1048576 83 Linux
/dev/mmcblk0p4 6293504 7634943 670720 83 Linux
_
Disk /dev/mmcblk0boot1: 2 MB, 2097152 bytes
4 heads, 16 sectors/track, 64 cylinders, total 4096 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
_
Disk /dev/mmcblk0boot1 doesnât contain a valid partition table
_
Disk /dev/mmcblk0boot0: 2 MB, 2097152 bytes
4 heads, 16 sectors/track, 64 cylinders, total 4096 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
_
Disk /dev/mmcblk0boot0 doesnât contain a valid partition table
@RobertCNelson
My guess at this point is that the kernel is trying to fix the filesystem. If I power the device off, without using the reboot command and within 15 seconds of the device write I am able to get SPL to load u-boot with no issues. I have also found that if I completely crash the kernel this will work as well, upon a manual reboot it works as well.
To crash the kernel echo 1 > /proc/sys/kernel/sysrq echo c > /proc/sysrq-trigger