MCU Expresso projects won't run when changing from Redlib to Newlib

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MCU Expresso projects won't run when changing from Redlib to Newlib

Jump to solution
1,291 Views
jeffsylvester
Contributor III

I have run several of the example projects in FRDM-K66F and it appears there is some kind of library contention or mis-direction going on.  if a project was created using Redlib, and if you go and switch the C library to Newlib on the Project->Properties->C C++ Build->Setttings-Manages Linker Script->Library  and then run the project in debugger, the project hangs in startup because it never jumps into main().   Likewise if I have a project built in Newlib and I switch to redlib, then I get all kinds of linker errors, for undefined reference to "function name"   and even if I go back and check all the files exists, and are included in the Includes tab under settings, so all files exist, and the correct path for includes is listed, yet it can not find the header files?    For instance, If I open example frdmk66f_fatfs_sdcard.  this project was build under Redlib.    if all I do is change to Newlib and recompile I get no errors or warnings from either compiler or linker, yet when I run the code it hangs on startup, jump to main, never jumps to main, as though the C source file did not link.    

there must be some kind of project settings, or symbols or something else like a path statement or environment variable that is off pointing to the wrong thing.   any ideas

0 Kudos
1 Solution
1,061 Views
jeffsylvester
Contributor III

the issue was related to changing to no host, and forwarding the printf to a uart using a retarget.c like mentioned in other threads, while the debug console and semihost configuration is different.  

View solution in original post

0 Kudos
4 Replies
1,061 Views
FelipeGarcia
NXP Employee
NXP Employee

Hi Jeff,

 

I am using FRDM-K66F board and SDK 2.6.0 and MCUXpresso 11. 

 

I changed the library from Newlib to Redlib and vice versa but I wasn’t able to reproduce the issue you mention. I used the Quickstart Panel, Quick Settings > Set library/header type.

 

Please check the following links that may be useful for you:

What are Redlib and Newlib? 

https://community.nxp.com/thread/389104 

I hope it helps.


Best regards,
Felipe

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
1,061 Views
jeffsylvester
Contributor III

Now maybe it is related to my board, I will continue investigating, I fired this up at work and it did it again, while it appeared to work at home on a different board?  

Main Fault.PNG

0 Kudos
1,062 Views
jeffsylvester
Contributor III

the issue was related to changing to no host, and forwarding the printf to a uart using a retarget.c like mentioned in other threads, while the debug console and semihost configuration is different.  

0 Kudos
1,061 Views
jeffsylvester
Contributor III

Yes I think the issue is related to running redlib with semihost to newlibnano nohost.  I will investigate some more

--

Sent from Outlook Email App for Android Tuesday, 20 August 2019, 00:58PM -05:00 from nxf46115 admin@community.nxp.com :

>NXP Community

>Re: MCU Expresso projects won't run when changing from Redlib to Newlib

>reply from Felipe García in MCUXpresso Software and Tools - View the full discussion

0 Kudos