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.

TI starterware bootloader on AM335x

Hi All,

We are using AM335x for one of our system development where system boot time is very stringent. We are expecting the unit to boot in 500ms time. We are exploring multiple options to achieve this. Need inputs to decide on this. We want to use TI starterware bootloader to achieve this. 

Following are the available options and would like to know which one would give the best boot performance.

1. TI starterware boot loader booting from NAND flash

2. TI starterware boot loader booting from SD card

3. TI starterware bootloader booting from SPI NOR flash

Let me also know if there is  any data for boot up time using u-boot?

Regards,

Seetaram

  • Hey! Seetaram:
    The booting speed is depend on the task which you work. I didn't have any suggestion for boot optimize in startware. But I have the experience for boot optimization for RTOS (Real time OS AM339x). If your specification of boot speed is less than 500ms, I think that the current soltion can catch your goal. However , it the best choice that it boot from NOR flash.
    Best regards
    Henry Chou.
  • Thanks Henry,

    We are not considering using any RTOS/OS due to boot time constraint. So thought of using TI starterware boot loader with bare minimal functionality. My only concern was the time it takes to copy the Application binary from flash to DDR. Need to figure out this information.
  • Hey! Sram:
    The none-OS booting is very fast , because it don't need to do the the multi-task service. But it must be some limitation for applicance. Such as the profitnet, EtherCAT , ethernet lwip are tough to implement. However, you may try the boot time by coding. Using the UART console function and DMtimer. To print out the time stamp message in bootloader code.
    Best regards.
    Henry Chou
  • Hi Henry,

    I just started experimenting on the boot time, i am not sure how to use the DMtimer functions to get the time required for system boot? is there is any API document for TI starterware where i can refer for these functions? I looked into the DMtimerEnable and DMtimerDisable functions but i am not sure how to use these functions to get the system time? Please suggest.

    I came to know that, there are four libraries linked while building any application, libdrivers.a, libutils.a,libplatform.a and libsysconfig.a, is there any documentations on the functions exported by these libraries?

    Regards,

    Sram

  • Hi! Sram:
    The DMtimer project example is C:\ti\AM335X_StarterWare_02_00_01_01\build\armv7a\cgt_ccs\am335x\evmAM335x\dmtimer.
    However , you may add on the print out function in bl_main.c
    int main(void)
    {
    /* Configures PLL and DDR controller*/
    ConsoleUtilsPrintf("TimeStamp 1 %d Boot start.\n",dt_timer);

    BlPlatformConfig();

    UARTPuts("StarterWare ", -1);
    UARTPuts(deviceType, -1);
    UARTPuts(" Boot Loader\n\r", -1);

    /* Copies application from non-volatile flash memory to RAM */
    ImageCopy();
    ConsoleUtilsPrintf("TimeStamp 2 %d Boot finished.\n",dt_timer);
    UARTPuts("Jumping to StarterWare Application...\r\n\n", -1);


    /* Do any post-copy config before leaving boot loader */
    BlPlatformConfigPostBoot();
    ConsoleUtilsPrintf("TimeStamp 3 %d Boot ready.\n",dt_timer);
    /* Giving control to the application */
    appEntry = (void (*)(void)) entryPoint;

    (*appEntry)( );

    return 0;
    }
    //========================================================================================================
    Best regards.
    Henry Chou
  • Hi Henry,

    Thanks for the response. I tried your sample but the compilation failed as the dt_timer variable is not resolved. I searched in Starterware files for this variable but could not get any reference. I am not sure where the dt_timer is declared and how it gets the current time?

    Regards,

    Sram

  • Hi! Sram:

    Oops!~My example code is not completly. Because the time stamp function should add on the DM_timer interrup ,dm_timer declaration , and the initalization of PLL(FLL?) and timer. However, the PLL and MMU setting is behind the system initialzation, So that it should take care the procedure sequence. The DM_TIMER example project can be found that I mention in post reply. Sorry! I am going on other project in CAN driver, I2C for EtherCAT systems. Maybe I can't describe the function for detail.

    Best regards.

    Henry Chou

  • Hi,

    I tried to profile the imageCopy function and found that, it takes 800 msec to copy app binary of size 84kb.

    The problem is that, the boot loader has a function called ImageCopy() which copies the application binary image from SD card to DDR3, which takes 800 msec to copy 84kB of application binary.
    This is taking very long time, the reason is the way ImageCopy() function is implemented. It reads SD card app binary data to IRAM buffer of 512 bytes chunks and then memory copies to DDR3 address 0x80000000.
    So the copying is not direct copy to DDR3 from SD card. It is 2 stage. Read into IRAM buffer, then memcpy to DDR3. So it takes so long to copy image to DDR3.

    I tried a starterware sample application hs_mmcsd, and made few changes to the function cat_Cmd to copy data from SD card to DDR3. I figured out that it takes just 10 msec to copy 50kb of data.
    This clearly shows that the 2 stage copy in boot loader is causing the delay.

    I tried to change the boot.lds to have .bss section in DDR instead of IRAM to make direct read from SD card to DDR3 but it didn’t work.

    Let me know how to copy the app binary from SD card directly to DDR3 at one shot as it is done in hs_mmcsd application?