How does stdout work with the debugger?

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

How does stdout work with the debugger?

跳至解决方案
1,809 次查看
larry1
Contributor II

Working with CLEV6630B, using LPC-link2 as a debug probe, I have lost the ability to see printf and other stdout traffic in the debug console.  When I first loaded my project last month, I saw printf output in that window.  It got less reliable during that session. Now a few weeks later, it is not working at all.  The breakpoint after the printf hits when I place or remove a tag from the antenna.  But nothing comes up in the display.  See the attached screenshot.

So my question is, where can I look to see how that is supposed to work, so I can troubleshoot it?  I tried stepping into printf and it just skipped over. 

My project is built from NFC Reader Library, Basic Discovery Loop. Other open projects are DAL, FreeRTOS, lpc_board_nxp_lpcxpresso_1769, lpc_chip_175x_6x and NxpNfcRdLib.  I have commented out all my changes and cannot get back to the earlier behavior.

标签 (1)
0 项奖励
回复
1 解答
1,700 次查看
ErichStyger
Specialist I

To have 'printf' passed through to the debugger, you need to have a library using semihosting:

pastedImage_1.png

Are you using one of the semihost variants?

I hope this helps,

Erich

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,701 次查看
ErichStyger
Specialist I

To have 'printf' passed through to the debugger, you need to have a library using semihosting:

pastedImage_1.png

Are you using one of the semihost variants?

I hope this helps,

Erich

0 项奖励
回复
1,700 次查看
larry1
Contributor II

I marked Erich's answer correct.  I am still having trouble, but he told me the key word "semihosting". 

What is semihosting?

Other Community articles chasing the same problem led me to Redlink:

Why did printf() stop working?

LPC54S608J512 and MCUXpresso 10.1.0 589 - Debug wont launch "Awaiting telnet connection to port 3330...

To me, the key is redlinkserv.exe in c:/nxp/MCUXpressoIDE_11.0.1_2563/ide/plugins/com.nxp.mcuxpresso.tools.bin.win32_11.0.1.201908271452/binaries

That program manages the USB link to the targets and provides a loopback telnet connection on port 3025 by default.  It can be blocked by firewalls, crash, all the usual risks.  The IDE has two buttons for Redlink and the first choice of Consoles is Redlink.

Maybe this is all too simple for the established NXP ARM developers, but I had no idea how things were working before.

Thanks.

0 项奖励
回复
1,700 次查看
larry1
Contributor II

Erich, thank you for the keyword "semihosting."  I will look into that.

The NFC Reader Library examples use Redlib (semihost) at the top levels. Lower levels like lpc_chip_175x_6x have empty Libraries folders.

untitled.png

0 项奖励
回复