How to printf() to the PC through J-Link debugger?

Colleagues,

Is it possible to printf() to the PC through J-Link debugger? If so, what has to be done to configure it? If somebody could post an example, that would be awesome.

Thanks,

  • Nick

With the IAR tools, I did read that this is possible. I’ve not done it. As I recall you setup a linker file with the right config and libraries.

Don’t know how with other IDEs.

stevech:
With the IAR tools, I did read that this is possible.

GettingStarted project for LPC2378, which comes with IAR Embedded Workbench (EWARM), is configured so that printf() goes to J-Link the output appears in the Terminal I/O window within EWARM. To open click on the menu View -> Terminal I/O.

Still, it would be interesting to know how to configure this feature in a scratch-made project.

I guess C++ stream framework can support multiple different streams. E.g. UART, debug output through J-Link, I2C (provided addressing is taken care of).

  • Nick

UPDATE: printf() through J-Link appears to be fairly slow.

kender:
Still, it would be interesting to know how to configure this feature in a scratch-made project.

for writing to the Terminal I/O window the DCC is used.

Search for DCC in the J-Link or EWARM manual.

regards

gerhard

I have occasionally used the DCC for debugging purposes, but not specifically stdio stream direction. You may get what you want through a more simple usage, as documented in IAR’s website:

http://iar.com/website1/1.0.1.0/708/1/

ftsolutions:
I have occasionally used the DCC for debugging purposes, but not specifically stdio stream direction. You may get what you want through a more simple usage, as documented in IAR’s website:

http://iar.com/website1/1.0.1.0/708/1/

this document only describes how to realize live watch (which also uses dcc).

for output to terminal i/o take a look ath the ewarm user guide, chapter “TERMINAL I/O AND USE OF DCC”.

regards

gerhard