I’m trying to automate the process of flashing a bootable emmc (NAND) on my beagle bone black. I’ve pin strapped the board to boot using bootp/dhcp - the kernel that gets loaded by the u-boot.img (that was pulled in via dhcp+tftp) uses an initramfs as the basis of writing the MLO, (a different) u-boot.img and root file system (containing zImage and uEnv.txt) to emmc/NAND. This all works and when I restart the beagle bone black it boots as I expect. Hooray for automated emmc flashing.
However my problem is that I can’t seem to hand roll a version the the MLO and u-boot.img that I flash to NAND. What I’m using right now are copies I found of these two files in the debian images distributed here: https://beagleboard.org/latest-images (These images tend to contain filesystems with /opt/backup/uboot/MLO and /opt/back/uboot/u-boot.img files existing). If I use these two boot loader files, and craft my /boot/uEnv.txt just so (uuid needs to be specified), then I can boot a couple of kernels/filesystems I have lying around successfully.
But I can’t seem to reproduce these two files (MLO and u-boot.img) for my NAND from source. I’ve tried these git repos:
and even the u-boot source that that ships with the SDK:
For each of those I’m running
make CROSS_COMPILE=arm-linux-gnueabihf- O=am335x_evm am335x_evm_defconfig && make CROSS_COMPILE=arm-linux-gnueabihf- O=am335x_evm
And I’ve even tried a different config:
make CROSS_COMPILE=arm-linux-gnueabihf- O=am335x_boneblack am335x_boneblack_defconfig && make CROSS_COMPILE=arm-linux-gnueabihf- O=am335x_boneblack
This compilation process creates the MLO and u-boot.img files, but I can never seem to successfully boot anything if I use them regardless of which config I use.
If it helps with clarity, I am trying out MLO and u-boot.img files by booting from the SD card, copying over the new versions, and then running
dd if=MLO of=/dev/mmcblk1 conv=notrunc bs=128k count=1 seek=1
dd if=u-boot.img of=/dev/mmcblk1 conv=notrunc bs=384k count=2 seek=1
Note that I can always get back to the “bootable state” by writing the backup boot loader files that come with debian distro instead: (the sd card is running debian 8.7):
dd if=/opt/backup/uboot/MLO of=/dev/mmcblk1 conv=notrunc bs=128k count=1 seek=1
dd if=/opt/backup/uboot/u-boot.img of=/dev/mmcblk1 conv=notrunc bs=384k count=2 seek=1
How can I build MLO and u-boot.img files in order to successfully boot a kernel and file system of my choosing on the emmc/NAND? Is there a page somewhere? Any help would be appreciated.