printf on consol

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

printf on consol

641 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpc1857 on Thu Jan 03 02:19:30 MST 2013
hi
i have used LPCXpresso v4.3.0 IDE and for debugging i have use RedProbe+ jtag debugger.In project i have enabled the Semihosting option.when debug season start "Semihosting enabled"  briefly displayed in the IDE status bar (bottom left of window), as the image load to the target completes. but "printf" not display output on console.

so how to enable printf on console?
0 Kudos
6 Replies

482 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpc1857 on Fri Jan 04 02:33:45 MST 2013
I have use LPC1857(Cortex M3) board.

I have simply created C project for tageting lpc1857 MCU and then enable semihosting from properties and debug configuration.Also included in "stdio.h" header file in main.c file which call many "printf".

But there is no luck.still it not work.

I have attached map file.
0 Kudos

482 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Thu Jan 03 09:15:45 MST 2013
Yes printf() is supported.

Which MCU are you targeting? And are you trying to create a new semihosting project using the project wizard, or are you trying to modify an existing project to use printf()?

One issue we have seen a couple of time in the past is that some of NXP's examples for "older" MCUs contain an old version of the standard startup code which is not compatible with LPCXpresso 4's semihosting libraries.

Using the "sticky search thread" at the top of the forum to search for something like "printf not working" should pull up a few such cases:

http://knowledgebase.nxp.com/showthread.php?t=2182

But this problem is easily fixed by copying in the startup code from a new project created by the project wizard.

Also, double check that you have actually added the line:

#include <stdio.h>

to any files that are calling printf().

If you are still having problems, I suggest that you export your project and attach it to the thread - or as a minimum attach the map file generated by the linker.

Regards,
CodeRedSupport
0 Kudos

482 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpc1857 on Thu Jan 03 03:35:20 MST 2013
platform is Window XP.

is printf utility not supported on LPCXpresso v4.3.0?
0 Kudos

482 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Thu Jan 03 03:08:45 MST 2013
Which host are you using (Windows, Linux, OSX).

Also, are you aware that LPCXpresso 5 has been released?
0 Kudos

482 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpc1857 on Thu Jan 03 02:53:15 MST 2013

Quote: Rob65
Which libraries are you using ?
Rob



i have use "Redlib (semihost).

I have compiled the code in debug mode.
0 Kudos

482 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Thu Jan 03 02:37:34 MST 2013
Which libraries are you using ?
This should be something like "Newlib (semihost)" or "Redlib (semihost).
And I think (never tried this though) this only works when compiling in debug mode (since in release mode you normally have no jtag pod connected).

Rob
0 Kudos