How does stdout work with the debugger?

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

How does stdout work with the debugger?

Jump to solution
2,261 Views
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.

Labels (1)
0 Kudos
Reply
1 Solution
2,152 Views
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

View solution in original post

0 Kudos
Reply
3 Replies
2,153 Views
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 Kudos
Reply
2,152 Views
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 Kudos
Reply
2,152 Views
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 Kudos
Reply