This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TI814X: how to config DSP output Log_print0 to UART

Hi,

I have compiled syslink_2_21_01_05 for TI814X, and test the example "ex01_helloworld". But I cannot get the debug information of DSP Log_print0. How can I config to make it output to the UART?

I have not change the Dsp.cfg, and the current setting is:

-----------------

/* configure System module */
var SysMin = xdc.useModule('xdc.runtime.SysMin');
SysMin.bufSize = 0x1000;
SysMin.flushAtExit = false;

var System = xdc.useModule('xdc.runtime.System');
System.SupportProxy = SysMin;

xdc.useModule('xdc.runtime.Main');
Diags.setMaskMeta(
"xdc.runtime.Main",
Diags.ENTRY | Diags.EXIT | Diags.INFO,
Diags.RUNTIME_ON
);

/* create a logger instance */
var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
var loggerBufP = new LoggerBuf.Params();
loggerBufP.numEntries = 128; /* 128 entries = 4 KB of memory */
loggerBufP.bufType = LoggerBuf.BufType_FIXED;

var appLogger = LoggerBuf.create(loggerBufP);
appLogger.instance.name = "AppLog_Core1";
Defaults.common$.logger = appLogger;

----------------

Any suggestion for the issue?

Thanks,

matt

  • Hi Matt,

    I haven't tried this on TI814X DSP, but I did get Log data from the UART for a Stellaris device.  Here is something
    very simple that you could try out.

    In your config file, use SysMin and LoggerSys.  That way, the Log data will be formatted and dumped into the
    SysMin buffer.  Then you need to set the SysMin output function to your function for dumping characters out
    the UART.  Here is the code you would need in your DSP's .cfg file:

    var SysMin = xdc.useModule('xdc.runtime.SysMin');
    SysMin.outputFxn = '&log2Uart';
    System.SupportProxy = SysMin;

    var LoggerSys = xdc.useModule('xdc.runtime.LoggerSys');
    var LoggerSysParams = new LoggerSys.Params();
    Defaults.common$.logger = LoggerSys.create(LoggerSysParams);

    Then your log2Uart() function can be something like this:

    Void log2Uart(Char *buffer, Int size)
    {
        if (size > 0) {
            /* Write characters to the UART */
        }
    }

    Your output function will be called from System_flush().  This is kind of a hack, since you should use a polling
    write to the UART (otherwise I think you will get an assertion), and System_flush() disables interrupts.  So it is
    not a good idea to call a polling function with interrupts disabled.  However, it would be a quick way to see if you
    can get the Log data out the UART.

    If that works, but you want something less disruptive, you could try using UIA's LoggerIdle, which would call
    a user function to output the Log data during idle time.  The complication with that, is that you may need to format
    the Log data before sending it to the UART.  But we do have an example you could look at here:

    http://processors.wiki.ti.com/index.php/LoggerIdle_Uart

    Best regards,

        Janet



  • Hi, Janet,

    Can I config UIA in the DSP cfg file to make the DSP Log_print0 output the string to ARM side, and then ARM output them to the UART? 

    If yes, how to config it? 

    Thanks,

    matt

  • I don't think there's any premade mechanism for this, but you can log to a LoggerBuf, make a low priority task that copies the logger events to a messageQ, and on the ARM have a low priority task that pull the events out of the messageQ and prints them.   The easiest thing to do is decode the events to strings on the DSP and send the strings to the ARM.   For the least burden on the DSP, you should just copy the raw logger events and let the ARM decode them.  But keep in mind that the logger format is not quite the same as printf's, and any strings used in your logs must be long lived (eg, constants) and in memory accessible by the ARM.  You could take it one step further and have the ARM read the (constant) strings from the DSP program file instead of from DSP memory (so you never have to load the strings into memory), but I'm not sure the IPC library actually supports reading data from elf files.  One other issue you might run into is that a FIXED type LoggerBuf won't be written to once filled, even after you start draining it-- that's not how I expected it to work.

  • There is LoggerSM in the UIA product. It decodes on the DSP (and on the M3s)  the Log strings and places them into shared memory. The contents can then be dump to the linux console on the ARM via a commandline tool (or if you prefer, there is an API set on the Linux side that you can use also). LoggerSM also supports the option of not decoding the strings. On the linux side you can save the contents of shared memory into a binary file and it can be opened in System Analyzer in CCS.

    Todd

  • @ Elron A Yellin, thanks, message Q do works for it.

    @ Janet, @Todd, thanks, I am trying to test the UIA solution.