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.

PROCESSOR-SDK-AM65X: program Linux kernel and rootfs onto eMMC using DFU

Part Number: PROCESSOR-SDK-AM65X

We have a custom board using AM65x booting Linux from eMMC and are planning to move it into manufacturing where the PCB will leave the fabrication site already programmed.

As such, we have been looking for ways to streamline the eMMC programming process at the manufacturing site. We have been utilizing SD cards as a boot medium to program the eMMC, but due to certain complexities with logistics, we'd like to move away from SD cards.

I have been able to successfully program the uboot portion into the eMMC via DFU using the dfu_alt_info_emmc environment variable as provided in. I'm now looking to complete the Linux portion of the programming.

First I'd like to confirm that the partitioning as detailed in the link below is the correct procedure:

https://software-dl.ti.com/processor-sdk-linux/esd/AM65X/latest/exports/docs/linux/Foundational_Components_U-Boot.html#partitioning-emmc-from-u-boot

Then I would like to know the best way to create the rootfs image and then program it to the eMMC. Same for the Linux kernel & dtbs.

We are using Linux SDK7.01 running on SR2

Thanks,

Eric

  • Hi Eric,

    1) Yes that is correct. Partitioning steps are fine in the link.
    2) dtbs/kernel will all be part of rootfs so getting rootfs to eMMC should get all that you have asked for. I will come back with the steps in a bit.

    - Keerthy


  • Hi Eric,

    tinysdk image is preferred. So we already have: tisdk-tiny-image-am65xx-evm.tar.xz under $SDK_DIR/filesystem

    We can use that to create a filesystem image that can be burnt to eMMC

    Steps:

    # Below code needs to run on the HOST machine
     
    # Create an empty image file, seek value will create an image of that size. Typically 100MB should be enough.
    # Size will should be slightly greater than size of untarred tisdk-tiny-image-j7-evm.tar.xz + size (DTBs + Kernel image)
    dd if=/dev/null of=tisdk-tiny-image.img bs=1M seek=100
     
    # Add a filesystem to it
    mkfs.ext4 -F tisdk-tiny-image.img
     
    # Mount it on your local machine to copy DTB and Kernel image
    mkdir example_mnt_pt
    sudo mount -t ext4 -o loop tisdk-tiny-image.img /home/karan/yocto-build/example_mnt_pt
     
    # Untar tisdk-tiny-image-j7-evm.tar.xz on the mounted file system which is currently empty
    cd example_mnt_pt
    sudo tar xvf ../tisdk-tiny-image-j7-evm.tar.xz
     
    # Copy DTB, DTBOs and Kernel Image for your platform
    sudo cp /media/karan/rootfs/boot/Image* ./boot
    sudo cp /media/karan/rootfs/boot/*dtb* ./boot
    sync
     
    # Unmount the image, now the tisdk-tiny-image.img is ready
    cd ../
    sudo umount /home/$USER/yocto-build/example_mnt_pt
    Final step:

    # Flashing a tiny file system to eMMC User partition
    HOST $ sudo dfu-util -a rootfs -D <PATH_TO_CREATED_TINYFS>/tinyrootfs.img
    Best Regards,
    Keerthy
  • Hi Keerthy,

    This worked great. However, we have always use default filesystem, so we need to evaluate tinysdk filesystem for our needs. To speed up our eval process:

    What are the key differences between tinysdk filesystem vs the default filesystem?

    Is the .img for default rootfs too big for dfu to support?

    Thanks,

    Eric

  • Eric,

    Tiny will not have big user space applications & will bare minimal binaries.
    We have tried with tiny as it is small but I believe you could try with full fledged file system as well.

    Follow the same procedure with default and let us know.

    Best Regards,
    Keerthy