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.

CCC2640R2f how to create a timer in cc2640r2f ?

Other Parts Discussed in Thread: CC2640R2F

Hello,

I want to create a timer in code composer studio on the Simple_Peripheral to be able to turn on my application. For example a timer of 5 minutes to be able to turn on my card cc2640r2f?

That is to say my card will be off and every 5 minutes she wakes up.

Thank you family

  • Hi MY MY,

    With TI-RTOS, if all the threads/tasks are pending on a semaphore or event, the device will go into standby mode automatically.

    What you could do is to have a periodic Clock object that will call a function every 5 minutes, and in that function you could wake up your task by posting a semaphore or event to it.

    See the TI-RTOS clock example application for ..an example of using Clock:
    dev.ti.com/.../

    See also the Clock module documentation: dev.ti.com/.../index.html

    See the TI-RTOS mutex example for how to use Semaphore: dev.ti.com/.../

    In the BLE example applications, you can also see that some functions do Event_post(..) to wake up tasks.

    Best regards,
    Aslak
  • Hello

    I use the simple device (BLE5stack) and I have not changed anything in the code.
    So I do not know where I started. If you can explain to me how to add a semaphore in the code. There are so many .c and .h files and I do not know how to do the code. Thank you

    thank you very much
  • Hi,

    Adding a semaphore can be seen in the example I posted. Alternatively I would recommend that you run though the RTOS concepts and TI-RTOS labs in SimpleLink Academy, and then the BLE labs:

    dev.ti.com/.../

    Best regards,
    Aslak
  • OK

    I just saw the project clock.c

    the console tells me this:

    Cortex_M3_0: GEL Output: Memory Map Initialization Complete.
    Cortex_M3_0: GEL Output: Board Reset Complete.

    To try to understand I saw hello.c but the console does not show me that
    Normally she shows me HELLO WORLD. But it shows that:

    Cortex_M3_0: GEL Output: Memory Map Initialization Complete.
    Cortex_M3_0: GEL Output: Board Reset Complete.

    Where I can see the message Hello World

    Thank you
  • You have to start the main function

    OK
  • I display HELLO WORLD

    Good
  • Now I come to the example clock.c, When I execute there is nothing happening. I see on the console:
    System time in clk0Fxn = 506
    System time in clk0Fxn = 1010
    System time in clk1Fxn = 1104
    Calling BIOS_exit() from clk1Fxn

    But on the cc2640r2f there is nothing happening? do I have to add a semaphore to be able to trigger the ledS ?

    Thanks you
  • Hello

    Now,

    How can I build a semaphore and clock to make a timer?

    Help me Please