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.

MSP432P4111: SYSBIOS Task_setPri from idle task

Part Number: MSP432P4111

Hi,

I'm using the idle task for logging data out UART from both LoggerIdle and SysMin, so I need to add a mutex to synchronize the two streams so the data isn't interleaved. This is fine and works well, but I specifically need to use `GateMutexPri` to avoid priority inversion. However, when using this it triggers an assertion when leaving the gate from the idle thread. Specifically, it triggers the following one, from line 1120 in `simplelink_msp432p4_sdk_3_40_01_02/kernel/tirtos/packages/ti/sysbios/knl/Task.c`

    Assert_isTrue((((priority == -1) || (priority > 0) ||
                  ((priority == 0 && Task_module->idleTask == NULL))) &&
                   (priority < (Int)Task_numPriorities)),
                   Task_A_badPriority);

It is triggered because the idle task's priority is 0, which is only valid for the idle thread.

However, I believe it is fine in this specific case unless I'm missing something. If I'm not, then can we change the assertion to check for this case? e.g.

    Assert_isTrue((((priority == -1) || (priority > 0) ||
    ((priority == 0 && Task_module->idleTask == NULL)) ||
    (priority == 0 && tsk == Task_getIdleTask())) &&
    (priority < (Int)Task_numPriorities)),
                  Task_A_badPriority);

Thanks

Campbell