Home/Support/Support Forum/printf via JTAG?
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

printf via JTAG?

0 votes
Is it possible to use something like printf via JTAG? (For debugging/trace messages that are normally send via a serial port)

Or do I need to sacrifice one serial port for that purpose?
asked May 30, 2007 in NET+OS by compie Community Contributor (55 points)
recategorized Dec 18, 2013 by tuxembb

Please log in or register to answer this question.

4 Answers

0 votes
Outside of stepping through your code printing out variables, etc, I'm not sure of a way.

However, if you don't want to sacrifice a serial port you can use the UDP device for printfs. I.E. switch the output for STDIO to /udpdb/0 (found in /src/bsp/platforms/(platform)/devices.c) and use the udpdb command line application found in /bin/ and run from the GNU shell.
answered May 30, 2007 by charliek Veteran of the Digi Community (408 points)
0 votes
Hi Johan,

We are working to implement standard I/O over JTAG for the NET+OS version 7.3. It is a frequent request to not require the serial port for this, and we are working to solve this. I don't have a firm date for this feature, but I would expect it to be available in fall 2007.

Thanks for your interest in NET+OS.

Best regards,

John Leier
Digi International
answered Jun 10, 2007 by johnleier New to the Community (19 points)
0 votes
Any progress on this?
I am using a 9P 9215 with Net+OS 7.3 and the development board. I am attempting to run the A to D Converter example. The thing about the sample is it states that the A/D uses the same interrupt as Serial Port D. This is the port that the serial console port uses so all the printf's in the example don't come out. Sort of make the sample ineffective. I have been looking for a method to have the printf directed to a different port on the dev board but haven't had luck yet. This would work for me although the JTAG "printf" debug would be great.
answered Oct 2, 2008 by alevine New to the Community (22 points)
0 votes
Okay I found half the answer (elsewhere on the forum).
To move the Serial Console from port D to port B on the development board add the following #define to appconf.h:

#define APP_STDIO_PORT "/com/1"

Make sure that in bsp_serial.h the following is defined for PORTB:
#define BSP_SERIAL_PORT_2 BSP_SERIAL_UART_DRIVER


It would still nice to have debug messages/printf through the jtag.

Digi sure doesn't make this stuff easy:)
answered Oct 2, 2008 by alevine New to the Community (22 points)
...