Not able to run a "Hello World" program in MCUXpresso ide

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

Not able to run a "Hello World" program in MCUXpresso ide

Jump to solution
2,019 Views
josephjean-jacq
Contributor III

Hello Everyone,

Please forgive me for this newbie question, but I am new to the world of RTOS. I just recently downloaded and installed the MCUXpresso IDE and I created a new C++ project through the project wizard using the LPC 1343 as a target platform. I added a source file to the project and wrote a simple hello world program, aka cout << "Hello World" << endl. 

Right now I do not have any development boards (still waiting for mines to be shipped in), however I am not actually trying to run the hello world program. I just want to be able to build the hello world project without any errors/issues (basically getting familiar with MCUXpresso). Surprisingly enough, I ran into 5 errors and a warning when I tried to build the Hello World project. 

These are the errors I received:

Description Resource Path Location Type
Hello World.axf section `.bss' will not fit in region `RamLoc8' Hello World C/C++ Problem
Hello World.axf section `.text' will not fit in region `MFlash32' Hello World C/C++ Problem
make: *** [Hello World.axf] Error 1 Hello World C/C++ Problem
region `MFlash32' overflowed by 254856 bytes Hello World C/C++ Problem
region `RamLoc8' overflowed by 396 bytes Hello World C/C++ Problem
cannot find entry symbol ResetISR; defaulting to 00000000 Hello World C/C++ Problem

I frankly don't understand a how a simple hello world program can overflow the flash and memory constraints of the MCU. If anyone could give me any pointers to help solve these errors, that would be greatly appreciated!!

Thanks

P.S. 

I attached a screenshot of the errors as listed in MCUXpresso ide

1 Solution
1,325 Views
lpcxpresso_supp
NXP Employee
NXP Employee

By default, MCUXpresso IDE creates C++ projects configured using techniques similar to those described in this external site : Using C++ on microcontrollers code size tricks 

However the C++ new project wizard for preinstalled parts (i.e. those MCUs inherited from LPCXpresso IDE that don't require an MCUXpresso SDK to be installed) are configured out of the box to use "Newlib" rather than "NewlibNano". Changing your project to use NewlibNano should save a fair amount of space. You can do this using"

  • Quickstart -> Quick Settings -> Set library/header type

See section 15.3, "Switching the selected C library" in the MCUXpresso IDE v10.2 User Guide for more details.

 

However, when using C++ I would recommend always try to avoid..

#include <iostream>

in your source code, as this will generally increase the size of your final image very noticeably (due to the code included in the C++ header, along with the references this will also trigger) even if you don't directly use iostream.

Switching to using a simple printf instead will make a massive difference to code size.

Regards,

MCUXpresso IDE Support

View solution in original post

2 Replies
1,326 Views
lpcxpresso_supp
NXP Employee
NXP Employee

By default, MCUXpresso IDE creates C++ projects configured using techniques similar to those described in this external site : Using C++ on microcontrollers code size tricks 

However the C++ new project wizard for preinstalled parts (i.e. those MCUs inherited from LPCXpresso IDE that don't require an MCUXpresso SDK to be installed) are configured out of the box to use "Newlib" rather than "NewlibNano". Changing your project to use NewlibNano should save a fair amount of space. You can do this using"

  • Quickstart -> Quick Settings -> Set library/header type

See section 15.3, "Switching the selected C library" in the MCUXpresso IDE v10.2 User Guide for more details.

 

However, when using C++ I would recommend always try to avoid..

#include <iostream>

in your source code, as this will generally increase the size of your final image very noticeably (due to the code included in the C++ header, along with the references this will also trigger) even if you don't directly use iostream.

Switching to using a simple printf instead will make a massive difference to code size.

Regards,

MCUXpresso IDE Support

1,325 Views
josephjean-jacq
Contributor III

Thank You@LPCX presso support, it turns out removing the "iostream" header file removed all compiling errors. I didn't realize and actually forgot just how big this header file actually is. 

I will also keep in mind to make sure new C++ projects are configured to use NewlibNano. 

Once again, thank you for your help!

0 Kudos