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.

SK-AM62P-LP: How to Flash Baremetal Code to eMMC on SK-AM62P-LP from Linux Terminal?

Part Number: SK-AM62P-LP

Tool/software:

Hi,

I’m working with the following setup:

  • PSDK Version: ti-processor-sdk-linux-am62pxx-evm-10.01.10.04

  • MCU+ SDK Version: mcu_plus_sdk_am62px_10_01_00_33

  • Board: SK-AM62Px-LP

Objective:

I am trying to perform FOTA (Firmware Over-The-Air) updates on the board.
My goal is to flash bare-metal firmware to the AM62x board using the Linux terminal, specifically to:

  1. OSPI – Already working

  2. eMMC – Not yet working

What I've Done:

  • For OSPI, I created a custom partition based on offset and successfully flashed the bare-metal image. It is working as expected.

  • File Location: ti-processor-sdk-linux-am62pxx-evm-10.01.10.04/board-support/ti-linux-kernel-6.6.58+git-ti/arch/arm64/boot/dts/ti/k3-am62p5-sk.dts
  • partition@0 {
    			    label = "ospi.tiboot3";
    			    reg = <0x0 0x80000>;
    			};
    
    			partition@80000 {
    			    label = "ospi.tispl";
    			    reg = <0x80000 0x200000>;
    			};
    
    			partition@280000 {
    			    label = "ospi.u-boot";
    			    reg = <0x280000 0x200000>;
    			};
    
    			partition@240000 {
    			    label = "ospi.hsm";
    			    reg = <0x240000 0x200000>;  
    			};
    
    			partition@800000 {
    			    label = "ospi.mcu-baremetal";
    			    reg = <0x800000 0x800000>;
    			};
    
    			partition@1200000 {
    			    label = "ospi.linux";
    			    reg = <0x1200000 0x1000000>;
    			    bootph-all;
    			};

Issue:

  • I want to do the same for eMMC, but I couldn't find the flash memory layout or method to create a bare-metal partition in eMMC.

  • How can I create a partition for bare metal in eMMC and flash the image from the Linux terminal?

Is there any guide or documentation available for flashing bare metal to eMMC?


Regards,
Veerapandiyan V.

  • Hello,

    There is no partition layout for the eMMC raw boot partitions. You may use the `dd` command to flash the images to these raw boot partitions like shown below

    # 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

  • Hi Prashant,

    I understood the above explanation, but I would like to know how to flash bare metal to eMMC from Linux terminal.

    Regards,

    Veerapandiyan

  • but I would like to know how to flash bare metal to eMMC from Linux terminal.

    Use the `dd` command to flash any image to an offset of the eMMC raw boot partitions.

  • Hi Prashant,

    Please see the command and image below.

    root@am62pxx-evm:~# echo 0 > /sys/block/mmcblk0boot0/force_ro
    root@am62pxx-evm:~# dd if=sbl_emmc_linux_stage1.release.hs_fs.tiimage of=/dev/mmcblk0boot0 bs=1K seek=0 conv=fsync
    264+1 records in
    264+1 records out
    270936 bytes (271 kB, 265 KiB) copied, 0.0273468 s, 9.9 MB/s
    root@am62pxx-evm:~# dd if=sbl_emmc_linux_stage2_am62px-sk_wkup-r5fss0-0_freertos_ti-arm-clang.appimage.hs_fs of=/dev/mmcblk0boot0 =1K seek=512 conv=fsync
    293+1 records in
    293+1 records out
    300783 bytes (301 kB, 294 KiB) copied, 0.0308154 s, 9.8 MB/s
    root@am62pxx-evm:~# dd if=hsm.appimage.hs_fs of=/dev/mmcblk0boot0 bs=1K seek=2304 conv=fsync
    9+1 records in
    9+1 records out
    9646 bytes (9.6 kB, 9.4 KiB) copied, 0.0133705 s, 721 kB/s
    root@am62pxx-evm:~# dd if=u-boot.img of=/dev/mmcblk0boot0 bs=1K seek=2560 conv=fsync
    2083+1 records in
    2083+1 records out
    2133823 bytes (2.1 MB, 2.0 MiB) copied, 0.137675 s, 15.5 MB/s
    root@am62pxx-evm:~# dd if=gpio_led_blink_am62px-sk_mcu-r5fss0-0_nortos_ti-arm-clang.appimage.hs_fs of=/dev/mmcblk0boot0 bs=1K seek192 conv=fsync
    42+1 records in
    42+1 records out
    43015 bytes (43 kB, 42 KiB) copied, 0.0166697 s, 2.6 MB/s
    root@am62pxx-evm:~# dd if=linux.appimage.hs_fs of=/dev/mmcblk0boot0 bs=1K seek=18432 conv=fsync
    853+1 records in
    853+1 records out
    874175 bytes (874 kB, 854 KiB) copied, 0.0624894 s, 14.0 MB/s
    root@am62pxx-evm:~# echo 1 > /sys/block/mmcblk0boot0/force_ro
    root@am62pxx-evm:~# 
    
    

    Now baremetal is flashing to eMMC, but Linux is not booting. Please check this.

    Regards,

    Veerapandiyan

  • Please share the output of the following commands from the A53 U-Boot:

    => mmc dev 0
    => mmc part

  • Hi Prashant,

    The problem was that the eMMC partition was accidentally removed from my side. I have created the partitions now, and it is working fine. 

    Now both OSPI and eMMC are working fine.

    Thank you for your help.

    Regards,
    Veerapandiyan V