Capturing output to PC application
MDK-ARM, uVision 3.4:
I am looking for a way that a custom PC test app can directly control
uVision so that it can open a project, build it, run it under the
debugger, and capture any output from the running app. Preferrably
the method would work for both simulator and target debugging.
Ignoring the control aspect for now, what methods exist to capture
the output of a running embedded app?
A) The first method I see would be for the embedded app to print
to a uart, and have a serial cable connected from the target back to
the PC host. This would do the job but it does require a target
board, a serial cable, and a free com port on both. It only works for
B) A simulator version of this would use the assign command to
redirect the debugger's serial window output to a host PC com port. I
think in this configuration the output of the embedded app goes OUT
of the PC com port. This would mean that to capture that output you
would need to loop back that com port to a 2nd PC com port or find
some wedge driver to intercept it on the host.
C) The most promising method would be to use the RT Agent feature
which uses the ULink connection. This seems attractive since its
fast, it works the same for target and simulator debugging, and
doesn't tie up any serial ports. I think it also has minimal
performance impact on the target app.
I tried using the LPC23xx Blinky demo modified for RT Agent and it
worked great. When entering debug an RT Agent terminal window opens
automatically, and the code can use RTA_printf() to send output to
this terminal. When I tried modifying one of my own LPC2478 apps for
RT Agent I ran into some problems. Although I got my code to compile,
I found I needed to select MicroLIB or the app would hang before it
reached main(). I could see it was trying to print "SIGRTMEM: Out of
heap memory". I don't plan on using MicroLIB so thats one problem to
be solved. Using MicroLIB, main() is reached but the RT Agent
terminal never opens, and I don't see any way of manually opening
this window to see if any output gets there.
Any info on this?
Assuming I can solve the first two problems, how do I
capture/redirect the RT Agent window output to my PC app? Preferrably
this would not use serial ports.