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.

[FAQ] AM2634: MCU-PLUS-SDK-AM263X: How to understand/optimize the boot time of RBL/SBL ?

Part Number: AM2634

I have moved from 08.03/08.04 to 08.05 and my boot time has increased. How to optimize the same ?

The boot time is very high for HS-SE devices as compared to HS-FS devices. How to optimize the same ?

  • This FAQ will only cover the out of box changes that are incorporated by the example. If the SBL being used by the user is an custom SBL then identify the changes what are in-difference to what was provided in the SDK.
    If your query is more towards changes in SDK that caused this issue then this FAQ will answer some of these queries.

    Top Level view of Application Boot in Automotive Applications

    Q : Is it compulsory to load the HSMRt Firmware in HS-FS devices ?

    To check if the device is HS-FS or HS-SE device refer this link - https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1170785/faq-mcu-plus-sdk-am243x-how-to-identify-if-the-device-is-gp-device-or-hs-device

    If the device is HS-FS device, the loading of HSMRt Firmware (TIFS-MCU Firmware) is optional. You can choose to skip the same if your application does not require to use HSMRt services or the Crypto Hardware accelerators which are closed by default.

    Features SBL Size HSM Run Time Size Application Size End-End Boot Time (HS-FS) Boot Time Breakup
    RBL Boot Time (HS-FS) SBL Init Time (HS-FS) HSMRt Load Time (HS-FS)  SBL Post-load Time (HS-FS)
    SBL with HSMRt firmware loading 183 KB 32 KB

    24 KB

    205.547ms

    52.765ms

    1.292ms

    139.763ms

    9.98ms

    SBL without HSMRt firmware loading 48 KB 32 KB 24 KB

    50.066ms

    39.540ms

    1.914ms

    -- 9.5ms

    Note : Data captured with 8.06 SDK and AM263 PG 1.1

    The recommendation from TI is to always keep HSMRt in the device as this will reduce the delta once the users migrate from HS-FS devices to HS-SE devices because for HSMRt firmware (TIFS-MCU Firmware) is mandatory for HS-SE devices.

    Q : Is there a way to reduce the boot time without removing the HSMRt firmware so that it becomes a unified solution for HS-FS devices and HS-SE devices ?

    To explain this in detail we will optimize the different parts of device booting -

    • RBL Boot Time
    • HSM Run Time Loading Time
    • SBL Execution Time

    1. Optimizing the RBL Boot time

    There is no way to optimize the boot time of RBL apart from reducing the size of the SBL.

    Yes. Currently the SBL is built to incorporate the TIFS-MCU Firmware like this (image is for AM263x) --

    This causes the ROM Bootloader to verify the larger SBL image (which is due to HSMRt image incorporated). The verification of HSMRt image is already done by ROM when the Bootloader_socLoadHsmRtFw is issued so the verification of HSM Run Time Firmware via SBL image is a overkill for an infield device.

    SDK provides the incorporated image in the SBL to support different types of SBL like SBL_QSPI, SBL_UART, SBL_CAN, SBL_SD etc. This keeps the design and migration to 3P HSM stack simpler.

    To optimize the same -

    1. De-couple the HSM Run Time image from SBL_QSPI example.
    2. Flash the HSM Run Time independently to the flash. 
    3. Use eDMA to copy the image from Flash to RAM which is a scratchpad memory (HSM ROM does not read from flash memory and only considers the RAM memory as valid memory range).
    4. Send the IPC request to the HSM ROM to load the HSM Run time Firmware.
    5. After the HSM Run Time Firmware is loaded, SBL can reclaim the scratchpad memory for loading the application.

    This will reduce the time taken by RBL to initialize the firmware boot time.

    2. Optimizing the SBL Run time by switching the SBL frequency to MAX.

    By default the SBL is running at lower frequency which impacts the performance. So as soon the user PLL Initializations are done, user can move the R50_0 CPU which is executing SBL to 400MHz.

    3. Enablement of the parallelization of CPU Load of application and HSM Run Time loading and execution

    Change the configuration of HSM Run Time Loading to make sure a lot of it is going in parallel.

    This is a patch file which accounts for all the changes mentioned. User is free to do more effective changes to get better boot time.

    /cfs-file/__key/communityserver-discussions-components-files/908/boot_5F00_time_5F00_1.diff

    Special Note

    Time breakup for each time taken by the SBLs and their changes

    Features SBL Size HSM Run Time Size Application Size End-End Boot Time (HS-FS) Boot Time Breakup
    RBL Boot Time (HS-FS) SBL Init Time (HS-FS) HSMRt Copy Flash to RAM HSMRt Load Time (HS-FS) SBL Post-load Time (HS-FS)
    SBL with incorporated HSMRt firmware (Default Out of Box) 183 KB 32 KB

    24 KB

    205.547ms

    52.765ms

    1.292ms

    --

    139.763ms

    9.98ms

    SBL without incorporated HSMRt firmware 49 KB 32 KB 24 KB

    202.361ms

    39.516ms

    1.887ms

    12.081ms

    139.453ms

    9.416ms

    SBL without incorporated HSMRt firmware on highest clock (400MHz) 49 KB 32 KB

    24 KB

    47.533ms

    32.289ms

    0.1ms

    2.287ms

    7.978ms

    4.879ms

    SBL without incorporated HSMRt firmware on highest clock (400MHz) and parallel Application with HSM enabled 49 KB 32 KB 24 KB

    43.402ms

    33.034ms

    0.1ms

    2.287ms

    3.147ms

    4.834ms

    Note : Data captured with 8.06 SDK and AM263 PG 1.1

    These numbers are boot time numbers from the examples provided by the SDK. These are not the optimized or best numbers which these devices can provide.