How to use std::cin/cout along with fsl_debug_console?

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

How to use std::cin/cout along with fsl_debug_console?

Jump to solution
1,516 Views
surrealist
Contributor II

Hi forum,

I'm new to MCUXpresso 11.5.1 and the SDK 2.8.0.  I'm using a FRDM-K82F, and have an example that I am trying to run written in C++.  A similar C example was able to write to and read from the fsl_debug_console using PRINTF and SCANF.

If I use PRINTF("something\n\r"), from my C++ application, I can see output in the Terminal view.

However, if I use std::cout, I don't see anything.  Can anyone provide guidance on how to use std::cout and std::cin alongside or instead of the fsl_debug_console?

As an aside:  How can I step into/step over disassembly window content?  In other Eclipse IDEs, I have seen separate buttons for instruction step into/step over, but I can't seem to find it in MCUXpresso.

Thanks for your help!

0 Kudos
1 Solution
3 Replies
1,509 Views
jingpan
NXP TechSupport
NXP TechSupport
0 Kudos
1,514 Views
surrealist
Contributor II

I should mention that I'm currently using NewlibNano (nohost) for my C++ library.  I had also tried using full Newlib, but building a simple application it seems to run out of Flash!  Ouch.

Thanks again for any help.

0 Kudos
1,482 Views
surrealist
Contributor II

Although I got cin and cout to work with newlib-nano, I strongly advise against it.  Bringing in <iostream> causing a huge increase in the amount of Flash required.  On a Kinetis K82, a simple cin/cout example used nearly 70% of the available 256KB of Flash.  When replaced with PRINTF() and SCANF(), that dropped to around 10%.

0 Kudos