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.

How to reduce the code size !!

Dear fellows,

 

I am working on C6713 based custom board. The code has been written in C++. The code size has been increased to 90K. I am not very happy with this big code size. I have analyzed this code to conclude that there are mainly two type of functions in this code.

1. that need to execute in real time (size almost 65K).

2. that does not execute in real time, and mainly related to the maintenance tasks (size almost 25K).  

Since i got plenty of SDRAM, and IRAM is just 196K, so i just wanna ask you guys, that is it good idea to create a code section on SDRAM and Push that 25K of code, that do not execute in real time. This way my .text section will be reduced to 65K. 

 

Also, please suggest me some practical ways of reducing the code size!!

Please give ur fruitful suggestions !!

  • The best way to get advice for the use of the C/C++ Compiler is to go to the TI Processor Wiki Pages, click on Code Generation Tools in the center of the page, then scroll down to the list of Subcategories. You will find several topics listed that will provide different levels of support for using the compiler options for you code preferences.

    Since you have said nothing about how you are using the compiler right now, the first thing is to get your code debugged (which you may have done already) and then the second thing is to switch to the Release build configuration and re-build your code. It will run faster and will be smaller.

    adnan khan said:
    is it good idea to create a code section on SDRAM and Push that 25K of code, that do not execute in real time.

    Yes, this is a very good idea. There may be Wiki topics on how to do this, but also you will want to refer to the Optimizing Compiler User's Guide and the Assembly Language Tools User's Guide.

  • thank you very much randyP for ur suggestion. The link seems rich of resources. I m getting into it and hopefully get some answer out there !!!