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: RTS.Lib vs. bringing in separate files (autoinit.c) auto_init_elf function problems

Tool/software: TI C/C++ Compiler

Hi,

     I am attempting to bring autoinit.c into my project.  I successfully build.  My linker order is autoinit.c, rts*.lib, linker generated.  It loads onto the board alright, but ends up in abort().  I put an index counter in the while loop.  The index is 1 when it fails, defaulted to 0, incremented after the constructor call from

unsigned int* x=0xEFFFFF08;  // almost top of memory.

*x=0;

while (&(__TI_INITARRAY_Base[i]) != __TI_INITARRAY_Limit)

    __TI_INITARRAY_Base[i++]();

    (*x)++;

 }

The first call to my global constructor seems to return okay, but the 2nd does not.  The NRP value in this abort is 0x0000_0000.   There are about 30-40 total constructors.  The RTS library by itself works fine. 

  1.   Do you know if this has been tested and works?  Is there a reason it may fail?   My project is located on an isolated computer;  let me know if I should attempt to create an example project (it probably wont be easy). 

And

2.  Let's say I wanted to rebuild the RTS library with auto_init changes.  Why don't I see my arbitrary memory location be filled in.  I was able to do this with printf() in a rebuilt rts.lib

Setup:

Code Composer Studio 5.x

Big Endian, ELF format.  Added the "__TI_EABI" flag needed for the isolated file auto_init.c and have the auto_init_elf() function be executed in the project.

CGT 7.3.23 (this is where I get the RTS.src from)

Starting point: A working product that is fielded.  It is known to successfully boot and perform with the basic rts lib. 

      Rebuilding the RTS lib seems to work, but I don't see a global pointer populate an arbitrary space in memory.  I proved I could do this in the printf.c file, but it doesn't seem so in auto_init.c::auto_init_elf()