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.

CC2650 Timer

Other Parts Discussed in Thread: CC2650, SYSBIOS

Hi,

I am using sample code SimpleBLEBroadcaster for developing BLE applications in CC2650. When I tried to add a timer to the project,

I am getting the following errors:

undefined first referenced
symbol in file
--------- ----------------
ti_sysbios_hal_Timer_Params__init__S <whole-program>
ti_sysbios_hal_Timer_create <whole-program>

I have added the header #include <ti/sysbios/hal/Timer.h>.

Could you please tell me which library should I link to the project so as to remove this error?

Thanks in advance!!!

  • What kind of timer you want to use and what's the required accuracy for the timer?

    If you don't need high accuracy, then you can use clock module which you can refer to simpleBLEPeripheral Periodic clock to see how it's constructed and used.

    in static void SimpleBLEPeripheral_init(void)

      // Create one-shot clocks for internal periodic events.
      Util_constructClock(&periodicClock, SimpleBLEPeripheral_clockHandler,
                          SBP_PERIODIC_EVT_PERIOD, 0, false, SBP_PERIODIC_EVT);

    In static void SimpleBLEPeripheral_taskFxn(UArg a0, UArg a1)

        if (events & SBP_PERIODIC_EVT)
        {
          events &= ~SBP_PERIODIC_EVT;
    
          Util_startClock(&periodicClock);
    
          // Perform periodic application task
          SimpleBLEPeripheral_performPeriodicTask();
        }

    static void SimpleBLEPeripheral_clockHandler(UArg arg)
    {
      // Store the event.
      events |= arg;
    
      // Wake up the application.
      Semaphore_post(sem);
    }

    If you need to reach high accuracy, you can refer to the following E2E post

    which has the pre-release PWM/GPTimer driver for BLE stack 2.1(or 2.1.1)

    If you are using BLE stack 2.2, then I would recommend you to copy the PWM/GPtimer driver from TI-RTOS 2.20.00.06 into TI-RTOS 2.18. The usage is the same as the pre-release driver as it's a fully tested version of the pre-release driver.  

  • Hi,

    Thanks for the response!

    I want to register a timer interrupt. I did it in the following manner:
    Timer_Handle timer;
    Timer_Params timerParams;
    Error_Block eb;
    Error_init(&eb);
    Timer_Params_init(&timerParams);

    timerParams.period = 10000;
    timer = Timer_create(1, timer_callback, &timerParams, &eb);
    if (timer == NULL) {
    return (-1);
    }

    Is there any way to remove the linker error?
  • Hi,

    Please take a look at what I provided, if you follow any of the tips, you should be able to find your answer.
  • Hi,
    when I try to use GP Timer in the sample project SimpleBLEBroadcaster, I am getting many errors in the Application and board files of the original project while all Timer files are getting compiled properly.

    Could you please tell me what I am missing?
  • To create a periodic event, you can refer to SBP_PERIODIC_EVT implementation in CC2650 SimpleBLEPeripheral example.
  • Hi,
    I need a periodic time event, but at the same time I need a timer interrupt to do so instead of an event timer.
    I was able to successfully incorporate the GP Timer driver to my project.
    How can we set the timer interval using GP Timer?
    I want to set a Timer that generates an interrupt every 5 minutes.
    Is it possible to achieve the same using this driver?
  • I don't have experience to use GP timer to do such application. Why don't you use event timer?