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/CC2650: App/BLE Stack change priority of ICall_init(), and GAP

Part Number: CC2650

Tool/software: TI-RTOS

Hello,

I would like to change the priority of  ICall_createRemoteTasks(); from 5 to a number higher, and insert some of my own custom RTOS tasks of lower priority. The way main.c (that comes with sample peripheral) is written, priorities 5, 3, and 1 are already taken, not leaving much for custom tasks (especially considering that we are advised to not have any tasks with a priority higher than the BLE task). I have two tasks, a sensor controller data retrieval task (higher priority), and a data processing task (lower priority). How can i add these into the app/ble stack projects successfully if the maximum priority we have access to is 4? (AKA - can we change the priority of the predefined tasks?) Thanks

 /* Initialize ICall module */
  ICall_init();
 
  /* Start tasks of external images - Priority 5 */
  ICall_createRemoteTasks();
 
  /* Kick off profile - Priority 3 */
  GAPRole_createTask();
 
  SimpleBLEPeripheral_createTask();
 
  /* enable interrupts and start SYS/BIOS */
  BIOS_start();
 

 

  • Hello,

    The number of task priorities is defined in the RTOS configuration file, e.g., appBLE.cfg for BLE projects.
    Note that adding more tasks requires more RAM for task stacks and RTOS objects.

    Best wishes
  • I understand i can change the number of tasks, but how do i change the piority of the predefined ICall_createRemoteTasks(). Can you please refer me to some decent documentation on this subject because it is furstratingly thick and non-user friendly
  • Hello Anthony,

    We do not publish documentation on how to change the ICall (BLE) task priority, however, with a quick "find in files" search, you can find this entry in icall_addrs.h:

    **
    * Initializer for an array of thread priorities.
    * Each element of the array corresponds to TI-RTOS specific
    * thread priority value given to a thread to be created
    * per the entry function defined in @ref ICALL_ADDR_MAPS
    * initializer, in the same sequence.
    */
    #define ICALL_TASK_PRIORITIES { 5 }

    Changing this param will change the task priority that is used to create the task. It is still YMMV as we do not recommend (or test) changing the priority of the BLE task.

    Best wishes
  • That is very clear, however, how does TI expect users to run OTHER tasks  to run in threads alongside the Bluetooth tasks(like pulling data from the sensor controller, and processing this data) if running Bluetooth requires 1) Not altering pre-defined priorities 2) No priorities are allowed to be above the BLE protocol priority {5} 3) Only having priorities 2 and 4 remaining as Bluetooth uses 1, 3, and 5.

  • It's not practical to run more than 2 additional RTOS tasks due to memory resource requirements, mostly on the task stack size. You can move GAPRole task to priority 4 without any issues in the default sample applications.

    Best wishes