PROCESSOR-SDK-J784S4: Modify default environment variables of boot flow

Part Number: PROCESSOR-SDK-J784S4

Tool/software:

Hi Team,

 Board: Customised version of J784S4 EVM
SDK version : www.ti.com/.../09.02.00.05

Here, I am booting from eMMC in the board. But boot is getting stuck as default rootfs is mounting from SD-card.But if I interrupt at u-boot command prompt and give setenv bootpart 0:1, rootfs is getting mounted from eMMC,but I don't want to do manually everytime.

As part of that I want to achieve following.

1.I want to change that default rootfs access for eMMC bootmode from /dev/mmcblk0p1 partition.

2.I want to change the default access location of uEnv.txt for eMMC boot mode like uEnv.txt needs to be accessed from /dev/mmcblk0p1.

So, please specify the all possible ways to achieve these with exact file paths like where/which to modify.

Thanks & Regards,

Naradham Dharanija

  • Hi Naradham ,

    1.I want to change that default rootfs access for eMMC bootmode from /dev/mmcblk0p1 partition.

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

    You can add the above commands to the uEnv.txt file and it would change the default rootfs acces to /dev/mmcblk0p1.

    2.I want to change the default access location of uEnv.txt for eMMC boot mode like uEnv.txt needs to be accessed from /dev/mmcblk0p1.

    You will need to have an additional FAT32 partition in eMMC UDA parition in order to store uENV.txt in eMMC as the envboot command in uboot responsible for fetching the uENV.txt file uses the fatload command. Your /dev/mmcblk0p1 partition is EXT4 right since it contains the rootfs.

    An alternative which I would suggest would be to store the uENV.txt in the FAT32 partition of SD card after adding the above mentioned commands.

    Regards

    Gokul

  • Hi Gokul,
     

    Thanks for the reply.

    I want to mount the rootfs from the eMMC automatically without interrupting at u-boot and completely without SD card inserted.

    So, as you suggested I have added that content into uEnv.txt, which is residing in mmcblk0p1 of FAT32 type.
    Content added:

    setenv mmcdev 0
    setenv bootdev 0
    setenv bootpart 0:2

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

    And my rootfs is residing in mmcblk0p1 of ext4 type.

    FYI, adding bootpart=1:2 or bootpart=0:2 is sufficient enough to mount the rootfs from respective device:partition, tested and confirmed.
    But here the issue is boot is defaultly trying to access the uEnv.txt of /dev/mmcblk1p1 (FAT32) not from the /dev/mmcblk0p1 eventhough mmcblk0p1 having uEnv.txt.And boot is getting stuck if SD card is removed.
    Bootlogs (If sd card removed and uEnv.txt is available in mmcblk0p1 and rootfs is in mmcblk0p2)

    U-Boot SPL 2023.04 (Sep 02 2025 - 10:47:54 -0600)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.2.4--v09.02.04 (Kool Koala)')
    i2c_write: error waiting for data ACK (status=0x116)
    tps6287x_regulator tps62873@40: CTRL2 reg read failed: -121
    [MJM debug] arch/arm/mach-k3/j784s4_init.c:board_init_f() line 255: build=CONFIG_TARGET_J784S4_R5_WTX_AQUILA_V3
    [MJM debug] arch/arm/mach-k3/j784s4_init.c:board_init_f() line 271: max number of supported DRAM banks: 4; number of active DRAM banks: 2
    SPL initial stack usage: 13464 bytes
    Trying to boot from MMC1
    Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
    Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
    Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
    Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
    Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
    Loading Environment from nowhere... OK
    init_env from device 17 not supported!
    Starting ATF on ARM64 core...
    
    NOTICE:  BL31: v2.10.0(release):v2.10.0-367-g00f1ec6b87-dirty
    NOTICE:  BL31: Built : 16:09:05, Feb  9 2024
    I/TC: 
    I/TC: OP-TEE version: 4.1.0-51-g012cdca49 (gcc version 11.4.0 (GCC)) #1 Tue Jan 30 10:48:03 UTC 2024 aarch64
    I/TC: WARNING: This OP-TEE configuration might be insecure!
    I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecture/porting_guidelines.html
    I/TC: Primary CPU initializing
    I/TC: GIC redistributor base address not provided
    I/TC: Assuming default GIC group status and modifier
    I/TC: SYSFW ABI: 3.1 (firmware rev 0x0009 '9.2.4--v09.02.04 (Kool Koala)')
    I/TC: HUK Initialized
    I/TC: Activated SA2UL device
    I/TC: Fixing SA2UL firewall owner for GP device
    I/TC: Enabled firewalls for SA2UL TRNG device
    I/TC: SA2UL TRNG initialized
    I/TC: SA2UL Drivers initialized
    I/TC: Primary CPU switching to normal world boot
    
    U-Boot SPL 2023.04 (Sep 02 2025 - 10:49:36 -0600)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.2.4--v09.02.04 (Kool Koala)')
    [MJM debug] arch/arm/mach-k3/j784s4_init.c:board_init_f() line 252: build=CONFIG_TARGET_J784S4_A72_WTX_AQUILA_V3
    Trying to boot from MMC1
    Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
    Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
    
    
    U-Boot 2023.04 (Sep 02 2025 - 10:49:36 -0600)
    
    SoC:   J784S4 SR1.0 GP
    Model: Wavetronix Aquila_v3 DSP Board
    DRAM:  [MJM debug] board/ti/wtx_aquila_v3/dsp_board.c:board_get_usable_ram_top() line 42 gd->ram_top = 0x0000000100000000
    2 GiB (effective 16 GiB)
    [MJM debug] board/ti/wtx_aquila_v3/dsp_board.c:board_get_usable_ram_top() line 42 gd->ram_top = 0x0000000100000000
    idle-statesCore:  91 devices, 33 uclasses, devicetree: separate
    Flash: spi_nand nand@0: unknown raw ID fde8d9e0
    0 Bytes
    MMC:   mmc@4f80000: 0, mmc@4fb0000: 1
    Loading Environment from nowhere... OK
    In:    serial@2880000
    Out:   serial@2880000
    Err:   serial@2880000
    am65_cpsw_nuss ethernet@46000000: K3 CPSW: nuss_ver: 0x6BA02102 cpsw_ver: 0x6BA82102 ale_ver: 0x00293904 Ports:1 mdio_freq:1000000
    Net:   Could not get PHY for ethernet@46000000port@1: addr 0
    am65_cpsw_nuss_port ethernet@46000000port@1: phy_connect() failed
    No ethernet found.
    
    Hit any key to stop autoboot:  0 
    MMC: no card present
    mmc_init: -123, time 2002
    SD/MMC found on device 1
    [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]: 1
    [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.scr
    MMC: no card present
    mmc_init: -123, time 2002
    ** Bad device specification mmc 1 **
    Couldn't find partition mmc 1
    Can't set block device
    [wtx debug] fs/fs.c:do_load() line 766: argc=5; arg[0]: fatload
    [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]: 1
    [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]: uEnv.txt
    MMC: no card present
    mmc_init: -123, time 2002
    ** Bad device specification mmc 1 **
    Couldn't find partition mmc 1
    Can't set block device
    MMC: no card present
    mmc_init: -123, time 2002
    ** Bad device specification mmc 1 **
    i2c_write: error waiting for data ACK (status=0x116)
    pca953x gpio@20: Error reading output register
    i2c_write: error waiting for data ACK (status=0x116)
    pca953x gpio@22: Error reading output register
    GPIO: 'gpio@22_17' not found
    Command 'gpio' failed: Error -22
    i2c_write: error waiting for data ACK (status=0x116)
    pca953x gpio@20: Error reading output register
    i2c_write: error waiting for data ACK (status=0x116)
    pca953x gpio@22: Error reading output register
    GPIO: 'gpio@22_16' not found
    Command 'gpio' failed: Error -22
    k3_r5f_rproc r5f@41000000: Core 1 is already in use. No rproc commands work
    [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]: 1: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]: /lib/firmware/j784s4-mcu-r5f0_1-fw
    MMC: no card present
    mmc_init: -123, time 2002
    ** Bad device specification mmc 1 **
    Couldn't find partition mmc 1: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]: 1: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]: /lib/firmware/j784s4-main-r5f0_0-fw
    MMC: no card present
    mmc_init: -123, time 2002
    ** Bad device specification mmc 1 **
    Couldn't find partition mmc 1: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]: 1: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]: /lib/firmware/j784s4-main-r5f0_1-fw
    MMC: no card present
    mmc_init: -123, time 2002
    ** Bad device specification mmc 1 **
    Couldn't find partition mmc 1: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]: 1: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]: /lib/firmware/j784s4-main-r5f1_0-fw
    MMC: no card present
    mmc_init: -123, time 2002
    ** Bad device specification mmc 1 **
    Couldn't find partition mmc 1: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]: 1: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]: /lib/firmware/j784s4-main-r5f1_1-fw
    MMC: no card present
    mmc_init: -123, time 2002
    ** Bad device specification mmc 1 **
    Couldn't find partition mmc 1: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]: 1: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]: /lib/firmware/j784s4-main-r5f2_0-fw
    MMC: no card present
    mmc_init: -123, time 2002
    ** Bad device specification mmc 1 **
    Couldn't find partition mmc 1: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]: 1: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]: /lib/firmware/j784s4-main-r5f2_1-fw
    MMC: no card present
    mmc_init: -123, time 2002
    ** Bad device specification mmc 1 **
    Couldn't find partition mmc 1: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]: 1: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]: /lib/firmware/j784s4-c71_0-fw
    
    


    So.for this what are the modifications I need to enable from u-boot source code to access uEnv.txt from eMMC instead of SD card defaultly .

    Clearly ,

    Uenv.txt needs to be accessed from SD card (/dev/mmcblk1p1) in SD-card boot mode.

    Uenv.txt needs to be accessed from eMMC(/dev/mmcblk0p1) in eMMC boot mode.

    Thank you.

  • HI Naradham,

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

     [FAQ] TDA4VH:Enable saveenv feature in SDCARD , eMMC and a workaround for saveenv in OSPI flash. 

    Once you have enabled saveenv , 

    use the below commands for SD CARD and eMMC:

    > setenv mmcdev 0 [For saving uEnv.txt from FAT32 partition of  eMMC]

    > setenv mmcdev 1[ For loading uENV.txt from FAT32 partition of  SD card]

    > saveenv

    Reboot the board.

    Regards

    Gokul