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.

MCU-PLUS-SDK-AM243X: Reduce size of secondary bootloader

Part Number: MCU-PLUS-SDK-AM243X

Hello TI Expert,

I need to reduce the size of the SBL_OSPI. Because the flash I am using is only 1MB and I need more space from appimage.

I have tried to remove some logging and UART functions and other code from main of SBL_OSPI. This has removed about 20 KB of data
From what I understand the application binary is only about 90KB. And most of the data comes from SYSFW.bin

Is there a way to reduce the size of this file ? Becaus I have tried modyfying resource allocation as mentioned here:

https://software-dl.ti.com/mcu-plus-sdk/esd/AM243X/latest/exports/docs/api_guide_am243x/RESOURCE_ALLOCATION_GUIDE.html

But the SYSFW.bin size remained the same. 

Do you have any tips of how to reduce the size of the SBL_OSPI?

Thank you for your time and have a wonderful day.

Dominik

  • Hi Dominik,

    The sbl_ospi release build takes about 105KB (MSRAM_0) and 30KB (MSRAM_1). You can adjust the sizes and the start addresses for MSRAM_0 and MSRAM_1 to fit in the first 256KB of the MSRAM. The last 128KB of MSRAM will be used by the SysFW, so it will leave at least 1.7MB for your application. Also the 256KB used by sbl_ospi can be used as the data buffers or dynamically allocable memory once the sbl_ospi passes the control to appImage.

    The SysFW.bin is mostly will be loaded and run on the DMSC. It does take the last 128KB of the MSRAM as working memory.

    Best regards,

    Ming 

  • Hello Ming,

    I dont think I made it clear. I have only 1MB of flash memory. Which is the limiting factor.
    So now I am trying to reduce the size of SBL_OSPI.tiimage before I program it into flash.

    So the problem I am facing now is to reduce the size of SBL tiimage, to free some flash space.
    I have realized that the application binary is roughly 1/3 data of the final SBL_OSPI.tiimage.

    So my question is if it is possible to reduce the size of SYSFW.? Which from my understanding 
    makes up the bulk of the data of SBL_OSPI.tiimage.

    Are there other ways to reduce the size of the bootloader and do you have any estimate on how small the bootloader could be?

    Thank you for sharing your knowledge,

    Dominik

  • Hi Dominik,

    Unfortunately, there is no way to reduce the SYSFW size.

    Looking at the MAP file of the sbl_ospi release. I see the source/drivers/lib/drivers.am243x.r5f.ti-arm-clang.release.lib uses 66KB for code, where there quite a few UDMA related code. I was wondering that may be you can change the OSPI to CPU polling instead of using UDMA. This way it can reduce some of the sbl_ospi code size.

    Best regards,

    Ming