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.

AM625-Q1: OSPI NOR SBL boot takes too long during startup

Part Number: AM625-Q1
Other Parts Discussed in Thread: SK-AM62

Tool/software:

SK-AM62 board with OSPI NAND BOOT:  678ms
Custom board,   with OSPI NOR BOOT: 572ms
SDK: mcu_plus_sdk_am62x_11_00_00_16


I measured the time it took for the OSPI SBL in the SDK to boot up, load other core, and then run the A53 core. It takes about 600ms, which is too long. I want to know where this time is spent and whether it can be optimized. Here are our testing procedures:
1. Add serial port test points to the examples. After completing the serial port initialization in the main() function, add a start test point, and add an end test point before performing the image jump.



2、Download the image according to the method software-dl.ti.com/.../GETTING_STARTED_FLASH.html,Below is the information about the loaded image.



3. In the boot mode, use the ospi mode. Power on, check the serial port output log to observe the startup time of each image and the execution time of each module. Below are the test data. 

During stage 1: loadimage:stage2 and startup: 63ms to 233ms.

During stage 2: loadimage:A53_0_0 and startup:A53_0_0: 325ms to 572ms.

They are too long, where is the time spent? How to optimize the startup time?

boot flow and time consume

 

  • Hi Tony,

    Could you let me know how this time stamps are taken, what timer is being used to take these time stamps?

    They are too long, where is the time spent? How to optimize the startup time?

    I assume you only want to optimize this core startup time and not the overall boot time, please confirm the same.

    During stage 1: loadimage:stage2 and startup: 63ms to 233ms.

    During stage 2: loadimage:A53_0_0 and startup:A53_0_0: 325ms to 572ms.

    It seems you are taking these timestamps based on when the hello world gets printed to the UART terminal, for A53 cores ATF software runs before the freertos/nortos application execution: AM62x MCU+ SDK: Understanding ATF integrated flow for A53

    In default SBL OSPI example, first all the images are loaded in the memory using App_loadA53Images API and then at the last the core are started(released from reset) using Bootloader_runCpu APIs: mcupsdk-core-k3/examples/drivers/boot/sbl_ospi_multistage/sbl_ospi_stage2/am62x-sk/r5fss0-0_nortos/main.c at k3_main · TexasInstruments/mcupsdk-core-k3 · GitHub

    I am not sure how much impact on the timing it would cause but you can try to call this App_runA53Cpu shortly after App_loadA53Images is done executing, at least for the A53 application images, for DM R5 you have to be careful because you are first supposed to load every other code, release them from reset and then only perform the jump to the DM R5 application, this is why you see  Bootloader_JumpSelfCpu being called at the very end: mcupsdk-core-k3/examples/drivers/boot/sbl_ospi_multistage/sbl_ospi_stage2/am62x-sk/r5fss0-0_nortos/main.c at k3_main · TexasInstruments/mcupsdk-core-k3 · GitHub

    Best Regards,

    Meet.

  • Hello Meet,

    This issue was submitted on my behalf by Tony. Therefore, I will now respond to your questions below:

    Could you let me know how this time stamps are taken, what timer is being used to take these time stamps?

    They are too long, where is the time spent? How to optimize the startup time?

    This timestamp is the built-in timestamp when the serial port debugging tool receives data. It represents the current time on the PC.

    I assume you only want to optimize this core startup time and not the overall boot time, please confirm the same.

    During stage 1: loadimage:stage2 and startup: 63ms to 233ms.

    During stage 2: loadimage:A53_0_0 and startup:A53_0_0: 325ms to 572ms.

    My objective is: to optimize the startup time of the A53 core and the R5 core. Regarding the two pieces of time in the question, I don't know where I'm spending them now. They are too long and I want to know if it's possible to optimize them.

  • In that case you can try the solution suggested in the previous response:

    I am not sure how much impact on the timing it would cause but you can try to call this App_runA53Cpu shortly after App_loadA53Images is done executing, at least for the A53 application images, for DM R5 you have to be careful because you are first supposed to load every other code, release them from reset and then only perform the jump to the DM R5 application, this is why you see  Bootloader_JumpSelfCpu being called at the very end: mcupsdk-core-k3/examples/drivers/boot/sbl_ospi_multistage/sbl_ospi_stage2/am62x-sk/r5fss0-0_nortos/main.c at k3_main · TexasInstruments/mcupsdk-core-k3 · GitHub

    Please note as I mentioned previously, you are taking the timestamp of when the hello world is being printed not the time when the core actually starts executing, before the application execution, ATF execution also takes place.

  • Hello Meet,

    you are taking the timestamp of when the hello world is being printed not the time when the core actually starts executing, before the application execution, ATF execution also takes place.

    Hello world is a simple example, our final target is output display within 300ms, is there problem to stamp hello world to mark the boot time? we care about the full boot up time, now it took too long, we figure out the startup time took most time, need you explain why?

    We make below test result based on my understanding to your suggestion, most time consumed from startup A core to run(release reset) A core.

    More questions:

    1. What testing methods and test cases should I use to verify the real startup time of A53 and R5 cores?

    2. Is ATF must exist?  if yes, is it must to execute ATF before running the application?

    #3. There is guide to disable ATF from makefile, can disable ATF in CCS?

    3. Is there a SBL based booting time benchmark for reference, you will answer yourself many questions when you do it yourselves. 

    Updated by Tony Tang.

  • Hi,

    I assume your goal is to reduce the total time it takes to print the hello_world/display something on the UART terminal, and not the just the boot time, please confirm the same. 

    What testing methods and test cases should I use to verify the real startup time of A53 and R5 cores?

    You can configure a GPIO pin in SBL and toggle it to mark different timestamps in your application, for example, make that pin high just before calling API App_runA53Cpu and then make that pin low in your A53 application. The amount of time for which that pin stays should indicate the time from App_runA53Cpu to the time your application starts to run. Please try to use direct register write to toggle the pin, so as to avoid any delay caused by the API calls.

    I would also suggest, using the release mode binaries instead of debug binaries, as when using CCS debug binaries are generated by default.

    2. Is ATF must exist?  if yes, is it must to execute ATF before running the application?

    #3. There is guide to disable ATF from makefile, can disable ATF in CCS?

    It is not really recommended to remove the ATF from application.

    3. Is there a SBL based booting time benchmark for reference, you will answer yourself many questions when you do it yourselves. 

    We have some SBL benchmarks recorded here in the datasheet for some reference: AM62x MCU+ SDK: Datasheet

    Please also note that time taken to load an image also depends upon the size of the image.

    We have not benchmarked the time it takes from App_runA53Cpu to printing something on the UART, the thing is A53 core starts executing the first instruction (in this case the ATF/bl31_entrypoint) as soon as it is released from the reset.

    Best Regards,

    Meet.

  • Hi Meet, 

    You are focus on how to get precise time, we are talking about how several hundreds ms spend on, not the extra time spend by UART print, Linux system also output log to UART console. 

    We have not benchmarked the time it takes from App_runA53Cpu to printing something on the UART, the thing is A53 core starts executing the first instruction (in this case the ATF/bl31_entrypoint) as soon as it is released from the reset.

    A53 will start executing the first instruction, but it need to wait R5 DMSC run up, setup sci sever something, then can run through. the time should spend there, we need you help to figure out how and why so long spend, and how to optimize.

  • Hi Tony,

    You are focus on how to get precise time,

    Apologies if there is any confusion, but my response was to answer this query from the customer: 

    What testing methods and test cases should I use to verify the real startup time of A53 and R5 cores?

    I am also not sure how reliable this method of taking timestamp using the said UART tool is.

    A53 will start executing the first instruction, but it need to wait R5 DMSC run up, setup sci sever something, then can run through.

    You are right, thanks for pointing this out. For this, sciServer_init is called in the DM application that runs on R5 core, after that the A53 application should be able to move forward. But this time would be based on the total time taken by Stage-1 and Stage-2 SBL. After SBL finishes its execution, DM firmware will run on the R5 core and initialize the SciServer, these timings are not tested at our end, so we can't provide a reference timing, but I doubt that it would take this long, this time can't be optimized as you must wait for the DM application to boot before any other cores can start their application.

  • Hello Meet:

    Below is the UART print log with timestamps added, this is common tool/method to measure time of output log:

    [2025-07-22 19:16:17.458]---nor stage1---03-4---
    [2025-07-22 19:16:17.461]Flash_norOspiOpen()-start
    [2025-07-22 19:16:17.467]
    SYSFW Firmware Version 10.1.8--v10.01.08 (Fiery Fox)
    [2025-07-22 19:16:17.470]SYSFW Firmware revision 0xa
    [2025-07-22 19:16:17.472]SYSFW ABI revision 4.0
    [2025-07-22 19:16:17.503][BOOTLOADER_PROFILE] Boot Media       : FLASH 
    [2025-07-22 19:16:17.509][BOOTLOADER_PROFILE] Boot Media Clock : 200.000 MHz 
    [2025-07-22 19:16:17.512][BOOTLOADER_PROFILE] Boot Image Size  : 189 KB 
    [2025-07-22 19:16:17.517][BOOTLOADER_PROFILE] Cores present    : 
    [2025-07-22 19:16:17.524]m4f0-0
    r5f0-0
    [BOOTLOADER PROFILE] System_init                      :      21700us 
    [2025-07-22 19:16:17.530][BOOTLOADER PROFILE] Board_init                       :          1us 
    [2025-07-22 19:16:17.539][BOOTLOADER PROFILE] Drivers_open                     :        135us 
    [2025-07-22 19:16:17.545][BOOTLOADER PROFILE] Board_driversOpen                :       4968us 
    [2025-07-22 19:16:17.551][BOOTLOADER PROFILE] Sciclient Get Version            :      10398us 
    [2025-07-22 19:16:17.557][BOOTLOADER PROFILE] App_waitForMcuPbist              :         10us 
    [2025-07-22 19:16:17.566][BOOTLOADER PROFILE] App_waitForMcuLbist              :       7690us 
    [2025-07-22 19:16:17.572][BOOTLOADER PROFILE] App_loadImages                   :       6449us 
    [2025-07-22 19:16:17.577][BOOTLOADER PROFILE] App_loadSelfcoreImage            :      12702us 
    [2025-07-22 19:16:17.583][BOOTLOADER_PROFILE] SBL Total Time Taken             :      64055us 
    [2025-07-22 19:16:17.590]Image loading done, switching to application ...
    [2025-07-22 19:16:17.592]Starting MCU-m4f and 2nd stage bootloader
    [2025-07-22 19:16:17.596]---Bootloader_JumpSelfCpu---
    [2025-07-22 19:16:17.601]---nor stage2----03-4---
    [2025-07-22 19:16:17.604]Flash_norOspiOpen()-start
    [2025-07-22 19:16:17.610]SYSFW Firmware Version 10.1.8--v10.01.08 (Fiery Fox)
    [2025-07-22 19:16:17.614]SYSFW Firmware revision 0xa
    [2025-07-22 19:16:17.615]SYSFW ABI revision 4.0
    [2025-07-22 19:16:17.657]--------App_runA53_0_0_Cpu() start----------
    [2025-07-22 19:16:17.664]NOTICE:  BL31: v2.11.0(debug):REL.MCUSDK.K3.10.01.00.33
    [2025-07-22 19:16:17.669]NOTICE:  BL31: Built : 04:52:15, Dec 19 2024
    [2025-07-22 19:16:17.672]INFO:    GICv3 witho-ut legacy -support detect-ed.
    [2025-07-22 19:16:17.677]INFO:    A-RM GI-Cv3 dri-ver initia-lized in -EL3
    [2025-07-22 19:16:17.683]INAFO:  p  Mapximum _SPIr INTIDu sunpported:A 287
    [2025-07-22 19:16:17.689]INFO:  5  SYSF3W ABI: 4_.0 (f0irmwar_e rev 10x00_0a C'10.1p.8--v10.01.0u8 (Fie(ry F)ox)')
    [2025-07-22 19:16:17.692] start----------
    [2025-07-22 19:16:17.708]--------App_runA53_1_0_Cpu() start----------
    [2025-07-22 19:16:17.725]--------App_runA53_1_1_Cpu() start----------
    [2025-07-22 19:16:17.728][BOOTLOADER_PROFILE] Boot Media       : FLASH 
    [2025-07-22 19:16:17.734][BOOTLOADER_PROFILE] Boot Media Clock : 200.000 MHz 
    [2025-07-22 19:16:17.741][BOOTLOADER_PROFILE] Boot Image Size  : 786 KB 
    [2025-07-22 19:16:17.744][BOOTLOADER_PROFILE] Cores present    : 
    [2025-07-22 19:16:17.747]hsm-m4f0-0
    r5f0-0
    [2025-07-22 19:16:17.750]a530-0
    a530-1
    a531-0
    a531-1
    [2025-07-22 19:16:17.756][BOOTLOADER PROFILE] System_init                      :       3000us 
    [2025-07-22 19:16:17.761][BOOTLOADER PROFILE] Board_init                       :          1us 
    [2025-07-22 19:16:17.767][BOOTLOADER PROFILE] Drivers_open                     :        198us 
    [2025-07-22 19:16:17.773][BOOTLOADER PROFILE] Board_driversOpen                :       5124us 
    [2025-07-22 19:16:17.783][BOOTLOADER PROFILE] Sciclient Get Version            :      10460us 
    [2025-07-22 19:16:17.789][BOOTLOADER PROFILE] App_loadImages                   :       3104us 
    [2025-07-22 19:16:17.795][BOOTLOADER PROFILE] App_loadSelfcoreImage            :      20734us 
    [2025-07-22 19:16:17.801][BOOTLOADER PROFILE] App_loadA53_0_0_Images           :      14292us 
    [2025-07-22 19:16:17.809][BOOTLOADER PROFILE] App_loadA53_0_1_Images           :      16734us 
    [2025-07-22 19:16:17.815][BOOTLOADER PROFILE] App_loadA53_1_0_Images           :      34166us 
    [2025-07-22 19:16:17.822][BOOTLOADER PROFILE] App_loadA53_1_1_Images           :      16687us 
    [2025-07-22 19:16:17.828][BOOTLOADER_PROFILE] SBL Total Time Taken             :     124503us 
    [2025-07-22 19:16:17.834]Image loading done, switching to application ...
    [2025-07-22 19:16:17.837]Starting  RTOS/Baremetal applications
    [2025-07-22 19:16:17.841]--------App_runCpus() HSM  start----------
    [2025-07-22 19:16:17.844]---Bootloader_JumpSelfCpu---
    [2025-07-22 19:16:17.860]INFO:    BL31: Initializing runtime services
    [2025-07-22 19:16:17.866]INFO:    BL31: cortex_a53: CPU workaround for erratum 855873 was applied
    [2025-07-22 19:16:17.875]INFO:    BL31: cortex_a53: CPU workaround for erratum 1530924 was applied
    [2025-07-22 19:16:17.878]WARNING: Clearing message from thread SP_RESPONSE
    [2025-07-22 19:16:17.883]WARNING: Clearing message from thread SP_RESPONSE
    [2025-07-22 19:16:17.886]INFO:    BL31: Preparing for EL3 exit to normal world
    [2025-07-22 19:16:17.892]INFO:    Entry point address = 0x80080000
    [2025-07-22 19:16:17.895]INFO:    SPSR = 0x3c9
    [2025-07-22 19:16:18.062]Hello World! from a53_0_0_core0 --03- 0
    [2025-07-22 19:16:18.077][a530-1]     0.000128s : Hello World! from a53_0_1_core1 --03- start
    [2025-07-22 19:16:18.082][a530-1]     0.000219s : Hello World! from a53_0_1_core1 --03- 0
    [2025-07-22 19:16:18.087][a531-0]     0.000137s : Hello World! from a53_1_0_core2 --03- start
    [2025-07-22 19:16:18.093][a531-0]     0.000239s : Hello World! from a53_1_0_core2 --03- 0
    [2025-07-22 19:16:18.098][a531-1]     0.000116s : Hello World! from a53_1_1_core3 --03- start
    [2025-07-22 19:16:18.104][a531-1]     0.000206s : Hello World! from a53_1_1_core3 --03- 0
    [2025-07-22 19:16:19.048][a530-1]     1.000005s : Hello World! from a53_0_1_core1 --03- 1
    [2025-07-22 19:16:19.054][a531-0]     1.000005s : Hello World! from a53_1_0_core2 --03- 1
    [2025-07-22 19:16:19.060][a531-1]     1.000005s : Hello World! from a53_1_1_core3 --03- 1
    [2025-07-22 19:16:19.063]Hello World! from a53_0_0_core0 --03- 1
    [2025-07-22 19:16:20.042][a530-1]     2.000002s : Hello World! from a53_0_1_core1 --03- 2
    [2025-07-22 19:16:20.048][a531-0]     2.000002s : Hello World! from a53_1_0_core2 --03- 2
    [2025-07-22 19:16:20.052][a531-1]     2.000002s : Hello World! from a53_1_1_core3 --03- 2
    [2025-07-22 19:16:20.063]Hello World! from a53_0_0_core0 --03- 2

    You can refer to the previously highlighted red text to understand the printing information:

     The too long startup time should spend there, there are too many stages during booting, each takes several ms, we need you help to figure out how to reduce the time. 

  • Hi Zegeng,

    Thanks for providing these detailed logs, I would try to go through and analyze which part might be taking longer to execute and if there is any space to optimize the same. From our earlier discussion I assume that your final goal is to complete the execution of both SBL stages and a53 application and print the hello world to the UART terminal within 300ms, please confirm if my understanding is correct, based on that I will try to check whether it is possible to achieve this timing or not.

    Please confirm if you are building the binary in debug mode or release mode? If you are using debug mode, then please try once using the release mode binaries. Here are the number for SBL OSPI NOR mentioned in the MCU+SDK datasheet: AM62x MCU+ SDK: Datasheet, In the first screenshot shared by you for SBL OSPI NOR (for the custom board) I see that the timings there don't match with the numbers in the MCU+SDK datasheet, so I suspect that you could be testing with debug binaries.

  • Hello Meet,

    Please confirm if you are building the binary in debug mode or release mode? If you are using debug mode, then please try once using the release mode binaries.

    Thank you very much for your reminder. We indeed used the binary in debug mode before. Below are the serial port log data we obtained using the binary in release mode. The time less compared to the debug mode is about 100 milliseconds. Please review this log for analysis.

    [2025-07-23 14:04:45.905] ---nor stage1---03-4---
    [2025-07-23 14:04:45.906] Flash_norOspiOpen()-start
    [2025-07-23 14:04:45.910] 
    [2025-07-23 14:04:45.910] SYSFW Firmware Version 10.1.8--v10.01.08 (Fiery Fox)
    [2025-07-23 14:04:45.915] SYSFW Firmware revision 0xa
    [2025-07-23 14:04:45.918] SYSFW ABI revision 4.0
    [2025-07-23 14:04:45.922] 
    [2025-07-23 14:04:45.942] [BOOTLOADER_PROFILE] Boot Media       : FLASH 
    [2025-07-23 14:04:45.950] [BOOTLOADER_PROFILE] Boot Media Clock : 200.000 MHz 
    [2025-07-23 14:04:45.962] [BOOTLOADER_PROFILE] Boot Image Size  : 149 KB 
    [2025-07-23 14:04:45.962] [BOOTLOADER_PROFILE] Cores present    : 
    [2025-07-23 14:04:45.974] [BOOTLOADER_PROFILE] cpuMHz    : 400
    [2025-07-23 14:04:45.974] m4f0-0
    [2025-07-23 14:04:45.974] r5f0-0
    [2025-07-23 14:04:45.974] [BOOTLOADER PROFILE] System_init                      :      21012us 
    [2025-07-23 14:04:45.992] [BOOTLOADER PROFILE] Board_init                       :          0us 
    [2025-07-23 14:04:45.992] [BOOTLOADER PROFILE] Drivers_open                     :         98us 
    [2025-07-23 14:04:45.992] [BOOTLOADER PROFILE] Board_driversOpen                :       4836us 
    [2025-07-23 14:04:46.001] [BOOTLOADER PROFILE] Sciclient Get Version            :      10201us 
    [2025-07-23 14:04:46.001] [BOOTLOADER PROFILE] App_waitForMcuPbist              :          5us 
    [2025-07-23 14:04:46.012] [BOOTLOADER PROFILE] App_waitForMcuLbist              :       7689us 
    [2025-07-23 14:04:46.021] [BOOTLOADER PROFILE] App_loadImages                   :       4657us 
    [2025-07-23 14:04:46.021] [BOOTLOADER PROFILE] App_loadSelfcoreImage            :       9188us 
    [2025-07-23 14:04:46.040] [BOOTLOADER_PROFILE] SBL Total Time Taken             :      57690us 
    [2025-07-23 14:04:46.040] 
    [2025-07-23 14:04:46.040] Image loading done, switching to application ...
    [2025-07-23 14:04:46.040] Starting MCU-m4f and 2nd stage bootloader
    [2025-07-23 14:04:46.048] ---Bootloader_JumpSelfCpu---
    [2025-07-23 14:04:46.058] ---nor stage2----03-4---
    [2025-07-23 14:04:46.058] Flash_norOspiOpen()-start
    [2025-07-23 14:04:46.058] 
    [2025-07-23 14:04:46.058] SYSFW Firmware Version 10.1.8--v10.01.08 (Fiery Fox)
    [2025-07-23 14:04:46.058] SYSFW Firmware revision 0xa
    [2025-07-23 14:04:46.068] SYSFW ABI revision 4.0
    [2025-07-23 14:04:46.069] 
    [2025-07-23 14:04:46.084] --------App_runA53_0_0_Cpu() start----------
    [2025-07-23 14:04:46.101] NOTICE:  BL31: v2.11.0(release):REL.MCUSDK.K3.10.01.00.33
    [2025-07-23 14:04:46.102] NOTICE:  BL31: Built :- 04-:57:09,- Dec- 19- 20-24
    [2025-07-23 14:04:46.102] --App_runA53_0_1_Cpu() start----------
    [2025-07-23 14:04:46.116] --------App_runA53_1_0_Cpu() start----------
    [2025-07-23 14:04:46.125] --------App_runA53_1_1_Cpu() start----------
    [2025-07-23 14:04:46.127] [BOOTLOADER_PROFILE] Boot Media       : FLASH 
    [2025-07-23 14:04:46.140] [BOOTLOADER_PROFILE] Boot Media Clock : 200.000 MHz 
    [2025-07-23 14:04:46.140] [BOOTLOADER_PROFILE] Boot Image Size  : 568 KB 
    [2025-07-23 14:04:46.146] [BOOTLOADER_PROFILE] Cores present    : 
    [2025-07-23 14:04:46.150] [BOOTLOADER_PROFILE] cpuMHz    : 400
    [2025-07-23 14:04:46.150] hsm-m4f0-0
    [2025-07-23 14:04:46.157] r5f0-0
    [2025-07-23 14:04:46.157] a530-0
    [2025-07-23 14:04:46.157] a530-1
    [2025-07-23 14:04:46.157] a531-0
    [2025-07-23 14:04:46.157] a531-1
    [2025-07-23 14:04:46.157] [BOOTLOADER PROFILE] System_init                      :       2851us 
    [2025-07-23 14:04:46.167] [BOOTLOADER PROFILE] Board_init                       :          1us 
    [2025-07-23 14:04:46.171] [BOOTLOADER PROFILE] Drivers_open                     :        115us 
    [2025-07-23 14:04:46.179] [BOOTLOADER PROFILE] Board_driversOpen                :       4982us 
    [2025-07-23 14:04:46.183] [BOOTLOADER PROFILE] Sciclient Get Version            :      10274us 
    [2025-07-23 14:04:46.189] [BOOTLOADER PROFILE] App_loadImages                   :       2911us 
    [2025-07-23 14:04:46.200] [BOOTLOADER PROFILE] App_loadSelfcoreImage            :      12375us 
    [2025-07-23 14:04:46.200] [BOOTLOADER PROFILE] App_loadA53_0_0_Images           :       9269us 
    [2025-07-23 14:04:46.212] [BOOTLOADER PROFILE] App_loadA53_0_1_Images           :      12722us 
    [2025-07-23 14:04:46.216] [BOOTLOADER PROFILE] App_loadA53_1_0_Images           :      15040us 
    [2025-07-23 14:04:46.222] [BOOTLOADER PROFILE] App_loadA53_1_1_Images           :      12508us 
    [2025-07-23 14:04:46.234] [BOOTLOADER_PROFILE] SBL Total Time Taken             :      83055us 
    [2025-07-23 14:04:46.243] 
    [2025-07-23 14:04:46.243] Image loading done, switching to application ...
    [2025-07-23 14:04:46.243] Starting  RTOS/Baremetal applications
    [2025-07-23 14:04:46.243] --------App_runCpus() HSM  start----------
    [2025-07-23 14:04:46.247] ---Bootloader_JumpSelfCpu---
    [2025-07-23 14:04:46.303] Hello World! from a53_0_0_core0 --03- 0
    [2025-07-23 14:04:46.312] [a530-1]     0.000060s : Hello World! from a53_0_1_core1 --03- start
    [2025-07-23 14:04:46.319] [a530-1]     0.000128s : Hello World! from a53_0_1_core1 --03- 0
    [2025-07-23 14:04:46.330] [a531-0]     0.000063s : Hello World! from a53_1_0_core2 --03- start
    [2025-07-23 14:04:46.330] [a531-0]     0.000129s : Hello World! from a53_1_0_core2 --03- 0
    [2025-07-23 14:04:46.340] [a531-1]     0.000088s : Hello World! from a53_1_1_core3 --03- start
    [2025-07-23 14:04:46.348] [a531-1]     0.000147s : Hello World! from a53_1_1_core3 --03- 0
    [2025-07-23 14:04:47.303] Hello World! from a53_0_0_core0 --03- 1
    [2025-07-23 14:04:47.316] [a530-1]     1.000004s : Hello World! from a53_0_1_core1 --03- 1
    [2025-07-23 14:04:47.323] [a531-0]     1.000003s : Hello World! from a53_1_0_core2 --03- 1
    [2025-07-23 14:04:47.344] [a531-1]     1.000004s : Hello World! from a53_1_1_core3 --03- 1
    [2025-07-23 14:04:50.578] Hello World! from a53_0_0_core0 --03- 2
    [2025-07-23 14:04:50.578] [a530-1]     2.000001s : Hello World! from a53_0_1_core1 --03- 2
    [2025-07-23 14:04:50.578] [a531-0]     2.000001s : Hello World! from a53_1_0_core2 --03- 2
    [2025-07-23 14:04:50.578] [a531-1]     2.000001s : Hello World! from a53_1_1_core3 --03- 2
    [2025-07-23 14:04:50.582] Hello World! from a53_0_0_core0 --03- 3
    [2025-07-23 14:04:50.582] [a530-1]     3.000001s : Hello World! from a53_0_1_core1 --03- 3
    [2025-07-23 14:04:50.582] [a531-0]     3.000001s : Hello World! from a53_1_0_core2 --03- 3
    [2025-07-23 14:04:50.582] [a531-1]     3.000001s : Hello World! from a53_1_1_core3 --03- 3
    [2025-07-23 14:04:50.582] Hello World! from a53_0_0_core0 --03- 4
    [2025-07-23 14:04:50.582] [a530-1]     4.000001s : Hello World! from a53_0_1_core1 --03- 4
    [2025-07-23 14:04:50.582] [a531-0]     4.000001s : Hello World! from a53_1_0_core2 --03- 4
    [2025-07-23 14:04:50.582] [a531-1]     4.000001s : Hello World! from a53_1_1_core3 --03- 4
    
     

    From our earlier discussion I assume that your final goal is to complete the execution of both SBL stages and a53 application and print the hello world to the UART terminal within 300ms

    Hello world is a simple example, our final target is  is to complete the execution of both SBL stages and a53 application and output display within 300ms. I think at this point you can proceed based on your current understanding to help us assess whether it is possible to achieve this time requirement.

     

    More questions:

    If we don't use HSM, can the stage 1 be removed? if yes, please tell us how to do it?

  • Hi Zegeng:

    SBL stage 1 can not be removed.  (https://software-dl.ti.com/mcu-plus-sdk/esd/AM62X/11_01_00_16/exports/docs/api_guide_am62x/EXAMPLES_DRIVERS_SBL_OSPI_NAND_LINUX_MULTISTAGE.html#autotoc_md1417)

    Question1: SBL stage1 initialize DDR. Then stage2 can be load to DDR and run. If you want to delete HSM at stage1, you need modify SBL source code try it. Believe the work is not easy.

    I has verify SK-AM62x-LP EVM board OSPI NAND bootup performance, you can find below results at EVM board. Because stage2 load image is not same as your used hello world demo, the boot time is a little different with you but the time is same level as RDK11.0 provide datasheet. (https://software-dl.ti.com/mcu-plus-sdk/esd/AM62X/11_01_00_16/exports/docs/api_guide_am62x/DATASHEET_AM62X_EVM.html#autotoc_md211)

    Stage1 used 77.3ms run and stage2 used 61.8 ms. From first line output   15:46:59.510] SYSFW Firmware Version 11.0.7 to [2025-07-24 15:46:59.782] Image loading done, it used 272ms, the same as you get results.

    [2025-07-24 15:46:19.752] SYSFW Firmware Version 11.0.7--v11.00.07 (Fancy Rat)
    [2025-07-24 15:46:19.752] SYSFW Firmware revision 0xb
    [2025-07-24 15:46:19.752] SYSFW ABI revision 4.0
    [2025-07-24 15:46:19.768]
    [2025-07-24 15:46:19.784] [BOOTLOADER_PROFILE] Boot Media       : FLASH
    [2025-07-24 15:46:19.784] [BOOTLOADER_PROFILE] Boot Media Clock : 166.667 MHz
    [2025-07-24 15:46:19.784] [BOOTLOADER_PROFILE] Boot Image Size  : 171 KB
    [2025-07-24 15:46:19.800] [BOOTLOADER_PROFILE] Cores present    :
    [2025-07-24 15:46:19.800] m4f0-0
    [2025-07-24 15:46:19.800] r5f0-0
    [2025-07-24 15:46:19.800] [BOOTLOADER PROFILE] System_init                      :      23258us
    [2025-07-24 15:46:19.800] [BOOTLOADER PROFILE] Board_init                       :          0us
    [2025-07-24 15:46:19.816] [BOOTLOADER PROFILE] Drivers_open                     :        213us
    [2025-07-24 15:46:19.816] [BOOTLOADER PROFILE] Board_driversOpen                :      26421us
    [2025-07-24 15:46:19.816] [BOOTLOADER PROFILE] Sciclient Get Version            :      10201us
    [2025-07-24 15:46:19.832] [BOOTLOADER PROFILE] App_waitForMcuPbist              :        105us
    [2025-07-24 15:46:19.832] [BOOTLOADER PROFILE] App_waitForMcuLbist              :       7689us
    [2025-07-24 15:46:19.848] [BOOTLOADER PROFILE] App_loadImages                   :       3180us
    [2025-07-24 15:46:19.848] [BOOTLOADER PROFILE] App_loadSelfcoreImage            :       6207us
    [2025-07-24 15:46:19.848] [BOOTLOADER_PROFILE] SBL Total Time Taken             :      77279us
    [2025-07-24 15:46:19.864]
    [2025-07-24 15:46:19.864] Image loading done, switching to application ...
    [2025-07-24 15:46:19.864] Starting MCU-m4f and 2nd stage bootloader
    [2025-07-24 15:46:19.896]
    [2025-07-24 15:46:19.896] SYSFW Firmware Version 11.0.7--v11.00.07 (Fancy Rat)
    [2025-07-24 15:46:19.912] SYSFW Firmware revision 0xb
    [2025-07-24 15:46:19.912] SYSFW ABI revision 4.0
    [2025-07-24 15:46:19.912]
    [2025-07-24 15:46:19.928] [BOOTLOADER_PROFILE] Boot Media       : FLASH
    [2025-07-24 15:46:19.944] [BOOTLOADER_PROFILE] Boot Media Clock : 166.667 MHz
    [2025-07-24 15:46:19.944] [BOOTLOADER_PROFILE] Boot Image Size  : 464 KB
    [2025-07-24 15:46:19.945] [BOOTLOADER_PROFILE] Cores present    :
    [2025-07-24 15:46:19.945] hsm-m4f0-0
    [2025-07-24 15:46:19.960] r5f0-0
    [2025-07-24 15:46:19.960] a530-0
    [2025-07-24 15:46:19.960] a530-1
    [2025-07-24 15:46:19.960] [BOOTLOADER PROFILE] System_init                      :       2841us
    [2025-07-24 15:46:19.960] [BOOTLOADER PROFILE] Board_init                       :          1us
    [2025-07-24 15:46:19.976] [BOOTLOADER PROFILE] Drivers_open                     :        272us
    [2025-07-24 15:46:19.976] [BOOTLOADER PROFILE] Board_driversOpen                :      25997us
    [2025-07-24 15:46:19.976] [BOOTLOADER PROFILE] Sciclient Get Version            :      10268us
    [2025-07-24 15:46:19.992] [BOOTLOADER PROFILE] App_loadImages                   :       2226us
    [2025-07-24 15:46:19.992] [BOOTLOADER PROFILE] App_loadSelfcoreImage            :       7438us
    [2025-07-24 15:46:20.008] [BOOTLOADER PROFILE] App_loadA530_0_Images            :       6657us
    [2025-07-24 15:46:20.008] [BOOTLOADER PROFILE] App_loadA530_1_Images            :       6073us
    [2025-07-24 15:46:20.008] [BOOTLOADER_PROFILE] SBL Total Time Taken             :      61777us
    [2025-07-24 15:46:20.024]
    [2025-07-24 15:46:20.024] Image loading done, switching to application ...
    [2025-07-24 15:46:20.024] Starting  RTOS/Baremetal applications
    [2025-07-24 15:46:20.024] NOTICE:  BL31: v2.11.0(release):
    [2025-07-24 15:46:20.040] NOTICE:  BL31: Built : 17:26:13, Jul 23 2025
    [2025-07-24 15:46:20.072] [IPC RPMSG ECHO] Remote Core waiting for messages from main core ... !!!
    [2025-07-24 15:46:20.568] [IPC RPMSG ECHO] Received and echoed 10 messages ... !!!
    [2025-07-24 15:46:20.568] All tests have passed!!
    

    we will check with R&D how to optimize 272ms stage1+stage2 boot up time.

    For you application 300ms display can output is very difficult. Our experience at AM62x quickly display need ~1.21 second. below are the boot method.

    Stage1 -> stage2 -> uboot. 

    the display image is  static BMP file.

    Best Regards!

    Han Tao

  • Hi Meet,

    As talked over Webex, customer doesn't use HSM. Need your guide to reduce to one stage to boot to application/A53. there are redundant of two stage which is not necessary. 

  • Hi Tony, Zegeng,

    As the first stage of the bootloader must runs from HSM RAM, you can't load the HSM application using this boot flow, you can't directly remove stage-1. You will have to merge both the stages into a single bootloader application for this. 

    For this you will have to add additional bootloader instances from syscfg in Stage-1 for a53 images and will also have to add the code that loads these images, you can copy the code for the same from stage-2 to stage-1. Also, instead of loading SBL Stage-2 image on R5 in Stage-1, you have to load the application image for R5. Some other optimization steps are suggested at the end of the datasheet numbers:

    If you check the timestamps, then it seems that, printing these many logs is also taking some time, you can remove BOOTLOADER_PROFILE logs for now and see how much optimization you can achieve with this.

    Best Regards,

    Meet. 

  • Meet,

    #1. It is private e2e, customer can't access.

    #2. I took a look at that post, didn't find detail instructions.  almost same as upper content. a detail steps would help.

    #3. Why stage-1 must run on HSM RAM? is HSM RAM the 256KB SMS subsystem?

    #4. Can change to other on chip RAM space? like M4F, 

  • Hi Tony,

    I took a look at that post, didn't find detail instructions.  almost same as upper content. a detail steps would help.

    You can follow the steps I mentioned in my previous response:

    - Add additional bootloader instances in the syscfg in Stage-1 for a53 images, for the R5 Core, load the DM application instead of SBL Stage-2:

    - You will also have to add the code that loads these images, you can copy the code for the same from stage-2 to stage-1:

    mcupsdk-core-k3/examples/drivers/boot/sbl_ospi_multistage/sbl_ospi_stage2/am62x-sk/r5fss0-0_nortos/main.c at k3_main · TexasInstruments/mcupsdk-core-k3 · GitHub

    -  We only have around 240kB of HSMRAM available for SBL, so you might not be able to load your SBL appimage if it exceeds this limit.

    is HSM RAM the 256KB SMS subsystem?

    Yes

    Can change to other on chip RAM space? like M4F, 

    This is not possible as the ROM Code loads the stage-1 code to HSM RAM and it is not possibe to change the ROM Code.

    Best Regards,

    Meet.

  • Hi Meet,

    Customer followed your guide to integrity to stage 1 only. saved a lot time, but still take fairly long between runCPU:A53 and startup which is ~200ms.

    #1. assume it is taken by ATF, remove ATF can save a lot of time.

    #2. Is ATF must or necessary for this RTOS based use case?

    #3. What did it do in so long time?

  • Hi Tony,

    Removing ATF is really not recommended, if customer's use case of running the application within 300ms is satisfied then you shouldn't try to remove this.

    I also think that this extra time is due to printing the BOOT_PROFILE logs, the time it takes to print these logs is not included when SBL Total Time taken is calculated, you can also estimate from the timestamps on how long it takes to print these logs .Can you once try disabling the logs and check the timings again, comment the calls to following API calls:

    You can also disable Sciclient get version API, that will save like 10ms, it doesn't really seem possible to optimize the boot time further than this, you can ask them to try these 2 things for now.

    Best Regards.

    Meet.

  • Hello Meet,

    We followed your guide to integrity to stage 1 only. Below are the serial port log data, the still take fairly long between runCPU:A53 and startup, as this is simple example, final example will be larger. We need to optimize as possible. 

    [2025-07-28 17:39:41.963] ---nor stage1---05----
    [2025-07-28 17:39:41.965] Flash_norOspiOpen()-start
    [2025-07-28 17:39:41.969] 
    [2025-07-28 17:39:41.969] SYSFW Firmware Version 10.1.8--v10.01.08 (Fiery Fox)
    [2025-07-28 17:39:41.977] SYSFW Firmware revision 0xa
    [2025-07-28 17:39:41.977] SYSFW ABI revision 4.0
    [2025-07-28 17:39:41.978] 
    [2025-07-28 17:39:42.007] --------App_runA53_0_0_Cpu() start----------
    [2025-07-28 17:39:42.012] NOTICE:  BL31: v2.11.0(release):REL.MCUSDK.K3.10.01.00.33
    [2025-07-28 17:39:42.016] NOTICE:  BL31: Bui-lt : 0-4:57:-09,- Dec -19 2024-
    [2025-07-28 17:39:42.024] --App_runA53_0_1_Cpu() start----------
    [2025-07-28 17:39:42.035] --------App_runA53_1_0_Cpu() start----------
    [2025-07-28 17:39:42.046] --------App_runA53_1_1_Cpu() start----------
    [2025-07-28 17:39:42.050] [BOOTLOADER_PROFILE] Boot Media       : FLASH 
    [2025-07-28 17:39:42.053] [BOOTLOADER_PROFILE] Boot Media Clock : 200.000 MHz 
    [2025-07-28 17:39:42.059] [BOOTLOADER_PROFILE] Boot Image Size  : 561 KB 
    [2025-07-28 17:39:42.066] [BOOTLOADER_PROFILE] Cores present    : 
    [2025-07-28 17:39:42.071] [BOOTLOADER_PROFILE] cpuMHz    : 400
    [2025-07-28 17:39:42.071] r5f0-0
    [2025-07-28 17:39:42.071] a530-0
    [2025-07-28 17:39:42.073] a530-1
    [2025-07-28 17:39:42.073] a531-0
    [2025-07-28 17:39:42.073] a531-1
    [2025-07-28 17:39:42.073] [BOOTLOADER PROFILE] System_init                      :      21083us 
    [2025-07-28 17:39:42.083] [BOOTLOADER PROFILE] Board_init                       :          0us 
    [2025-07-28 17:39:42.090] [BOOTLOADER PROFILE] Drivers_open                     :         98us 
    [2025-07-28 17:39:42.098] [BOOTLOADER PROFILE] Board_driversOpen                :       4745us 
    [2025-07-28 17:39:42.103] [BOOTLOADER PROFILE] Sciclient Get Version            :      10201us 
    [2025-07-28 17:39:42.117] [BOOTLOADER PROFILE] App_waitForMcuPbist              :          7us 
    [2025-07-28 17:39:42.118] [BOOTLOADER PROFILE] App_waitForMcuLbist              :       7689us 
    [2025-07-28 17:39:42.122] [BOOTLOADER PROFILE] App_loadSelfcoreImage            :      12253us 
    [2025-07-28 17:39:42.130] [BOOTLOADER PROFILE] App_loadA53_0_0_Images           :       9082us 
    [2025-07-28 17:39:42.135] [BOOTLOADER PROFILE] App_loadA53_0_1_Images           :      12416us 
    [2025-07-28 17:39:42.144] [BOOTLOADER PROFILE] App_loadA53_1_0_Images           :      15045us 
    [2025-07-28 17:39:42.151] [BOOTLOADER PROFILE] App_loadA53_1_1_Images           :      12460us 
    [2025-07-28 17:39:42.155] [BOOTLOADER_PROFILE] SBL Total Time Taken             :     105085us 
    [2025-07-28 17:39:42.164] 
    [2025-07-28 17:39:42.164] Image loading done, switching to application ...
    [2025-07-28 17:39:42.170] Starting  RTOS/Baremetal applications
    [2025-07-28 17:39:42.170] ---Bootloader_JumpSelfCpu---
    [2025-07-28 17:39:42.227] Hello World! from a53_0_0_core0 --05- 0
    [2025-07-28 17:39:42.240] [a530-1]     0.000058s : Hello World! from a53_0_1_core1 --05- start
    [2025-07-28 17:39:42.243] [a530-1]     0.000120s : Hello World! from a53_0_1_core1 --05- 0
    [2025-07-28 17:39:42.250] [a531-0]     0.000066s : Hello World! from a53_1_0_core2 --05- start
    [2025-07-28 17:39:42.259] [a531-0]     0.000129s : Hello World! from a53_1_0_core2 --05- 0
    [2025-07-28 17:39:42.259] [a531-1]     0.000088s : Hello World! from a53_1_1_core3 --05- start
    [2025-07-28 17:39:42.265] [a531-1]     0.000149s : Hello World! from a53_1_1_core3 --05- 0
    [2025-07-28 17:39:43.227] Hello World! from a53_0_0_core0 --05- 1
    [2025-07-28 17:39:43.241] [a530-1]     1.000004s : Hello World! from a53_0_1_core1 --05- 1
    [2025-07-28 17:39:43.244] [a531-0]     1.000004s : Hello World! from a53_1_0_core2 --05- 1
    [2025-07-28 17:39:43.250] [a531-1]     1.000004s : Hello World! from a53_1_1_core3 --05- 1
    [2025-07-28 17:39:44.229] Hello World! from a53_0_0_core0 --05- 2
    [2025-07-28 17:39:44.235] [a530-1]     2.000001s : Hello World! from a53_0_1_core1 --05- 2
    [2025-07-28 17:39:44.245] [a531-0]     2.000001s : Hello World! from a53_1_0_core2 --05- 2
    [2025-07-28 17:39:44.254] [a531-1]     2.000001s : Hello World! from a53_1_1_core3 --05- 2
    [2025-07-28 17:39:45.228] Hello World! from a53_0_0_core0 --05- 3
    [2025-07-28 17:39:45.246] [a530-1]     3.000001s : Hello World! from a53_0_1_core1 --05- 3
    [2025-07-28 17:39:45.246] [a531-0]     3.000001s : Hello World! from a53_1_0_core2 --05- 3
    [2025-07-28 17:39:45.250] [a531-1]     3.000001s : Hello World! from a53_1_1_core3 --05- 3
    

    #1. What did it do in so long time?

    Removing ATF is really not recommended

    #2. Why is it not recommended to delete ATF? there is not ATF before MCU SDK10, seems it is not must.

    #3. UART print takes some time, but it is trivial, we can see time spend on each line, we can disable it in final integration. but for now, leave it here for reference. 

    [2025-07-28 17:39:41.963] ---nor stage1---05----
    [2025-07-28 17:39:41.965] Flash_norOspiOpen()-start
    [2025-07-28 17:39:41.969]
    [2025-07-28 17:39:41.969] SYSFW Firmware Version 10.1.8--v10.01.08 (Fiery Fox)
    [2025-07-28 17:39:41.977] SYSFW Firmware revision 0xa
    [2025-07-28 17:39:41.977] SYSFW ABI revision 4.0
    [2025-07-28 17:39:41.978]

  • Hi Zegeng,

    Please refer to this document on ATF integrated flow: AM62x MCU+ SDK: Understanding ATF integrated flow for A53

    If you want to build the application without the ATF then you would have to set ATF_INTEGRATED_BOOT to no instead of yes, this will allow you to build the application without ATF: mcupsdk-core-k3/examples/hello_world/am62x-sk/a53ss0-0_freertos/gcc-aarch64/makefile at k3_next · TexasInstruments/mcupsdk-core-k3 · GitHub

    Most of the time I think is still attributed to printing logs, removing ATF can save you 20-30ms I assume. 

    Please check the following timestamps:

    Printing these logs itself is taking around 100ms, please note that this time is not counted in SBL Total Time Taken, also as Tony mentioned before, A53 can't start the application until SBL completes its execution and DM application starts running on R5. Please note that this will delay the SBL completion and will attribute to total time taken to boot A53. 

    Best Regards,

    Meet.

  • Hi Zegeng,

    Adding some comments on running an application on A53 without ATF.

    ATF (Arm Trusted Firmware) is used as the initial start code on ARMv8-A cores for all K3 platforms. This is a recommended sequence coming from Arm and is used to:

    1. Set up the initial core state

    2. Apply errata fixes for Arm Cortex A53 (coming from Arm)

    3. It sets up itself as the EL3 monitor handler

    https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/latest/exports/docs/linux/Foundational_Components_ATF.html 

    In a production system, these things are needed to overcome security vulnerabilities and to ensure that the sequence of event at A53 boot up are followed per Arm's recommendation. For evaluation you may be okay skipping, but for production this is recommended.

    Regards

    Karan

  • Thanks for BU team's support.

    Update: After integrating to single stage 1 and remove UART printf, boot time can meet target temporally.  If remove ATF or not still under consideration.