AnsweredAssumed Answered

MQX 4.1 and Newlib

Question asked by Chris Solomon on Aug 13, 2014
Latest reply on Feb 20, 2015 by Radek Sestak


I am trying to migrate from EWL to Newlib for our product, so we can take advantage of the C++11 features.


I am tackling the transition together with the work to migrate from MQX 4.0.1 to 4.1.

We are using manually created make files and linker files, not using code warrior (although I have it just to generate example projects for reference).


I have MQX configured to build using the gcc_arm toolchain, and the libraries are building fine.

In my application code I have updated my linker file to provide the symbols required by comp.c, and newlib - so I have

__preinit_array_start, __preinit_array_end, __init_array_start, __init_array_end, the fini array, zero table and copy table etc.


For linking I have removed the include paths for EWL and added  -lrdimom -specs=rdimon.specs -specs=nano.specs

The code compiles, however in the toolchain_startup it crashes at the "atexit" call (and if that is commented out, at the __libc_init_array).

(Has no problem getting through the init_hardware and data_startup.)


I have checked the map file, and the functions are present, and I've looked through the source for newlib, and I don't believe I am trying to call malloc (which I guess would fail given there is no heap at that point).


Can anyone give me any advice, point me at some useful documentation or example code that would help me get my project going?


Feel free to ask for more information.