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.

Why my empty task is blocking other tasks?

Other Parts Discussed in Thread: CC1310, SYSBIOS

Hi. I have a problem. I crated empty console task while(1) {}; with priority 1 using Task_construct running at CC1310 chip. Anoter tasks has higher priority than it.

But sometimes the console task blocks another tasks with higher priority. What may cause this problem? Thanks.

Here my init code:

Task_Params taskParams;

consoleUartHandle = uartHandle;
consoleLedPinHandle = ledPinHandle;

#ifdef UARTCONSOLE_TXCALLBACK
Semaphore_Params semParams;
// Create Binary Semaphore
Semaphore_Params_init(&semParams);
semParams.mode = Semaphore_Mode_BINARY;
consoleUartTxSem = Semaphore_create(1, &semParams, NULL);
#endif

// Configure task
Task_Params_init(&taskParams);
taskParams.stack = uartConsoleTaskStack;
taskParams.stackSize = UARTCONSOLETASK_STACKSIZE;
taskParams.priority = UARTCONSOLETASK_PRIORITY;

Task_construct(&uartConsoleTask, uartConsoleFxn, &taskParams, NULL);

and task handler code:

Void uartConsoleFxn(UArg arg0, UArg arg1)
{
uint32_t lenTx;
consoleAUXinit();

uartOutputStr(BS_uartConsole_GreetingStr);

enteredRxBytes = 0;
uartConsoleShell_start();

// Start an (already constructed) clock.

Util_startClock(&consolePeriodicClock);

// Start initial read (first call), with dfined size
wantedRxBytes = 1;

/* Loop forever receiving commands */


while (1) {};

}

  • What you are saying doesn't make sense so I'll try to explain what should happen....then maybe you can tell me what you are seeing.

    SYSBIOS always executes the highest priority task that is 'ready' to run.  So if we have 2 task with different priority, the lower priority task will only get to run whenever the higher priority task blocks.  The lower priority task does not block the higher priority task.  The higher priority task can block itself by calling something like Semaphore_pend(), but in this case, when a Semaphore_post() is called, the higher priority task will be made ready and should run again.