Tool/software: TI-RTOS
Dear,
my BLE application has several tasks, all working fine concurrently.
Now, I create a new one to be executed every some time, with this code inside its _taskfxn():
#if 0 GPTimerCC26XX_Params params; GPTimerCC26XX_Params_init(¶ms); params.width = GPT_CONFIG_16BIT; params.mode = GPT_MODE_PERIODIC_UP; params.debugStallMode = GPTimerCC26XX_DEBUG_STALL_OFF; ti_td_minion = GPTimerCC26XX_open(CC26X2R1_LAUNCHXL_GPTIMER0A, ¶ms); if(ti_td_minion == NULL) { Log_error0("Failed to open GPTimer"); Task_exit(); } Types_FreqHz freq; BIOS_getCpuFreq(&freq); GPTimerCC26XX_Value loadVal = freq.lo / 1000 - 1; // 47999 GPTimerCC26XX_setLoadValue(ti_td_minion, loadVal); GPTimerCC26XX_registerInterrupt(ti_td_minion, TDMinion_ti_fxn, GPT_INT_TIMEOUT); GPTimerCC26XX_start(ti_td_minion); #endif #if 1 Error_init(&eb_td_minion); Timer_Params timerParams; Timer_Params_init(&timerParams); timerParams.period = 50000 * 1000; timerParams.periodType = Timer_PeriodType_MICROSECS; timerParams.startMode = Timer_StartMode_USER; timerParams.runMode = Timer_RunMode_CONTINUOUS; ti_td_minion = Timer_create(Timer_ANY, my_isr, &timerParams, &eb_td_minion); if (ti_td_minion == NULL) { System_abort("***ERROR*** >> ti_td_minion CREATE FAILED"); }
First approach works. Second one, however, leads me always to the System_abort line. my_isr() is
void my_isr(xdc_UArg arg1) { Log_info0("my_isr()"); }
I discard first approach based on GPTimer because according to the documentation "The device will only go to Idle power mode since the high-frequency clock is needed for timer operation".
So, my question is twofold, well threefold:
- For the second approach, I suspect it does not work because Timer API tries to use RTC, needed by BLE stack. Am I right? If so, why such approach is not picking, for example, TimerA, since I indicate Timer_ANY?
- For the first approach, having a timer like this on during all the time, it would prevent my BLE code going to low power mode, am I right?
- So, the remaining possibility would be using Clocks API as in the simple_ble_peripheral example?
So, let's see if I can understand better this with your help.
Have a really nice day.