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.

AM3358: Unable to create timer instance using Timer_create() TI RTOS

Part Number: AM3358
Other Parts Discussed in Thread: SYSBIOS

Hi,

      We are working on Beagle bone black and trying to create a timer using Timer_create(), but the call gets blocked and the program counter never comes out of this call, while debugging step by step.

This is the code snippet that we used:

*********************************

void timer0Initialize(void)
{
Error_init(&eb);
CONSOLEUtilsPrintf("Initializing timer 0!!\n");
Timer_Params_init(&timerParams);
/* Timer period is loaded with 52 uSec */
timer0ISRtime(52);
timerParams.period = timerDelay;
timerParams.extFreq.hi = 0;
timerParams.extFreq.lo = 24000000; // BBB xtal freq
timerParams.periodType = Timer_PeriodType_MICROSECS;
timerParams.startMode = Timer_StartMode_USER;
timerParams.runMode = Timer_RunMode_CONTINUOUS;
timerParams.arg = 1;

CONSOLEUtilsPrintf("Creating timer and installing ISR\n");

/* Create and enable timer interrupt */
timer0 = Timer_create(2, timer0ISR, &timerParams, &eb);
if (timer0 == NULL)
{
CONSOLEUtilsPrintf("Timer create failed: %s", eb.msg);
System_abort("Timer create failed");
}
CONSOLEUtilsPrintf("Timer initialization completed\n");
}

**************************************

This is the content of our cfg file:

************************************

var Defaults = xdc.useModule('xdc.runtime.Defaults');
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 SysMin = xdc.useModule('xdc.runtime.SysMin');
var System = xdc.useModule('xdc.runtime.System');
var Text = xdc.useModule('xdc.runtime.Text');
var Clock = xdc.useModule('ti.sysbios.knl.Clock');
var Swi = xdc.useModule('ti.sysbios.knl.Swi');
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 Timer = xdc.useModule('ti.sysbios.hal.Timer');
var Timer = xdc.useModule('ti.sysbios.timers.dmtimer.Timer')
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');

**********************************

As it can be observed we are using DM timers.

The same code worked previously, however now this code suddenly stopped working.

Please let us know why Timer_create() call is blocking and how to use timer instance 2 for timing purpose.

Thanks.