Beagleboneblack MMC Boot Not Working

Hi folks,

I struggled to boot from MMC without SD Card on Beagleboneblack. I think U-Boot didnt read
my uboot.env.Because i checked it U-Boot terminal, bootcmd different than my uboot.env and bootargs not defined.
Also when i try to save the modified environment variable, i couldnt do it, i got the
"=> saveenv
Saving Environment to FAT… Failed (1)
"
What kind of modification i need to make on U-Boot for boot from SD Card and after writing eMMC , it boot from MMC without SD Card?

Best regards.

U-boot 2022.04
Rootfs ubuntu-20.04.6-minimal-armhf-2023-08-22
Kernel Linux arm 6.1.67-dirty

I also share my U-Boot .config file

U-Boot SPL 2022.04 (Nov 02 2023 - 14:35:50 +0300)
Trying to boot from MMC2


U-Boot 2022.04 (Nov 02 2023 - 14:35:50 +0300)

CPU  : AM335X-GP rev 2.1
Model: TI AM335x BeagleBone Black
DRAM:  512 MiB
Core:  150 devices, 14 uclasses, devicetree: separate
WDT:   Started wdt@44e35000 with servicing (60s timeout)
NAND:  0 MiB
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Loading Environment from FAT... <ethaddr> not set. Validating first E-fuse MAC
Net:   Could not get PHY for ethernet@4a100000: addr 0
eth2: ethernet@4a100000, eth3: usb_ether
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc1(part 0) is current device
Scanning mmc 1:1...
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Scanning disk mmc@48060000.blk...
Disk mmc@48060000.blk not ready
Scanning disk mmc@481d8000.blk...
Found 3 disks
No EFI system partition
BootOrder not defined
EFI boot manager: Cannot load any image
## Error: "bootcmd_nand0" not defined
starting USB...
Bus usb@47401800:
U-Boot SPL 2022.04 (Nov 02 2023 - 14:35:50 +0300)
Trying to boot from MMC2


U-Boot 2022.04 (Nov 02 2023 - 14:35:50 +0300)

CPU  : AM335X-GP rev 2.1
Model: TI AM335x BeagleBone Black
DRAM:  512 MiB
Core:  150 devices, 14 uclasses, devicetree: separate
WDT:   Started wdt@44e35000 with servicing (60s timeout)
NAND:  0 MiB
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Loading Environment from FAT... <ethaddr> not set. Validating first E-fuse MAC
Net:   Could not get PHY for ethernet@4a100000: addr 0
eth2: ethernet@4a100000, eth3: usb_ether
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc1(part 0) is current device
Scanning mmc 1:1...
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Scanning disk mmc@48060000.blk...
Disk mmc@48060000.blk not ready
Scanning disk mmc@481d8000.blk...
Found 3 disks
No EFI system partition
BootOrder not defined
EFI boot manager: Cannot load any image
## Error: "bootcmd_nand0" not defined
starting USB...
Bus usb@47401800:
....

When i enter the U-boot command line,

=> mmc list
OMAP SD/MMC: 0
OMAP SD/MMC: 1

=> ls mmc 1:1
   108732   MLO
    67693   dtb
  1229452   u-boot.img
  5060464   zImage
   131072   uboot.env

5 file(s), 0 dir(s)

=> ls mmc 1:2
<DIR>       4096 .
<DIR>       4096 ..
<DIR>       4096 srv
<DIR>       4096 boot
<DIR>       4096 dev
<DIR>       4096 proc
<DIR>       4096 etc
<DIR>       4096 run
<DIR>       4096 var
<DIR>       4096 opt
<DIR>       4096 mnt
<DIR>       4096 media
<DIR>       4096 sys
<DIR>       4096 root
<DIR>       4096 home
<DIR>       4096 bin
<DIR>       4096 tmp
<DIR>       4096 sbin
<DIR>       4096 lib
<DIR>       4096 usr

=> part list mmc 0
=> part list mmc 1

Partition Map for MMC device 1  --   Partition Type: DOS

Part    Start Sector    Num Sectors     UUID            Type
  1     2048            262144          e5aac4bd-01     0e Boot
  2     264192          7141376         e5aac4bd-02     83



=> setenv bootcmd 'load mmc 1:1 81000000 zImage; load mmc 1:1 82000000 dtb; bootz 81000000 - 82000000'
=> setenv bootargs console=ttyS0,115200n8 root=/dev/mmcblk1p2 rootwait ro
=> setenv bootdelay 0
=> saveenv
Saving Environment to FAT... Failed (1)

=> part list mmc 0
=> part list mmc 1

Partition Map for MMC device 1  --   Partition Type: DOS

Part    Start Sector    Num Sectors     UUID            Type
  1     2048            262144          e5aac4bd-01     0e Boot
  2     264192          7141376         e5aac4bd-02     83

=> boot

It successfully boot.
uboot_config.txt (49.0 KB)