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.

Compiler: __c_init00 source code



Tool/software: TI C/C++ Compiler

Hi,

Is there any chance i can get access to ccs starup code __c_init00? The code b/w Reset vector and main().

#tms320c671

#tm4c123gh6pm

Kind Regards,

Kowalski

  • Hi,

    In you CCS installation directory (or anywhere you install your CGT version) you should find a directory "tools/compiler/cxxxx_<compiler_version>/lib" with the C/C++ library source archive rtssrc.zip (maybe already extracted to subdirectory "src").

    The file "boot.c" should contain the source for "_c_c_int00()".
  • Older versions of the compiler supply the RTS source code in a zip file.  Recent versions supply an ordinary directory of source files.  Here is a typical location:

    C:\ti\ccsv7\tools\compiler\ti-cgt-c6000_8.1.2\lib\src

    Thanks and regards,

    -George

  • It doesnt contains any source code for __c_init0.
    Only macro in all file in the diectory:
    #define c_init0 __c_init00
    But where is __c_init00.... couldnt fint em.
  • The file boot.c has a function that starts with these lines ...

    /*****************************************************************************/
    /* C_INT00() - C ENVIRONMENT ENTRY POINT                                     */
    /*****************************************************************************/
    extern void __interrupt c_int00()

    Thanks and regards,

    -George

  • Totally agree George, but as i mentioned before this function definition we have a macro in the same file, i.e.:
    #define c_init00 __c_init00

    now two things:
    1. where ever c_init00 is used, will be replaced by __c_init00. so where is this __c_init00 definition?
    2. How is this possible that a macro name is used as function name, will it not be a symbol conflict at linker? i.e. above macro defines c_init00 == __c_init00, and bellow this in the same file we have a function definition that uses symbol: c_int00() {...}!!!
  • kowalski said:
    1. where ever c_init00 is used, will be replaced by __c_init00. so where is this __c_init00 definition?

    Because of ...

    #define c_int00 _c_int00

    ... this function definition ...

    /*****************************************************************************/
    /* C_INT00() - C ENVIRONMENT ENTRY POINT                                     */
    /*****************************************************************************/
    extern void __interrupt c_int00()

    ... expands to ...

    /*****************************************************************************/
    /* C_INT00() - C ENVIRONMENT ENTRY POINT                                     */
    /*****************************************************************************/
    extern void __interrupt _c_int00()
    

    The change is subtle.  Note the '_' at the front of the function name.

    kowalski said:
    How is this possible that a macro name is used as function name, will it not be a symbol conflict at linker?

    No.  When you link with the options --ram_model or --rom_model, the linker observes certain conventions for linking C and C++ code.  Among these conventions is that the symbol for the program entry point is _c_int00.

    Thanks and regards,

    -George