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.

Getting Log_info0, Log_warning0 and assertion in my code

Other Parts Discussed in Thread: CC2650, SYSBIOS

I'm developping code under cc6 with CC2650.

I'm getting in my workbench  system printf from :

System_printf("In main!\r\n");

But I do not manage to get these ones :

Log_info0("hello world"); /** called from my application code */
Log_warning1("SPI:(%p) already in use.", hwAttrs->baseAddr); /** called in SPI driver */

Here are my precompiler defines about logs :

xdc_runtime_Assert_DISABLE_ALL_DISABLE
xdc_runtime_Log_DISABLE_ALL_DISABLE
xdc_runtime_Log_ENABLE_ERROR
xdc_runtime_Log_ENABLE_WARNING
xdc_runtime_Log_ENABLE_INFO


I've tried many rtsc configuration in my .cfg fille...

var Defaults = xdc.useModule('xdc.runtime.Defaults');
var Types = xdc.useModule('xdc.runtime.Types');
var Diags = xdc.useModule('xdc.runtime.Diags');
var Error = xdc.useModule('xdc.runtime.Error');
var Log = xdc.useModule("xdc.runtime.Log");
var Main = xdc.useModule('xdc.runtime.Main');

.....

/* logs to workbench */
var SysStd = xdc.useModule('xdc.runtime.SysStd');
System.SupportProxy = SysStd;

/* Uart printout */
/*var Idle = xdc.useModule('ti.sysbios.knl.Idle');
Idle.addFunc('&uartPrintf_flush');
SysCallback.putchFxn = "&uartPrintf_putch";*/
Defaults.common$.diags_INTERNAL = Diags.ALWAYS_ON;
Main.common$.diags_ASSERT = Diags.ALWAYS_ON;
Main.common$.diags_INTERNAL = Diags.ALWAYS_ON;
//Main.common$.diags_USER1 = Diags.ALWAYS_ON;
//Main.common$.diags_USER2 = Diags.ALWAYS_ON;
//Main.common$.diags_USER3 = Diags.ALWAYS_ON;
//Main.common$.diags_USER4 = Diags.ALWAYS_ON;
//Main.common$.diags_USER5 = Diags.ALWAYS_ON;
//Main.common$.diags_USER6 = Diags.ALWAYS_ON;
//Main.common$.diags_INFO = Diags.ALWAYS_ON;
Main.common$.diags_INFO = Diags.ALWAYS_ON;
Main.common$.diags_STATUS = Diags.ALWAYS_ON;

/* Main.common$.logger = null; */
//Task.common$.diags_INFO = Diags.ALWAYS_ON;
//Task.common$.diags_STATUS = Diags.ALWAYS_ON;

/* use the LoggerSys ILogger service provider */
//var Logger = xdc.useModule("xdc.runtime.LoggerSys");
 
/* create and bind a logger for all non-module code */
//Main.common$.logger = Logger.create();

without any success. How can I enable these logs?

Moreover, if I need to use assertion in non-XDC modules. What should I use? What configuration?

Lah

  • Did you look in the ROV plugin for your Log prints? These do not come on the console output but instead are displayed in the ROV plugin in CCS.
  • Ok, I thought logs were displayed in console window like :

      System_printf("In main!\r\n");
    

    Where are ROV plugins logs print? I searched in ROV window. After I found it in CCSV6 Tools -> RTOS Analyzer -> Printf and Error logs. I got an error message complaining about missing UIA file. So I added in .cfg file :

    var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');

    After my target did not build... not enough Flash event with size optimizations... I commented some code and got logs in ROV Live Session window :

    Now I get my logs but as logging increases code size, I cannot use it in my application.

    • How can I get RTOS logs and add a minimal extra code to my application?
    • Is it possible to forward RTOS logs to system logs (output on console workbench)?

    Lah

  • You cannot forward log output to console window. BTW, doing something like a System_printf breaks realtime since the cpu has to halt in order for the output to be sent to the console so keep that in mind.

    In the Bios_User_Guide.pdf (SYSBIOS) or Users_Guide.pdf (TIRTOS), there is a section called Minimizing Application Footprint. I would try those suggestions first. You might not be able to take advantage of all of those optimizations but some stuff should apply.