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.

Load time initialization of global variables



Hi,

We are working on optimizing a project for C5000 family DSP. We have 9KB of cinit section which we want to save by enabling the linker option 'Run-Time Autoinitialization (-cr)'. Enabling this option saves the memory and our program works fine when we load the .out from CCS. But it is not working when we boot load the program. I believe CCS loader module takes care of initializing the global variables while loading the program.

1. Is there any document or reference available to explain how the loader module reads the cinit tables and initializes the gloabal variables

2. Are there any scenarios where enabling the option 'Run-Time Autoinitialization (-cr)' is not recommanded.

Regards,

Pratap.

 

  • Pratap Reddy M V said:
    1. Is there any document or reference available to explain how the loader module reads the cinit tables and initializes the gloabal variables

    No document.  The RTS source file autoinit.asm has comments and code which provide a good description.  It is supplied in the zip file rtssrc.zip which comes with the compiler distribution.  It can be found in a directory similar to C:\Program Files\Texas Instruments\ccsv5\tools\compiler\c5500\lib .

    Pratap Reddy M V said:
    2. Are there any scenarios where enabling the option 'Run-Time Autoinitialization (-cr)' is not recommanded.

    Few are the scenarios where you can use -cr.  Some intelligent loader, such as the built into CCS, must interpret the records in the .cinit section and use them to initialize memory.  Most embedded systems do not have such a loader.  

    Thanks and regards,

    -George

  • Hi George,

    Thank you so much for your reply and useful info.

    Regards,

    Pratap.

  • Since cinit records are only needed at boot time, maybe the customer can place their .cinit records in a RAM area that they will reuse during runtime?    They could put cinit data in SARAM, and then overwrite this memory with algorithm data.   This would require a reload of the image prior to each run, but would allow that 9K of cinit to be reused.

  • Hi Karl,

    Yes, we are considering this option also. But this 9k cinit section is linked to algorithm modules also, for which SARAM will not be free. I am thinking to do it in a slightly different way. Will updated you the results later.

    Regards,

    Pratap.