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.

CCS/CC2652P: creating new task

Part Number: CC2652P

Tool/software: Code Composer Studio

Hello Team,

I am Working on "simple_peripheral_oad_offchip_CC13X2P_2_LAUNCHXL_tirtos_ccs".

i am creating multiple task for my project, one is working fine but facing problem with second task creation.

Please have look into piece of code shared below.

void stepData_createTask(void)
{
// Display_printf(dispHandle, row_num++, 0, "Task_construct_process\n");

Task_Params sdtaskParams;

// Configure task
Task_Params_init(&sdtaskParams);
sdtaskParams.stack = sdTaskStack;
sdtaskParams.stackSize = 256; //SD_TASK_STACK_SIZE;
sdtaskParams.priority = 16; //SD_TASK_PRIORITY; //16;

Task_construct(&sdTask, stepData_taskFxn, &sdtaskParams, NULL);

// Create the semaphore used to wait for Sensor Controller ALERT events
Semaphore_Params semParams1;
Semaphore_Params_init(&semParams1);
semParams1.mode = Semaphore_Mode_BINARY; //Semaphore_Mode_COUNTING;

Semaphore_construct(&semStepData, 0, &semParams1);

}

While debug break point is stopping to task_construct itself.

Is there any specific reason that it is failing?

Please suggest solution to resolve this issue.

Kind Ragards,

Tanuja

  • Hi Tanuja,

    Assigning an expert to comment. 

    Thanks, 
    Elin 

  • Hi Tanuja,

    I would strongly recommend that you set a lower task priority so that the BLE task is the task with the highest priority.

    What is the return status for Task_constuct()?

    Did you consider using Task_create() instead?

    If you have created several tasks this could be a memory issue, so I would check the task stacks when this happens.

  • Hello Marie,

    Sorry for late reply.

    Q. I would strongly recommend that you set a lower task priority so that the BLE task is the task with the highest priority.

    > I tried with assigning lowest to the task but of no difference.

    And I did not get how to check the stack size while task_construct.

    Q. What is the return status for Task_constuct()?

    > Task_construct() void.

    Q. If you have created several tasks this could be a memory issue, so I would check the task stacks when this happens.

    >how to check the stack size while task_construct?

    Note : I am assigned same priority to all task

    // Task configuration
    #define SP_TASK_PRIORITY 1

    #ifndef SP_TASK_STACK_SIZE
    #define SP_TASK_STACK_SIZE 1408


    #define BS_TASK_PRIORITY 1
    #define BS_TASK_STACK_SIZE 256 

    #define SD_TASK_PRIORITY 1
    #define SD_TASK_STACK_SIZE 256

    Regards,
    Tanuja

  • Hi Tanuja,

    You can find the documentation for the task module here: 

    I don't know how you set up the sdTask object, you should check what it looks like after you constructed the task.

    You can check the task stacks at runtime with the ROV tool. Please see: