Part Number: CC1352R
Other Parts Discussed in Thread: SYSBIOS, CC2640R2F, CC2650, CC1350
Tool/software: Code Composer Studio
Hi,
I am working on an application where I want to create new thread from a running thread. I have not been able to find any information on how that should be done. I have the following code:
void setup_uartPhy() {
Task_Params taskParams;
Error_Block eb;
Error_init(&eb);
/* Construct Task threads */
Task_Params_init(&taskParams);
/* Setup router Task */
taskParams.stackSize = 512;
taskParams.stack = &uartPhyStack;
taskParams.priority = 5;
uartPhyHandle = Task_create((Task_FuncPtr)uartPhyFxn, &taskParams, &eb);
}
I this function is run from a running task, the whole device seem to hang. The running Task has priority set to 3.
However, changing
taskParams.priority = 5;
to
taskParams.priority = 1;
makes the task get created. I suspect that, crating a higher priority task preempts the running one before it is finished creating the new task, but I do not know how to deal with that. Any ideas are greatly appreciated!
Kind regards,
Robert