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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
2,146 次查看
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 项奖励
回复
1 解答
2,138 次查看
jingpan
NXP TechSupport
NXP TechSupport
0 项奖励
回复
3 回复数
2,139 次查看
jingpan
NXP TechSupport
NXP TechSupport
0 项奖励
回复
2,144 次查看
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 项奖励
回复
2,112 次查看
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 项奖励
回复