J784S4XEVM: Steps to Flash Image from SD-card into eMMC.

Part Number: J784S4XEVM

Tool/software:

Hi

I have a prebuilt Linux image available in SD-card received along with J784S4XEVM. I am able to boot the board using these images, now I want to flash this image into eMMC. I am following the section 3.1.1.5.4 from this document Flashing Document. As per the document it is asked to create rootfs partition before booting the kernel but I do not see the steps to create rootfs partition or write kernel from u-boot (As per the note highlighted rootfs partition cannot created from u-boot). Can you please share detailed steps for flashing complete Linux image from SD-card into eMMC.

Also, I have built Full SDK image i.e tisdk-core-bundle using command "MACHINE="j784s4-evm" bitbake -k tisdk-core-bundle" but I could not see *.wic.xz image in yocto-build/build/deploy-ti/images/j784s4-evm directory after compilation; there are no errors reported (tisdk-adas-image-j784s4-evm.rootfs.wic.xz is present), is it expected? 

Thanks,

Arjav Parikh

  • Hi Arjav,

    I have a prebuilt Linux image available in SD-card received along with J784S4XEVM. I am able to boot the board using these images, now I want to flash this image into eMMC. I am following the section 3.1.1.5.4 from this document Flashing Document. As per the document it is asked to create rootfs partition before booting the kernel but I do not see the steps to create rootfs partition or write kernel from u-boot (As per the note highlighted rootfs partition cannot created from u-boot). Can you please share detailed steps for flashing complete Linux image from SD-card into eMMC.

    It appears that there are instructions for partitioning the eMMC here: 3.1.1.5.1. Partitioning eMMC from U-Boot

    Also, I have built Full SDK image i.e tisdk-core-bundle using command "MACHINE="j784s4-evm" bitbake -k tisdk-core-bundle" but I could not see *.wic.xz image in yocto-build/build/deploy-ti/images/j784s4-evm directory after compilation; there are no errors reported (tisdk-adas-image-j784s4-evm.rootfs.wic.xz is present), is it expected? 

    What is within the folder? Are any files that include the following: tisdk-base-image, tisdk-default-image, tisdk-thinlinux-image, or tisdk-bootstrap-image?

    Best,
    Jared

  • Hi Jared,

    It appears that there are instructions for partitioning the eMMC here: 3.1.1.5.1. Partitioning eMMC from U-Boot

    Yes, but the steps only shows to create partition table and not assign the rootfs image. So, is it possible to flash the complete image i.e U-Boot, Kernel & FS from U-boot prompt? As per the below statement it doesn't seem possible.

    What is within the folder? Are any files that include the following: tisdk-base-image, tisdk-default-image, tisdk-thinlinux-image, or tisdk-bootstrap-image?

    Yes, files include tisdk-adas-image-j784s4-evm and tisdk-core-bundle-j784s4-evm but for flashing the image in SD-card we require WIC image and there is no WIC image for core-bundle instead it is only for adas-image; is it expected that WIC image will not be generated for core-bundle?

    After the compilation below files are seen in the folder apart from k3 and u-boot specific files : 

  • Hi Jared,

    It appears that there are instructions for partitioning the eMMC here: 3.1.1.5.1. Partitioning eMMC from U-Boot

    I referred the instructions mentioned in 3.1.1.5.1 for eMMC flashing and for creating partitions for rootfs I referred link - Flash Kernel, Device Tree and Root Filesystem to eMMC. Below were the detailed steps executed but unable to boot into eMMC : 

    a) Boot the EVM into SD-card mode.

    b) echo 0 > /sys/block/mmcblk0boot0/force_ro

    c) I executed below commands to flash U-boot as the seek position mentioned matches with mmc write address highlighted in 3.1.1.5.1
        --> dd if=tiboot3.bin of=/dev/mmcblk0boot0 seek=0
       
        --> dd if=tispl.bin of=/dev/mmcblk0boot0 seek=1024

        --> dd if=u-boot.img of=/dev/mmcblk0boot0 seek=5120

    d) --> fdisk /dev/mmcblk0

        --> mkfs.ext4 /dev/mmcblk0p1

        --> mkdir -p /mnt/temp

        --> mount -t ext4 /dev/mmcblk0p1 /mnt/temp

        --> cd /mnt/temp

        --> tar xf <Linux image file copied from the host> (Here I have used tisdk-core-bundle-j784s4-evm-20240906043442.tar.xz which I compiled for full SDK image, I copied this in /home/weston folder of SD-card)

       --> cd .. && umount temp

    e) Reboot the EVM (Still in SD-mode), I stopped at U-boot prompt and entered below commands :

    => mmc partconf 0 1 1 1
    => mmc bootbus 0 2 0 0
    f) Reboot the EVM and Change the Boot Pins to EMMC (SW11: 10000000 & SW7: 01000000) and stuck at U-boot prompt 
    and entered below commands :
    => mmc partconf 0 1 7 1
    => mmc bootbus 0 2 0 0
    => mmc rst-function 0 1
    => setenv mmcdev 0
    => setenv bootpart 0
    => boot

    Now board does not boot and get errors. Please find attached error logs (emmc_flashing_error_logs.txt) for reference.

  • Hi Arjav,

    Yes, but the steps only shows to create partition table and not assign the rootfs image. So, is it possible to flash the complete image i.e U-Boot, Kernel & FS from U-boot prompt? As per the below statement it doesn't seem possible.

    You are able to, you need to do this from the kernel instead of within u-boot. Have you taken a look at the instructions here: How to flash emmc device? Additionally, the instructions you were looking at were for the AM64.

    there is no WIC image for core-bundle instead it is only for adas-image; is it expected that WIC image will not be generated for core-bundle?

    The tisdk-core-bundle is not intended to be an image run on the target. When running the oe-layertool-setup.sh, you should get a message at the end that says: " tisdk-core-bundle: Installer package for TI SDK - NOT for direct use on target". What image are you trying to run on the target?

    Best,
    Jared

  • Hi Jared,

    You are able to, you need to do this from the kernel instead of within u-boot. Have you taken a look at the instructions here: How to flash emmc device? Additionally, the instructions you were looking at were for the AM64.

    Yes, I looked at the steps but there is no mksdboot.sh available in ti-processor-sdk-linux-adas-j784s4-evm-10_00_00_08 SDK version, I checked in ti-processor-sdk-linux-adas-j784s4-evm-09_02_00_05 SDK version as well. Can you please share the script?

    The tisdk-core-bundle is not intended to be an image run on the target. When running the oe-layertool-setup.sh, you should get a message at the end that says: " tisdk-core-bundle: Installer package for TI SDK - NOT for direct use on target". What image are you trying to run on the target?

    Now, I am able to to flash the images in eMMC and board boots using the steps mentioned above. I just replaced the tisdk-core-bundle image with adas image. But the board does not boot from eMMC with boot switch settings set as eMMC and power ON/OFF cycles are executed (No logs on UART are also observed). I have to again execute steps (e) and (f) to boot into eMMC. Are there any more U-boot configurations to be done to boot the EVM from eMMC?

    If core-bundle image is not to be used on target can you please share the information for its purpose as it mentioned as Full SDK image.

  • Hi Arjav,

    Can you please share the script?

    I think the script has been renamed to "create-sdcard.sh", but it really just repartitions an SD card and untars the relevant tarballs into their partitions.

    Are there any more U-boot configurations to be done to boot the EVM from eMMC?

    You'll need to save the environment variables within the uEnv.txt.

    If core-bundle image is not to be used on target can you please share the information for its purpose as it mentioned as Full SDK image.

    The recipe states: "This creates an installer including all the default images recommended including source, binaries, filesystems, etc. for TI SDK. This is meant to be used on the host system."

    Best,
    Jared

  • Hi Jared,

    You'll need to save the environment variables within the uEnv.txt.

    After booting into eMMC mode, I tried to create an uEnv.txt file with below contents and then hard reset the board keeping boot pin settings as eMMC but the board does not boot and do not see any prints on the console (I am forced to boot via SD-card and then set the U-boot environment variables again to boot into eMMC mode). My expectation is to boot the mode in eMMC without the support of SD-card;once the images are flashed into eMMC from SD-card.

    # Configuration for eMMC boot

    bootpart=0

    mmcdev=0

    mmc partconf 0 1 7 1

    mmc bootbus 0 2 0 0

    mmc rst-function 0 1

  • Hi Arjav,

    mmc partconf 0 1 7 1

    mmc bootbus 0 2 0 0

    mmc rst-function 0 1

    I assume that these lines are not being run. You'll probably have to add the commands to the bootcmd, or put them in their own variable that you call run on within the bootcmd.

    Best,
    Jared

  • Hi Jared,

    I enabled the support of saveenv in u-boot and flashed the tiboot3.bin, tispl.bin & u-boot.img files into eMMC and in eMMC mode at U-boot saved the below environment variables : 

    mmc partconf 0 1 7 1
    mmc bootbus 0 2 0 0
    mmc rst-function 0 1
    setenv mmcdev 0
    setenv bootpart 0

    But the board still does not boot in eMMC.

    I assume that these lines are not being run.

    The reason why these lines do not run is because by default the uEnv.txt file in mmcblk1p1 (SD-Card) comes into picture (Ref: board/ti/j784s4/j784s4.env). If I try to modify the uEnv.txt file in boot partition of SD-card for eMMC mode still the board does not boot.

    Thanks,

    Arjav Parikh

  • Hi Arjav,

    mmc partconf 0 1 7 1
    mmc bootbus 0 2 0 0
    mmc rst-function 0 1

    These are not environment variables (they are commands), so they will not be saved using saveenv.

    Best.
    Jared

  • Hi Jared,

    With below commands now able to save the environment variables and boot from eMMC : 

    => setenv mmc_setup 'mmc partconf 0 1 7 1; mmc bootbus 0 2 0 0; mmc rst-function 0 1'

    => saveenv

    => setenv mmcdev 0

    => saveenv

    => setenv bootpart 0

    => saveenv

    Thanks,

    Arjav Parikh