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.

TMS320C6455: Using DSP/BIOS (5.42) LOG module

Part Number: TMS320C6455

I have some questions on how to utilize this module.

1. How do I enable the log? I have:

#include <log.h>

LOG_Handle log;

LOG_enable(log);  // This does not seem to compile.

2. When I write with LOG_event(log, 0x01, 0x02, 0x03); Will I be able to see these values if I point to LOG_system$buf and write the values? 

3. If I restart the DSP without a power cycle, will this data still be there?

Thanks.

  • Requesting move from C67x Single Core DSP Forum to TI-RTOS Forum for best support. -RandyP
  • David,
    you have to create a LOG object to be able to use it, and you usually create it in your TCF script. Something like this:
    var myLog = bios.LOG.create("myLog");
    Then, in your C code you would enable it and write to it:
    extern FAR LOG_Obj trace;

    LOG_enable(&myLog);
    LOG_event(&myLog, 0x01, 0x02, 0x03);

    You will have then myLog$buf, and you can inspect it, but if you are using CCS you should be able to see the output on the console and also in RTA Control Panel.

    For 3., I'll have to ask around. I am assuming you are using the debugger in CCS, and I am not sure if CCS zeroes memory and under which conditions.
  • David Boles said:

    1. How do I enable the log? I have:

    #include <log.h>

    LOG_Handle log;

    LOG_enable(log);  // This does not seem to compile.

    What is your compile error?

    LOG_enable() is a macro that is #defined in log.h.

    Have you created your LOG in your .tcf file?

    /* Create and initialize a LOG object */
    var log;
    log= bios.LOG.create("log");
    log.bufLen = 1024;
    log.logType = "circular";
     
    You can then use the following in your application:
    LOG_printf(&log, "Hello World!");

    The following documents are helpful:

    DSP/BIOS TConf User's Guide, Page 15, 

    DSP/BIOS C6x API Reference, Page 212

    David Boles said:
    2. When I write with LOG_event(log, 0x01, 0x02, 0x03); Will I be able to see these values if I point to LOG_system$buf and write the values?

    LOG_system is the LOG used by DSP/BIOS to log events for the kernel.  That assembly symbol LOG_system$buf is the buffer used for LOG_system (also known as LOG_D_system).

    If you want to inspect your 'log' LOG buffer, then log$buf should be available (again, just an assembly symbol, not available in C).  But you should also be able to do
        log->bufbeg
    in C to get the same thing.  If viewing memory, 'bufbeg' is the 6th 32-bit word in the LOG_Obj structure, so pointing a memory window at 'log', look for the 6th word after the 'log' address, this will point to your LOG_Obj's buffer.

    David Boles said:
    3. If I restart the DSP without a power cycle, will this data still be there?

    Probably, but it depends on what you mean by 'restart'.  The CCS "Run->Restart" option might invoke some "onRestart" GEL functionality, but I doubt that functionality would clear memory.

    It also depends on where your log memory is, since different memory types have different behavior when resetting a CPU or device.

    I would say there is a good chance your data will still be there, but I would suggest just trying it out and seeing for yourself.

    Regards,

    - Rob

  • I change the line: extern FAR LOG_Obj trace to extern LOG_Obj myLog; and it now compiles. Thanks.