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.

RTOS/CC2642R: BLE tasks and threads

Guru 18625 points

Part Number: CC2642R
Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI-RTOS

Dear all,

I am programming a BLE application with SimpleLink SDK. I am using CC2642R. With it, I can develop applications just like with my MSP432 using POSIX threads (pthread API). Or, you can use direct TI-RTOS API (tasks API). My question is twofold:

  1. The latter are lower level than the first ones. Do I understand this right?
  2. The BLE SimplePeripheral example calls SimplePeripheral_createTask() before BIOS_start(). Since I am more comfortable with pthreads API, can I enclose its main() code inside a thread and call the BIOS_start() in my own main(), where I create other threads? Does what I am saying have any sense? Or, should I discard the all pthread thing and use only tasks API? 

Please let me know your opinions and have the nicest day.

  • Hi Kazola,
    I'm assigning this thread to one of the experts, to comment. Stay tuned.
  • Hi Kazola,

    You could say that the BIOS apis are lower level in this case because pThread apis are "just" wrappers, at least for BLE where we don't support other RTOSes.

    My suggestion would be to use the SYSBIOS/Task APIs because the BLE projects already use this for their various threads. I'm not entirely sure how it would be possible to mix and match those APIs. The POSIX api also requires a call to BIOS_start() at some point as well, and this must be done in the main context. There is only one kernel and one scheduler, and so you can't have a thread active until BIOS_start() is called.

    Please see the empty example main entry point: dev.ti.com/.../

    This being said, I'm sure you can convert the BLE projects to use pThread, I'm just not sure it's worth the effort.

    Best regards,
    Aslak
  • Awesome answer! Thanks you both and !