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.

TDA4AL-Q1: How to optimize the emmc startup time in SBL mode

Part Number: TDA4AL-Q1

Hi,

    We use SDK version 8.6, and the startup time for SD card and EMMC is as follows:

time for First log to boardinit

time for boardinit

time for can response

SD

208ms

320ms

528ms

EMMC

606ms

693ms

1299ms

We need a fast response time of less than 500ms for CAN, and currently the startup time using EMMC exceeds 500ms. As shown in the table, how to optimize the first and second column time。

time for First log to boardinit:

SBL Revision: 01.00.10.01----------------------->TIFS  ver: 8.6.3--v08.06.03------------------------------->need to optimized

time for boardinit:

TIFS ver: 8.6.3--v08.06.03 ------------------------->Board_init end-------------------------------------------->need to optimized

time for can response:

SBL Revision: 01.00.10.01-------------------------->end can main

SD log with SBL:

emmc log with SBL:

  • Hi,

    May I know if you are using emmc BOOT0 or UDA?

    Regards,

    Nikhil

  • Hi, Nikhil,

    thanks for your feedback,How to confirm Boot0 or UDA?

  • Hi,

    May I know what was the build script you used to generate the SBL binary?

    if you did make sbl_emmc_boot0_img  then you are using emmc boot0 option, else the UDA option.

    Regards,

    Nikhil

  • Hi, Nikhil,

    Thanks,we used make sbl_bootimage.

  • Hi,

    Are you using the same to generate binary for eMMC?

    Could you try building using following the below steps for eMMC Boot0?

    Build instructions
    -------------------
    
    Build the SBL to generate the binary using the below commands in ${PSDKRA}/pdk_j721s2_08_06_00_31/
    
    -> cd packages/ti/build/
    -> make sbl_lib_emmc_clean BOARD=j721s2_evm
    -> make sbl_emmc_boot0_img_clean BOARD=j721s2_evm
    -> make sbl_lib_emmc BOARD=j721s2_evm
    -> make sbl_emmc_boot0_img BOARD=j721s2_evm
    
    The generated binary "sbl_emmc_boot0_img_mcu1_0_release.tiimage" is located at ${PSDKRA}/pdk_j721s2_08_00_04_09/packages/ti/boot/sbl/binary/j721s2_evm/emmc_boot0/bin/ folder
    
    Flash instructions
    -------------------
    1. In order to flash the application, following 3 binaries are required
    
    	a. sbl_emmc_boot0_img_mcu1_0_release.tiimage ---> Generated from SBL (Please refer Build instructions)
    	b. tifs.bin                                  ---> In the filepath ${PSDKRA}/pdk_j721s2_08_06_00_31/packages/ti/drv/sciclient/soc/V4/
    	c. application image                         ---> Customer application image
    
    2. Copy the above 3 images into the BOOT partition of the SD card
    
    3. Insert the SD card into the evm. Boot the evm in SD bootmode.
    
    4. Halt in uboot and Enter the following commands to download the images from an SD card and write them to the eMMC boot0 partition at respective addresses.
    
    => mmc dev 0 1
    
    => mmc erase 0x0 0x2000
    
    => fatload mmc 1 ${loadaddr} sbl_emmc_boot0_img_mcu1_0_release.tiimage
    
    => mmc write ${loadaddr} 0x0 0x289
    
    => fatload mmc 1 ${loadaddr} tifs.bin
    
    => mmc write ${loadaddr} 0x400 0x13A
    
    => fatload mmc 1 ${loadaddr} your_application.appimage
    
    => mmc write ${loadaddr} 0x1400 0xXX
    
    => mmc partconf 0 1 1 1
    
    => mmc bootbus 0 2 0 0.
    
    
    5. Here 0xXX refers to the number of sectors which is derived from size of your application calculated as shown below
        
       Eg. Size of .appimage = 214956 bytes.
           eMMC sector size  = 512 bytes
           Number of sectors = (274428/512) + 1 = (0x42FFC/0x200) + 1
           0xXX = 0x218

    Regards,

    Nikhil

  • Hi ,

        We have tried your method, but it has no effect and the initialization time is still very long.

    And it gets stuck when it reaches the position displayed in the log. The Linux kernel also failed to start.

    [20:06:47:878] SBL Revision: 01.00.10.01 (Jul 25 2023 - 16:04:49)
    [20:06:48:501] TIFS  ver: 8.6.3--v08.06.03 (Chill Capybar
    [20:06:49:184] Starting Sciserver..... PASSED
    [20:06:49:184] 
    [20:06:49:184] MCU R5F App started at 0 usecs

    BRs

  • Hi,

    Could you please let me know the exact steps how you have build your application? 

    What is the size of your application?

    From, the log shared, MCU R5F App started at 0 usecs denotes that it has reached the MCU1_0 application. Have you loaded the linux kernel along with this?

    Could you also share the current profile timings with eMMC boot0?

    Regards,

    Nikhil

  • Hi, Nikhil,

    Build step:

    1. Rebuild: PDK
    cd rtos-sdk/pdk_j721s2/packages/ti/build
    make allclean BOARD=j721s2_evm SOC=j721s2
    make all BOARD=j721s2_evm SOC=j721s2

    2. Build: tiboot3.bin
    cd rtos-sdk/pdk_j721s2/packages/ti/build
    make BOARD=j721s2_evm CORE=mcu1_0 BUILD_PROFILE=release pdk_libs -sj

    SD:
    make BOARD=j721s2_evm CORE=mcu1_0 BUILD_PROFILE=release sbl_mmcsd_img -sj

    emmc:
    make sbl_lib_emmc BOARD=j721s2_evm
    make sbl_emmc_boot0_img BOARD=j721s2_evm

    3. Build: app
    cd rtos-sdk/pdk_j721s2/packages/ti/build
    make all BOARD=j721s2_evm SOC=j721s2

    4. Build: DTB
    cd linux-sdk
    make all
    cp ./board-support/linux/arch/arm64/boot/dts/ti/k3-j721s2-common-proc-board.dtb ./board-support/prebuilt-images/base-board.dtb
    cp ./board-support/linux/arch/arm64/boot/Image board-support/prebuilt-images/

    5. Transform Linux 的 ATF、dtb、kernel Image
    cd rtos-sdk/vision_apps
    make sdk -j32
    make sbl_bootimage -j32
    make -s bootapp_sd -j32
    cd rtos-sdk/mcusw/mcuss_demos/boot_app_mcu_rtos/main_domain_apps/scripts/hlos
    execute:
    ./constructappimageshlos.sh j721s2_evm

    6. Copy to SD card
    cd rtos-sdk/vision_apps/out/sbl_bootfiles
    cp app atf_optee.appimage lateapp1 lateapp2 tiboot3.bin tidtb_linux.appimage tifs.bin tikernelimage_linux.appimage /media/qipeng/BOOT/

    Size:3.4G

  • Hi,

    time for First log to boardinit

    time for boardinit

    time for can response

    SD

    208ms

    320ms

    528ms

    EMMC

    606ms

    693ms

    1299ms

    Similar to the above, do you have the profiled timestamp for eMMC boot0?
    Could you please confirm if the above mentioned profile timestamps are for eMMC UDA?

    Could you also let me know where have you put the log Board_init end? Is it after DDR initialization and before loading the app image by SBL?

    Regards,
    Nikhil

  • Hi,

        Above mentioned profile timestamps are for eMMC UDA.

        Board_ The position of init is placed in front of BootAPP_SetupSciServer in 

    tda4-s2/rtos-sdk/pdk_j721s2/packages/ti/boot/sbl/example/boot_app/boot_app_main.c

    Timestamps following:

    Brs

  • Hi,

       We try to boot sbl by boot0,but timestamps has not changed much.

    -> cd packages/ti/build/
    -> make sbl_lib_emmc_clean BOARD=j721s2_evm
    -> make sbl_emmc_boot0_img_clean BOARD=j721s2_evm
    -> make sbl_lib_emmc BOARD=j721s2_evm
    -> make sbl_emmc_boot0_img BOARD=j721s2_evm

  • Hi,Nikhil

    Looking forward to your reply, thank you.

  • Hi,Nikhil,

    Looking forward to your reply, thank you very much

  • HI Li 

    Sorry for the  delay in response i will try to profile the number at my end 

    i will get back to you before end of the week on this.

    Regards
    Diwakar

  • H Liu 

    Help share me the test instruction which you are following so that i can try at my end.

    Regards
    Diwakar