My development environment is MCUXpresso IDE. My microcontroller is LPC11E68. The reset entry point of my code calls __libc_init_array(). This function is in libc.a. We are not provided with source code for this function? Map files gives following information:
c:/nxp/mcuxpressoide_10.2.1_795/ide/tools/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/thumb/v6-m\libc.a(lib_a-init.o)
./LPC_Code/cr_startup_lpc11e6x.o (__libc_init_array)
Why is this function called at startup? Is there documentation that explains why this function needs to be called in reset initialization code?
I'm using NewLib (Nohost) library.
Solved! Go to Solution.
This serves calling constructors and other library initialization which is necessary before calling main. There is a good description about this as well on gcc - understanding the __libc_init_array - Stack Overflow .
I hope this helps,
Erich
This serves calling constructors and other library initialization which is necessary before calling main. There is a good description about this as well on gcc - understanding the __libc_init_array - Stack Overflow .
I hope this helps,
Erich