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.

TMS320F28069: How can you change the name of the entry function "main()" in code composer studio?

Part Number: TMS320F28069

Tool/software:

Hello,

I wish to change the entry main function from this:

void main(void){

return 0;

}

to this:

void application_main(void){

return 0;

}

However, if CCS does not find a function with the specific name "main", it returns errors. 

What settings do I need to set to perform this change? 

Thanks.

  • Hi Valeri,

    1. You have the option to change what symbol to run from when DEBUGGING. 

    Tools > Debugger Options -> Auto Run and Launch Options -> Auto Run Options -> change run to symbol 'main' to 'application_main'

    2. However this will NOT apply to your run time application code. I have looked into being able to change main to another name and use that new name. However because of our compiler you are not able to change the standard C name of the main() function.

    Please have a look at this thread: https://stackoverflow.com/questions/3974796/in-c-main-function-is-the-entry-point-to-program-how-i-can-change-it-to-an-oth

    Best,

    Ryan Ma

  • Hi Ryan,

    Are you saying it is impossible to rename the standard C main() function specifically in CCS? I've seen it been done in Keil before with custom startup files, could you not do the same in Code composer? 

    Thanks,

    Valeri.

    Edit: 

    I have solved my issue. The CodeStartBranch.asm file calls to a file called boot28.asm with default settings. What I did is I linked that file to my project directory, changed all relevant sections named "_main" to "_application_main" and that compile my code without any errors. CCS now looks for "application_main" instead of "main". This link helped me.

    I just have one worry if this change will cause any problems. Can you confirm? 

  • Hi Valeri,

    This should not cause any problems as long as your application branches to your new "main" function code.

    Best,

    Ryan Ma