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.

UIA Logging (Log_info() calls) not working for CC2650 LaunchPad

Other Parts Discussed in Thread: CC2650

I'm trying to see these user printed Log events but they aren't showing up. Other UIA tools work (Execution/Load Analysis display correctly) but Log_infoX() events do not. When the program is suspended, the "Live Modules" tab only shows events from other sources and not my Log events. I also don't see anything in ROV -> Viewable Modules -> LoggerStopMode -> MainLogger which I believe is supposed to show me these Log statements.

I'm I'm using a CC2650 LaunchPad and the TrainingTag application from the simplelink academy tutorials (Although I have tried this with SimpleBLEPeripheral and it doesn't work either). I wasn't sure if this is a problem specific to cc2650 or to rtos so I decided to post here.

Here is my .cfg file:

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

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 Main = xdc.useModule('xdc.runtime.Main');
var Memory = xdc.useModule('xdc.runtime.Memory')
var SysCallback = xdc.useModule('xdc.runtime.SysCallback');
var System = xdc.useModule('xdc.runtime.System');
var Text = xdc.useModule('xdc.runtime.Text');
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
var Reset = xdc.useModule('xdc.runtime.Reset');
var BIOS = xdc.useModule('ti.sysbios.BIOS');
var Clock = xdc.useModule('ti.sysbios.knl.Clock');
var Task = xdc.useModule('ti.sysbios.knl.Task');

var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
var M3Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi');
var Power = xdc.useModule('ti.sysbios.family.arm.cc26xx.Power');

/* Enable idle task (default). */
Task.enableIdleTask = true;

/* Idle CPU when threads blocked waiting for an interrupt */
Power.idle = true;
Power.policyFunc = Power.standbyPolicy;

/* compile out all Assert's */
Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF;

/* Don't load string names of modules on the target */
Defaults.common$.namedModule = false;

/* Allow Mod_create() and Mod_construct() but not delete() or destruct() */
Defaults.common$.memoryPolicy = Types.CREATE_POLICY;

/* Don't load diagnostic/descriptive text strings on the target */
Text.isLoaded = false;

/* Use the minimal user-supplied callback provider */
System.SupportProxy = SysCallback;
/* no exit handlers needed */
System.maxAtexitHandlers = 0;

/* main() and Hwi, Swi stack size */
Program.stack = 1024;
/* no command-line arguments main(argc, argv) needed */
Program.argSize = 0;

/* build a custom, optimized version of SYS/BIOS */
BIOS.libType = BIOS.LibType_Custom;

/* no logging - all compiled out */
BIOS.logsEnabled = true;

/* disable Asserts in SYS/BIOS code */
BIOS.assertsEnabled = false;

/* Reduce number of Task priority levels to save RAM */
Task.numPriorities = 6;

/* Set the default Task stack size - used if one is not specified */
Task.defaultStackSize = 512;

/* Don't check stacks for overflow - saves cycles (and power) and Flash */
Task.checkStackFlag = false;

/* Disable exception handling to save Flash - undo during active development */
M3Hwi.enableException = true;
M3Hwi.excHandlerFunc = null; /* null = default while loop function. Use e.g. "&myFxn" to use your own function. */
M3Hwi.nvicCCR.UNALIGN_TRP = 0;
M3Hwi.nvicCCR.DIV_0_TRP = 0;

/* Don't check for interrupt stack overflow during Idle loop */
Hwi.checkStackFlag = false;

/* Minimize Flash and RAM usage of Error module */
Error.raiseHook = null; /* null = default while loop function. Use e.g. "&myFxn" to your own handler function. */
Error.maxDepth = 2;

/* Set the default CPU frequency */
BIOS.cpuFreq.lo = 48000000;

/* Put reset vector at start of Flash */
M3Hwi.resetVectorAddress  = 0x0;

/* Put interrupt vector at start of RAM so interrupts can be configured at runtime */
M3Hwi.vectorTableAddress  = 0x20000000;

/* CC2650 has 50 interrupts */
M3Hwi.NUM_INTERRUPTS = 50;

/* Set heap size */
BIOS.heapSize = 1668;

var Swi = xdc.useModule('ti.sysbios.knl.Swi');
Swi.numPriorities = 6;
BIOS.swiEnabled = true;

BIOS.includeXdcRuntime = true;

/* Tasks cannot pend based on priority */
Semaphore.supportsPriority = false;

/* Change default error function -- just spin */
Error.policyFxn = Error.policySpin;

/* true:  Allow runtime creation of e.g. semaphores
 * false: Compile out reference to Memory in BIOS */
BIOS.runtimeCreatesEnabled = true;

/* Abort and exit functions -- just spin */
System.abortFxn = System.abortSpin;
System.exitFxn = System.exitSpin;

/* CC26xx Boot module */
var Boot = xdc.useModule('ti.sysbios.family.arm.cc26xx.Boot');
Boot.driverlibVersion = 2;
Boot.customerConfig = false;
//Boot.checkBackdoor = false;

/* Turn on RCOSC_HF calibration, thus enabling fast startup */
Power.calibrateRCOSC = true;
//Power.calibrateRCOSC = false;

/* 10 us tick period */
Clock.tickPeriod = 10;


LoggingSetup.sysbiosTaskLogging = true;
LoggingSetup.loadLogging = false;

From the original simpleBLEPeripheral/trainingTag .cfg file (they're both the same) I went to LoggingSetup -> Checked Add LoggingSetup to my Configuration -> made sure "Error, Warning, Info, and Print events" was checked, and went to BIOS -> Runtime -> Checked "Enable Logs". I believe the lines below were the only changes that resulted ( as well as commenting out the ROM lines ) :

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

/* no logging - all compiled out */
BIOS.logsEnabled = true;

LoggingSetup.sysbiosTaskLogging = true;
LoggingSetup.loadLogging = false;

Am I misunderstanding something? Any idea as to what I should do to get this working?

  • Hi Nathan,

    Getting a full logger to fit into an application with the BLE stack is tricky.
    One thing to check is that most of our examples use the compiler define xdc_runtime_Log_DISABLE_ALL. In order for logging to work, you must not define this symbol (delete it). Have you tried this.

    In any case, I recommend taking a look at our UART logger implementation that is currently hosted on our Github page, as it is fairly light and has been tested with example apps such as simple peripheral.

    github.com/.../ble-sdk-210-extra
  • Hi Sean,

    Deleting that define worked, thank you. It seems to be working fine at the moment, is there any specific reason to switch over to the UART Logger?

    Nathan
  • Hi Sean,
    I am also facing similar issue. I am using CC2650 sensortag code with BLE stack. I deleted the macro xdcruntime_LOG_DISABLE_ALL and also added in appBLE.cfg file with LoggingSetup -> Checked Add LoggingSetup to my Configuration -> made sure "Error, Warning, Info, and Print events" were all checked. I tried enabling BIOS -> Runtime -> Checked "Enable Logs", but it gives error saying for ROM configuration the Logs should be disabled. so i could not do this step. Now when i run sensortagApp (in which i have only enabled IR temperature code ""SensorTagTmp_createTask") in which added Log_info2() to dump localtemp and target teperature. I dont see these data coming in Live session nor in printf_logs also. Also i am suspecting UIA is not working fine , as other CPUload analysis, task analysis etc are also coming. Any inputs to help me in this direction will help.
    please reply.