|Logging via UART [message #1022581]
||Fri, 22 March 2013 07:00
| Naoki Kawada
Registered: January 2012
I want to use Log interface to display real time logs via UART.
I have created an UART-PRUSS driver for OMAPL platform in order to realize background log streaming via UART.
And I configured cfg file to hook "flush" function :
var Log = xdc.useModule('xdc.runtime.Log');
var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
var SysMin = xdc.useModule('xdc.runtime.SysMin');
var System = xdc.useModule('xdc.runtime.System');
var Main = xdc.useModule('xdc.runtime.Main');
/* Create LoggerBuf instance and bind it to Default */
LoggerBuf.TimestampProxy = xdc.useModule('xdc.runtime.Timestamp');
LoggerBuf.enableFlush = true;
var LoggerBufParams = new LoggerBuf.Params;
var logger0 = LoggerBuf.create(LoggerBufParams);
Defaults.common$.logger = logger0;
/* Enable USER1 diags in Main module */
Main.common$.diags_USER1 = Diags.ALWAYS_ON;
/* Hook for Flush logs */
System.SupportProxy = SysMin;
SysMin.outputFxn = "&PRUSS_UARTDVR_put"; /* This is my UART-PRUSS driver code */
And then, Log_print in Application :
With this code, the control did not come to PRUSS_UARTDVR_put()...
Could you please suggest me what is wrong in my code ?
|Re: Logging via UART [message #1028057 is a reply to message #1024250]
||Wed, 27 March 2013 19:39
| Sasha Slijepcevic
Registered: July 2009
the System provider you are using is SysMin, and it maintains a buffer whose default size is 1024 bytes. If you print more than 1024 characters before calling System_flush(), the oldest characters that weren't printed yet will be overwritten. You can configure the buffer size to be large enough so that the buffer doesn't get filled up between executions of the Idle thread. Depending how much you care about memory consumption and the completeness of the output, you can decrease or increase the buffer size.
If you have to have both, low memory usage and the complete output, you'll have to call System_flush after each Log_print.
[Updated on: Wed, 27 March 2013 19:41]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.02143 seconds