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.

TMS570LS3137: Build project without main function

Part Number: TMS570LS3137


We are using " CCS  Version: 10.1.1.00004" and compiler version is "TI v20.2.4.LTS. we wanted to build a project without main function, as the program control flow jumps from HW initialization routine to OS ( In house developed OS) using assembly jump instruction. we don't require main function, however we unable to build the project without main, we are getting following error,

Description Resource Path Location Type unresolved symbol main, first referenced in C:\ti\ccs1011\ccs\tools\compiler\ti-cgt-arm_20.2.4.LTS\lib\rtsv7R4_A_be_v3D16_eabi.lib<args_main.c.obj> ACM C/C++ Problem

How to get rid of this compiler error.

  

  • hello,

    In CCS project, the _c_int00 is the C/C++ entry point. The _c_int00 function (in sys_startup.c) performs tasks to initialize the environment. At last, it calls the function _ _TI_auto_init to perform the C/C++ auto-initialization, and calls the main() function to run the C/C++ program.

    You can modify the boot routine to meet your system requirements. You can use other name instead of main(), for example os_main(). 

    BTW, It's better to keep main() since a main function is required within standard C++.

    What is the compilation error?

  • Hi QJ Wang, 

    Thank you so much for your input.

    We have multiple executables (binaries), It starts from Boot and jumps to OS upon HW initialization. So don't want main() function in OS. As we are using our own HW initialization routines we wanted to disable TI related pre defined/library functions. can you tell me how to do that in CCS10.2.

  • Hello,

    CCS is designed to use the default entry point _c_int00, which is the start of the RTS library's C compiler initialization function. But you can specify your own entry point for your application: use --entry_point=code_start in the project's linker configuration.

  • Hi QJ Wang,

    I understand this point, however we wanted disable/exclude the RTS library from our project. As we are working on certification project compiler library is not allowed to use.  The final executable should be generated only or hand written code. Could you please guide me how to do that?

  • Your entry-point function is to initialize the environment required by a C/C++ program. In this function, the stack is set up, status bits are initialized, global variables are initialized, etc.  If you change the entry point to another symbol, you have to make sure the function that replaces _c_int00 also performs those steps.

    Please refer to ARM Optimizing Compiler User Guide:

  • Yes, the list of functions that you have specified are done in our boot code. when we have used CCS 6.1 and compiler version v5.1.6 , we have specified "ENTRY POINT SYMBOL: 0" . Hence we would like to do same in the CCS10.2 as well. is it possible? 

  • You can specify the entry point in CCS10.2 too.

  • Thank you so much QJ Qang, I resolved this issue by disabling File Search Path -> Disable Automatic RTS selection.