J784S4XEVM: Issue in taking the rootfs partition from the eMMC

Part Number: J784S4XEVM

Tool/software:

    

I was able to copy the contents of the boot partition as well as the rootfs from the SD card to the boot0 partition of the eMMC, and the board is booting successfully. However, it still expects the rootfs contents from the SD card unless I manually set bootpart=0:2 in the U-Boot terminal.

We need to automate this so that when booting from the eMMC, it should automatically take the rootfs from the eMMC without requiring manual intervention.

Could you please guide me on how to achieve this?

Thanks,
Kowshika

  • HI Kowshika,

    Can you try following the steps in the below FAQ under the heading SAVE ENABLE ON SD CARD FAT PARTITION:

     https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1448106/faq-tda4vh-enable-saveenv-feature-in-sdcard-emmc-and-a-workaround-for-saveenv-in-ospi-flash 

    Regards

    Gokul

  •   

    I somehow enabled the saveenv in my u-boot terminal.After saving the environment, the system began booting the rootfs from eMMC automatically. When I change the boot configuration back to use the SD card and then switch it again to eMMC, I face problems accessing the rootfs.





    Can you help me understand why this happens and suggest a solution?

  • Hi Kowshika,

    Can you share the detailed steps you had followed including the commands entered in UBOOT .

    Regards

    Gokul

  •  

    Steps I Followed
    Case 1: Booting from eMMC (Works Fine Initially)

    setenv bootpart 0:2 # Set rootfs to eMMC
    saveenv
    boot

    The board boots successfully with the rootfs from eMMC.

    Case 2: Switching to SD Card (Works Fine)

    setenv bootpart 1:2 # Set rootfs back to eMMC
    saveenv
    boot

    The board boots successfully with the rootfs from SD card.

    Case 3: Switching Back to eMMC (Issue Appears)

    setenv bootpart 0:2 # Set rootfs back to eMMC
    saveenv
    boot


    After this, I face issues with the rootfs when trying to boot from eMMC again.

    Initially, booting from eMMC works fine.

    Switching to SD card also works fine.

    But switching back to eMMC causes rootfs-related issues.

    Can you help me understand why this issue occurs after toggling between SD card and eMMC and suggest how to fix it?

    Regards, 
    Kowshika

  • Hi Kowshika,

    Can you try the following commands:

    Switching to EMMC:

    setenv bootdev 0
    setenv bootpart 0:2
    setenv args_mmc "run finduuid;setenv bootargs console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait"
    
    

    Switching to SD card:

    setenv bootdev 1
    setenv bootpart 1:2
    setenv args_mmc "run finduuid;setenv bootargs console=ttyS2,115200n8 root=/dev/mmcblk1p2 rw rootfstype=ext4 rootwait"
    
    

    Regards

    Gokul

  •  

    When I execute the above commands, everything works fine without using saveenv. However, if I run saveenv after these commands, the boot process fails and throws the errors below.

    ** No partition table - mmc 0 **
    Couldn't find partition mmc 0:2
    Can't set block device
    [wtx debug] fs/fs.c:do_load() line 766: argc=5; arg[0]: load
    [wtx debug] fs/fs.c:do_load() line 766: argc=5; arg[1]: mmc
    [wtx debug] fs/fs.c:do_load() line 766: argc=5; arg[2]: 0:2
    [wtx debug] fs/fs.c:do_load() line 766: argc=5; arg[3]: 0x82000000
    [wtx debug] fs/fs.c:do_load() line 766: argc=5; arg[4]: /boot/Image
    ** No partition table - mmc 0 **
    Couldn't find partition mmc 0:2
    Can't set block device
    [wtx debug] fs/fs.c:do_load() line 766: argc=5; arg[0]: load
    [wtx debug] fs/fs.c:do_load() line 766: argc=5; arg[1]: mmc
    [wtx debug] fs/fs.c:do_load() line 766: argc=5; arg[2]: 0:2
    [wtx debug] fs/fs.c:do_load() line 766: argc=5; arg[3]: 0x88000000
    [wtx debug] fs/fs.c:do_load() line 766: argc=5; arg[4]: /boot/dtb/ti/k3-j784s4-wtxAquila_v3.dtb
    ** No partition table - mmc 0 **
    Couldn't find partition mmc 0:2
    Can't set block device
    libfdt fdt_check_header(): FDT_ERR_BADMAGIC
    No FDT memory address configured. Please configure
    the FDT address via "fdt addr <address>" command.
    Aborting!
    Bad Linux ARM64 Image magic!
    switch to partitions #0, OK
    mmc0(part 0) is current device
    ** No partition table - mmc 0 **
    Couldn't find partition mmc 0:1
    MMC: no card present
    mmc_init: -123, time 2002
    starting USB...
    No working controllers found
    USB is stopped. Please issue 'usb start' first.
    starting USB...
    No working controllers found
    Could not get PHY for ethernet@46000000port@1: addr 0
    am65_cpsw_nuss_port ethernet@46000000ethernet@46000000port@1: phy_connect() failed
    Could not get PHY for ethernet@46000000port@1: addr 0
    am65_cpsw_nuss_port ethernet@46000000ethernet@46000000ethernet@46000000port@1: phy_connect() failed
    Could not get PHY for ethernet@46000000port@1: addr 0
    am65_cpsw_nuss_port ethernet@46000000ethernet@46000000ethernet@46000000ethernet@46000000port@1: phy_connect() failed
    Could not get PHY for ethernet@46000000port@1: addr 0
    am65_cpsw_nuss_port ethernet@46000000ethernet@46000000ethernet@46000000ethernet@46000000ethernet@46000000port@1: phy_connect() failed
    Could not get PHY for ethernet@46000000port@1: addr 0
    am65_cpsw_nuss_port ethernet@46000000ethernet@46000000ethernet@46000000ethernet@46000000ethernet@46000000ethernet@46000000port@1: phy_connect() failed
    "Synchronous Abort" handler, esr 0x8a000000
    elr: ffffffffb1d40472 lr : ffffffffb1d40472 (reloc)
    elr: 0000000031407472 lr : 0000000031407472
    x0 : 00000000ffffffed x1 : 0000000000000000
    x2 : 0000000000000002 x3 : 00000000fde97f60
    x4 : 00000000fffbfd50 x5 : 00000000fde97f80
    x6 : 0000000000000021 x7 : 00000000fdedc0e0
    x8 : 00000000fde72df0 x9 : 0000000000000008
    x10: 00000000ffffffd8 x11: 000000000000000a
    x12: 0000000000002d18 x13: 00000000fde71ee8
    x14: 00000000fde72df0 x15: 0000000000000002
    x16: 00000000fff2fe0c x17: 0000000000000000
    x18: 00000000fde86db0 x19: 00000000fde93a10
    x20: 00000000fde93a30 x21: 00000000fffef000
    x22: 0000000000000004 x23: 00000000fffed000
    x24: 0000000000000000 x25: 00000000fffef000
    x26: 00000000fffed000 x27: 0000000000000000
    x28: 00000000fde96930 x29: 6f70303030303030

    Code: 00000000 00000000 00000000 00000000 (00000000) 
    Resetting CPU ...

    resetting ...

    Without saveenv → System boots successfully.

    With saveenv → Boot fails due to missing partition table and bad FDT address.

    What do these logs imply? Does saveenv overwrite some environment variables like bootargs or MMC partition settings?

  • Hi Kowshika,

    Can you confirm if your SD card was inserted while running the saveenv command because the environment variables are stored in the SD card on executing the saveenv command.

    Regards

    Gokul

  • No when i am in emmc mode i didn't insert the sd card

  • HI Kowshika,

    Can you insert that and try once.

    Regards

    Gokul

  • Ok 

    I will try and let you know the results

    Regards
    Kowshika

  • Sure Kowshika.