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.

Trouble with Logging and UIA

Other Parts Discussed in Thread: SYSBIOS, CC2650

I've gone through several forum posts, tutorials, and documents and still seem to have trouble getting a simple Hello World statement to log.

processors.wiki.ti.com/.../SystemAnalyzerTutorial1_(CCSv6)
processors.wiki.ti.com/.../SystemAnalyzerTutorial1A

www.ti.com/.../spruh43f.pdf

In my *.cfg file, I added:

var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
var LoggerStopMode = xdc.useModule('ti.uia.loggers.LoggerStopMode');
var Log = xdc.useModule('xdc.runtime.Log');

and in my source code, I added:
#include <xdc/std.h>
#include <xdc/runtime/Log.h>
....


Log_ing0("Hello World!");

and


int param = 100;

Log_warning1("Hello World!: %d",param1);

....

In my debug session, I go to Tools -> RTOS Analyzer -> Printf and Error Logs. Printf Logs is checked; Stop-Mode JTAG is the transport method.

When I run and halt, I see nothing in the new Live Session or Printf Logs that appear in the Debug view. I can't seem to get over this hump. Any advice?

Thanks,

Greg

  • As an additional note: I'm using a MCU in TI's SimpleLink BTLE CC26XX family. I did not find any instrumentation examples in the TI Resource Explorer. My project appears to build and load to the target fine, but even the standard (non-custom logging) Load Analysis and Execution Graphs do not appear to be working.

    Thanks,
    Greg
  • Hi Greg,

    Could you post your .cfg file?  The problem could be that you have the ROM build enabled.

    Thanks,

        Janet

  • Hi Janet,

    Thank you for the reply. It does appear that ROM is enabled. Here's a snippet (as to not make this thread exceptionally large):

    var ROM = xdc.useModule('ti.sysbios.rom.ROM');
    var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
    ROM.romName = ROM.CC2650;
    ...

    My main goal at the moment would just to monitor some periodic log statements. Would I be able to remove these lines as a temporary work-around?

    Thanks,
    Greg
  • Hi Greg,
    I just took the BIOS hello example and added these lines to the end of hello.cfg:

    var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
    var LoggerStopMode = xdc.useModule('ti.uia.loggers.LoggerStopMode');
    var Log = xdc.useModule('xdc.runtime.Log');

    In main(), I added Log_info0("Hello World!");

    I am able to see the Log_info event in the RTOS analyzer Live Session window.

    If you want BIOS instrumentation, you need to disable the ROM build by commenting out the line in the .cfg file:
    ROM.romName = ROM.CC2650;
    and make sure BIOS logs are enabled:
    BIOS.logsEnabled = true;

    Best regards,
    Janet
  • Hi Janet,

    This definitely seems to have helped as I am now getting output messages on the Live Analysis window. However, I'm still unable to get custom logging strings to print. I'm still looking into this.

    In order to open the Live Analysis, it appears I have to use one of the available options under Tools -> RTOS Analyzer -> ... In my case, Printf and Error Logs. The other options also seem to work however. Is this the proper way to view custom log statements?

    Thanks again,
    Greg
  • Hi Greg,
    Are you seeing the custom log statements in the Live Session window? You should be able to see them there, or using ROV and looking at the LoggerStopMode records for the Main logger.
    Best regards,
    Janet
  • Hi Janet,

    I'm still unable to see custom log statements. I've tried different files, adding the following to the source files:

    #include <xdc/runtime/Log.h>

    ...

    Log_info0("Hello World!");

    The Live Session window is displaying Task_LD_ready events, CtxChg, Task_LD_block events, etc., when halting/hitting a break point, but I am unable to see custom logs. I've attempted to single step to breakpoints before and after the log statements without luck.


    In the ROV window -> LoggerStopMode module, there appears to be records for the Load Logger and SYSBIOS System Logger, but nothing for Main Logger.

    To recap, my .cfg file contains:

    //var ROM = xdc.useModule('ti.sysbios.rom.ROM');

    //ROM.romName = ROM.CC2650;
    var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
    var LoggerStopMode = xdc.useModule('ti.uia.loggers.LoggerStopMode');
    var Log = xdc.useModule('xdc.runtime.Log');
    ...

    BIOS.logsEnabled = true;

    Thanks again for all the input thus far.

    -Greg

  • Hi Greg,

    I wonder if there is something in your .cfg fle that is preventing Main logging.  Can you try this with one of the kernel examples and see if you can get the Log_info() statements to show up there?  I tried this with the Task mutex example, and I am attaching my modified mutex.c and mutex.cfg files so you can compare with yours.

    Best regards,

        Janet

    5633.mutex.c2235.mutex.cfg

  • Hi Janet,

    I will try one of these examples. In addition to this, is there a way to directly send you my .cfg file (as I would prefer not to post it online if possible)?

    Thanks again,
    Greg
  • Hi Greg,
    I don't know of a way to send me the .cfg directly. You could copy everything in your .cfg with "Log" or "Diags" into a file and attach that.
    Best regards,
    Janet
  • Hi Janet,

    Attached is a slimmed down version of my .cfg file. It should have all references to Diag and Log intact. One thing I noticed when viewing my .cfg file with XGCONF is that:
    mainLogging is true
    mainLogger is null

    Is the null parameter correct?

    Thanks again for all the help,

    Greg

    7357.janet.cfg

  • Hi Greg,
    Your cfg code looks like it should work. I copied your settings into my mutex.cfg file and my Log_info() records were showing up in the Live Session View (also in the Main LoggerStopMode logger in ROV).
    It's ok that the main logger is null in XGConf. This just means that you haven't assigned it one, so LoggingSetup will create and assign the Main logger for you.
    Are you building your app inside of CCS? If so, changing the cfg file will cause the configuration step to be re-run when you build the app. If you change your .cfg and build the app without the configuration step being re-run (as sometimes happens if building outside of CCS and makefile dependencies are not right), that could be a problem.

    At this point, I would try adding Log_info() statements to one of the BIOS examples (as I did with the mutex example) and verify that it works. Then compare your source files with the example and try to see what's different.
    Best regards,
    Janet
  • Hi Janet,
    Thank you for all the help and suggestions thus far. This may be a simple question, but am I able to run a BIOS example (such as the mutex project) without physical hardware? I left my development platform at another location and will not be able to retrieve it for a few days. If so, can you point me to some instructions at your convenience?


    Thank you again!

    Greg

  • Hi Janet,

    So some success! I was able to load the mutex example into my CC2650 Dev board and see the "Hello World!" in my ROV and Live Session windows. I didn't use your .cfg file though; I added the relevant lines mentioned earlier in this thread to the default .cfg file.

    I will compare the modules being used and settings and look for the issue.

    Two questions (which may or may not effect my current problem).
    1.) I noticed LoggerBuf in the ROV for the mutex example. Section 5 of the UIA Config manual says that this should be removed (www.ti.com/.../spruh43f.pdf). Which is correct (to keep LoggerBuf or to remove)?
    2.) I'm using a custom board and an older version of tirtos_simplelink. We're using tirtos_simplelink_2_13_00_06; the current revision is tirtos_simplelink_2_14_03_28. Could this also be an issue?

    Thanks again for the help,
    Greg

  • Hi Greg,

    To answer the question in your previous post, I don't know how to run these examples without hardware.  I think CCS has dropped support for simulators.

    The LoggerBuf could be the problem, for example, if you have code like this in your .cfg file:

    var loggerBufParams = new LoggerBuf.Params();
    loggerBufParams.numEntries = 32;
    var logger0 = LoggerBuf.create(loggerBufParams);
    Defaults.common$.logger = logger0;

    You could check this by looking at LoggerBuf in ROV and see if your Log_info statements went there.

    I don't think having to older version of TI-RTOS would be the issue, since they come with the same version of UIA.

    Hopefully, it is just having LoggerBuf as your default logger that is the problem.

    Best regards,

        Janet

  • Hi Janet,


    I'll give this one more go. My current .cfg file (now attached to this post) doesn't include LoggerBuf. I tried adding LoggerBuf to see if it altered my results, similar to the mutex example, but with no luck. It appears that SYSBIOS System Logger is logging data, but Main Logger is still not displaying data on my custom project.

    I've tried running the project in a fresh workspace with no luck.

    If you see any issues with my .cfg file, please let me know. Otherwise, I'll flag your previous post as the answer.

    Thank you again for the help.

    -Greg

  • Hi Greg,
    I took most of your .cfg and used it in my mutex example, and I am seeing Log_info() statements in the RTOS Analyzer Live Session. I had to change the Power configuration because I am building with a newer version of TI-RTOS. So I think there is nothing wrong with your .cfg file. What about the source files where you call Log_info()? Can you try putting a Log_info() in main() and see if that shows up?
    Thanks,
    Janet
  • Hi Janet,

    I tried moving:
    Log_info0("Hello World!");

    into the main() loop and added:
    #include <xdc/runtime/Log.h>

    Everything compiles and flashes fine. But only the SYSBIOS System Logger shows up with log statements. The Main Logger doesn't register any records in ROV or Live Session.

    -Greg
  • Hi Greg,
    One more thing to try: Can you load your program and bring up ROV, and open the xdc.runtime.Diags view in ROV. Then select "Main" in the "Diags Mask" tab. Do you see the USER* and INFO set to RUNTIME_ON?
    Thanks,
    Janet
  • HI Janet,

    It does appear that USER1-6 are RUNTIME_ON as well as INFO.
    ANALYSIS and STATUS are also RUNTIME_ON.
    ENTRY, EXIT, LIFECYCLE, INTERNAL, and ASSERT are ALWAYS_OFF.

    -Greg
  • Hi Greg,
    That looks as it should then, so I really don't know why you wouldn't be getting the Log_info() statements from your source files. You might try removing (e.g. by #if 0 'ing out) large sections of your program, until you can hopefully get Log_info() to work. Then slowly add your code back in to find what is causing it to stop working. You could also take the empty TI-RTOS example, add LoggingSetup and some Log_info() statements. If that works, then slowly merge your code into that and try to find the point at which Log_info() no longer works. Hopefully that will locate the source of the problem.
    Best regards,
    Janet
  • Hi Janet,


    Thank you again for all the support. I will disable portions of the source code and see if that isolates the problem and let future users know if I come across anything obvious.


    Thank you again!

    -Greg

  • Ok, good luck!  I am really curious as to why this isn't working.

    Best regards,

        Janet