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.

CC2640R2F: Some issues with multitasking creation

Part Number: CC2640R2F

Hi team,

The customer would like to ask about some problems encountered during the creation of multitasking.

ICALL_MAX_NUM_ENTITIES=6 ICALL_MAX_NUM_TASKS=3 set in the APP program ble5_simple_peripheral_cc2640r2lp_app_FlashROM_StackLibrary.opt,

1.ICALL_MAX_NUM_TASKS=3 is a stack task, a gap task and a user-defined task. There are three in total, but why is ICALL_MAX_NUM_ENTITIES 6? (Shouldn’t 3 task clients and 1 icall server be 4?)

2. Must OSAL_MAX_NUM_PROXY_TASKS +1 =ICALL_MAX_NUM_TASKS be satisfied? What does +1 represent? I set OSAL_MAX_NUM_PROXY_TASKS to 2, ICALL_MAX_NUM_TASKS to 4, and the program can still run, so does OSAL_MAX_NUM_PROXY_TASKS +1 mean <=ICALL_MAX_NUM_TASKS?

3. But in the example of ble5_simple_peripheral_cc2640r2lp_app, I did not see the initialization of three tasks such as simple_peripheral_cc2640r2lp_app. It only explicitly gave two. Why is this?

4. When creating multitasks, ICALL_MAX_NUM_ENTITIES, ICALL_MAX_NUM_TASKS, and OSAL_MAX_NUM_PROXY_TASKS should all be modified +1, but if the task function of the task I create does not execute Event_pend, ICall_SyncHandle is not used, or SimplePeripheral_enqueueMsg is called, the existing ICall_SyncHandle is used, right? No need to +1?

Thanks & Best regards,

Yolande

  • Hi Yolande,

    Thanks for reaching out! We will look into this and get back to you as soon as possible. To help us support better, can you share which version of the SDK the customer is using?

    Also, can you specify the full part number used by the customer and if this is an automotive grade device?

    Thanks,

    Luke

  • Hi Luke,

    The customer uses simple link_cc2640r2_sdk_4_20_00_04, not automotive equipment.

    Thanks & Best regards,

    Yolande

  • Hi,

    1.ICALL_MAX_NUM_TASKS=3 is a stack task, a gap task and a user-defined task. There are three in total, but why is ICALL_MAX_NUM_ENTITIES 6? (Shouldn’t 3 task clients and 1 icall server be 4?)

    ICALL_MAX_NUM_ENTITIES holds the maximum number of entities that use ICall, including service entities and application entities. You may want to review the docs dealing with Stack Configuration for additional details. https://software-dl.ti.com/simplelink/esd/simplelink_cc2640r2_sdk/5.30.00.03/exports/docs/ble5stack/ble_user_guide/html/ble-stack-5.x/stack-configuration-cc2640.html#stack-configurations

    2. Must OSAL_MAX_NUM_PROXY_TASKS +1 =ICALL_MAX_NUM_TASKS be satisfied? What does +1 represent? I set OSAL_MAX_NUM_PROXY_TASKS to 2, ICALL_MAX_NUM_TASKS to 4, and the program can still run, so does OSAL_MAX_NUM_PROXY_TASKS +1 mean <=ICALL_MAX_NUM_TASKS?

    The main requirement is to ensure the number of task and entities accessing ICall remains correct (i.e. that you don't have more task accessing ICall than you have pre-defined slots). 

    Setting ICALL_MAX_NUM_TASKS to 4, you basically define additional slots that won't be used. So the program is expected to work but a bit of RAM memory is wasted.

    3. But in the example of ble5_simple_peripheral_cc2640r2lp_app, I did not see the initialization of three tasks such as simple_peripheral_cc2640r2lp_app. It only explicitly gave two. Why is this?

    I guess this point was answer before - Not all the ICall entities are tasks.

    4. When creating multitasks, ICALL_MAX_NUM_ENTITIES, ICALL_MAX_NUM_TASKS, and OSAL_MAX_NUM_PROXY_TASKS should all be modified +1, but if the task function of the task I create does not execute Event_pend, ICall_SyncHandle is not used, or SimplePeripheral_enqueueMsg is called, the existing ICall_SyncHandle is used, right? No need to +1?

    Said differently, if a task accesses ICall structures then it should be ICall-enabled, meaning ICall_registerApp() should be called and the values of ICALL_MAX_NUM_ENTITIES, ICALL_MAX_NUM_TASKS, and OSAL_MAX_NUM_PROXY_TASKS incremented.
    As you noted, certain ICall APIs may be "hidden" within SimplePeripheral APIs.

    I hope this will help,

    Best regards,