uEnv.txt not loaded/read on BeagleboneB eMMC

Hi,

To summarize: I am trying to configure my Beaglebone Black to boot from eMMC but it looks like the uEnvt.txt file is not read.

What I have done:

  1. Build an image using buildroot (with beaglebone_defconfig).
    This creates MLO, zImage, u-boot.img and rootfs.tar. It also created an sdcard.img which boots just fine.

  2. Boot from the SDCard and configure the eMMC using fdisk. I followed the instructions shown here.

  3. Edit the uEnv.txt file to point to the eMMC. Contents of the file:
    bootpart=1:1
    devtype=mmc
    bootdir=
    bootfile=zImage
    bootpartition=mmcblk1p2
    console=ttyS0,115200n8
    loadaddr=0x82000000
    fdtaddr=0x88000000
    set_mmc1=if test $board_name = A33515BB; then setenv bootpartition mmcblk1p2; fi
    set_bootargs=setenv bootargs console=${console} root=/dev/${bootpartition} rw rootfstype=ext4 rootwait
    uenvcmd=run set_mmc1; run set_bootargs;run loadimage;run loadfdt;printenv bootargs;bootz ${loadaddr} - ${fdtaddr}

The outcome is that uboot fails and end up in the prompt. If I type “boot” in the prompt the board starts up from the eMMC. I do not know/understand what the difference in startup is between the board being powered and me typing in boot once it has failed.

The output on the serial port from power up:
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc1(part 0) is current device
Scanning mmc 1:1…
40817 bytes read in 4 ms (9.7 MiB/s)
switch to partitions #0, OK
mmc1(part 0) is current device
SD/MMC found on device 1
## Error: “bootcmd_nand0” not defined
starting USB…

It ends up at the uboot prompt. If I then type “boot” the OS loads:
=> boot
switch to partitions #0, OK
mmc1(part 0) is current device
SD/MMC found on device 1
513 bytes read in 1 ms (501 KiB/s)
Loaded env from uEnv.txt
Importing environment from mmc1 …
Running uenvcmd …
## Error: “set_mmc1” not defined
6090656 bytes read in 392 ms (14.8 MiB/s)
40817 bytes read in 5 ms (7.8 MiB/s)
bootargs=console=ttyS0,115200n8 root=/dev/mmcblk1p2 rw rootfstype=ext4 rootwait
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
Loading Device Tree to 8fff3000, end 8fffff70 … OK

Starting kernel …

I would appreciate any input, material to read etc. I guess I do not understand the exact process uboot follows to start the board… what am I missing?

Thank you