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/MSP430FR5994: Choosing an entry point

Part Number: MSP430FR5994

Tool/software: TI C/C++ Compiler

Hello, I am trying to make a c++ project with a few static const arrays. How I understand they should be initialized during a bootstrap routine, which happens in boot.c file. In this file I have found a list of entry points - _c_int00, _c_int00_noargs, _c_int00_noinit and so on. I guess I should use _c_int00_noargs, but when I compile a project it starts in _c_int00_noinit_noargs.

I have tried to set linker option --entry_point=_c_int00_noargs, but this chage nothing. I've just got a warning "entry-point symbol other than "_c_int00" specified:"_c_int00_noargs".

I am thinking about rebuild a library which contains boot.c, and chage it to my own file. But, I doubt if this is a good solution. Anyway, I bet there is a correct method to change an entry point.

  • CCS chooses one of the c_int00 entry points based on various check-boxes in the Properties (I don't know them all). 

    I suspect you actually want _system_pre_init(), which is called very early in startup -- notably: before C .data/.bss initialization. [Ref MSP430 CC User Guide (SLAU132U) Sec 6.9.1]. Don't forget to "return(1);" at the end.

  • Please search the MSP430 compiler manual for the chapter titled Linking C/C++ Code.  Note how you are required to use either the option --rom_model or  --ram_model.  Once the linker sees either option, special conventions for linking C/C++ code are implemented.  Among these conventions is automatically choosing among these variants of the startup routine ...

    Vladimir Rosiaev said:
    _c_int00, _c_int00_noargs, _c_int00_noinit and so on

    Please do not try to reverse engineer this process, or somehow try to get in the middle  of it.  Allow the tools to handle these details for you.

    Thanks and regards,

    -George

  • Thank you, I had had power supply problems and that was a reason of unpredictable behavior of static variables. Everything works well.