This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

beaglebone black dont boot from emmc

I have BBB board . I use this device with Buildroot. Some days ago i decide to switch on new release of Buildroot. Generated Image perfectly working from external SD card. But when i copy hhis Image to eMMC

boot is failed. Uboot tryed boot from another sysrems. But when, i type in uboot prompt "boot" system  booted succesfully.

                                                                               
U-Boot 2020.04 (Nov 05 2020 - 22:34:11 +0700)                                   
                                                                                
CPU  : AM335X-GP rev 2.1                                                        
Model: TI AM335x BeagleBone Black                                               
DRAM:  512 MiB                                                                  
WDT:   Started with servicing (60s timeout)                                     
NAND:  nand_base: timeout while waiting for chip to become ready                
nand_base: No NAND device found                                                 
0 MiB                                                                           
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1                                           
Loading Environment from FAT... MMC: no card present                            
mmc_init: -123, time 2                                                          
In:    serial@44e09000                                                          
Out:   serial@44e09000                                                          
Err:   serial@44e09000                                                          
<ethaddr> not set. Validating first E-fuse MAC                                  
Net:   eth0: ethernet@4a100000                                                  
Warning: usb_ether MAC addresses don't match:                                   
Address in ROM is          de:ad:be:ef:00:01                                    
Address in environment is  7c:66:9d:0c:55:fb                                    
, eth1: usb_ether                                                               
Hit any key to stop autoboot:  0                                                
MMC: no card present                                                            
mmc_init: -123, time 1                                                          
MMC: no card present                                                            
mmc_init: -123, time 2                                                          
MMC: no card present                                                            
mmc_init: -123, time 2                                                          
MMC: no card present                                                            
mmc_init: -123, time 2                                                          
MMC: no card present                                                            
mmc_init: -123, time 2                                                          
switch to partitions #0, OK                                                     
mmc1(part 0) is current device                                                  
Scanning mmc 1:1...                                                             
40817 bytes read in 8 ms (4.9 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...

When  failed: 

=> <INTERRUPT>                                                                  
=> boot                                                                         
switch to partitions #0, OK                                                     
mmc1(part 0) is current device                                                  
SD/MMC found on device 1                                                        
340 bytes read in 2 ms (166 KiB/s)                                              
Loaded env from uEnv.txt                                                        
Importing environment from mmc1 ...                                             
Running uenvcmd ...                                                             
6090952 bytes read in 446 ms (13 MiB/s)                                         
40817 bytes read in 8 ms (4.9 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 ...                                                             
                                                                                
[    0.000000] Booting Linux on physical CPU 0x0

uboot config : am335x_evm_defconfig

uEnv.txt from

vfat partition eMMC

# cat /mnt/uEnv.txt
bootpart=1:1
devtype=mmc
bootdir=
bootfile=zImage
bootpartition=mmcblk1p2
console=ttyS0,115200n8
loadaddr=0x82000000
fdtaddr=0x88000000
set_bootargs=setenv bootargs console=${console} root=/dev/${bootpartition} rw rootfstype=ext4 rootwait
uenvcmd= run set_bootargs;run loadimage;run loadfdt;printenv bootargs;bootz ${loadaddr} - ${fdtaddr}
#

  • From your description, the issue seems related with u-boot environment.
    You may want to take a closer look at "envboot" as listed below in "/include/environment/ti/mmc.h"
    ${mmcdev} may point to SD (=0) instead of eMMC (=1)

    	"envboot=mmc dev ${mmcdev}; " \
    		"if mmc rescan; then " \
    			"echo SD/MMC found on device ${mmcdev};" \
    			"if run loadbootscript; then " \
    				"run bootscript;" \
    			"else " \
    				"if run loadbootenv; then " \
    					"echo Loaded env from ${bootenvfile};" \
    					"run importbootenv;" \
    				"fi;" \
    				"if test -n $uenvcmd; then " \
    					"echo Running uenvcmd ...;" \
    					"run uenvcmd;" \
    				"fi;" \
    			"fi;" \
    		"fi;\0" \

  • Thanks for  reply. But situation is more complicated as it seems to me

    Hit any key to stop autoboot:  0                                               
    MMC: no card present                                                           
    mmc_init: -123, time 1                                                         
    MMC: no card present                                                           
    mmc_init: -123, time 2                                                         
    MMC: no card present                                                           
    mmc_init: -123, time 2                                                         
    MMC: no card present                                                           
    mmc_init: -123, time 2                                                         
    MMC: no card present                                                           
    mmc_init: -123, time 2                                                         
    switch to partitions #0, OK                                                    
    mmc1(part 0) is current device                                                 
    Scanning mmc 1:1...                                                            
    40817 bytes read in 8 ms (4.9 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...
    As I can see MLO tried to boot u-Image from SD, then switched to eMMC, read it, at this moment mmcdev=1, but dont read uEnv.txt.

    When I cancel booting process I print mmcdev at this noment mmcdev = 1. 
     This can be seen from the fact that the command "boot" successfully compleeted.

    Problem in MLO algoritm switching from SD to eMMC as it seems to me

  • SPL/u-boot booting media depends on SYSBOOT[4:0] sampled at POR.
    kernel/dtb loading media/order is configured in u-boot environment.
    I'm using the SDK6.3 u-boot as an example, in "/include/configs/am335x_evm.h"

    #define BOOT_TARGET_DEVICES(func) \
    	func(MMC, mmc, 0) \
    	func(LEGACY_MMC, legacy_mmc, 0) \
    	func(MMC, mmc, 1) \
    	func(LEGACY_MMC, legacy_mmc, 1) \
    	func(NAND, nand, 0) \
    	BOOT_TARGET_PXE(func) \
    	BOOT_TARGET_DHCP(func)

    It translates to portion of u-boot environment list from running "printenv" cmd @u-boot prompt:

    bootcmd=if test ${boot_fit} -eq 1; then run update_to_fit; fi; run findfdt; run init_console; run envboot; run distro_bootcmd	
    boot_targets=mmc0 legacy_mmc0 mmc1 legacy_mmc1 nand0 pxe dhcp
    distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done

    It indicates kernel/dtb loading order considering multiple AM335x boards(GP, BBB, SK, ICE...): mmc0(SD), mmc1(eMMC), nand, usb, ethernet...
    For user's specific intended boot order, u-boot environment needs to be modified and optimized accordingly.
    In your case, in addition to "setenv mmcdev 1", how about an additional one "setenv bootpart 1:2" .