Champs
We are seeing below behaviour in SYSBIOS which is causing task in ready state to not get scheduled. We have added prints in SYSBIOS to understand the root cause of the problem and sharing the finding.
Semaphore_post brings task from pendQ to readyQ and masks the curSet variable with the priority indicating the Task_scheduler to invoke the task.
Link List status if one TaskElem is queued in readyQ. ReadyQ->prev = task1elem ReadyQ->next = task1elem
Task1Elem->next = ReadyQElem Task1Elem->prev = ReadyQElem
Link List status if two TaskElems are queued in readyQ. ReadyQ->prev = task2elem ReadyQ->next = task1elem
Task1Elem->next = Task2Elem Task1Elem->prev = ReadyQElem
Task2Elem->next = ReadyQ Task2Elem->prev = Task1Elem
Print “obj elem” is printed after queueing job in readyQ in Task_unblockI function which is called from semaphore_post context. It prints readyQElem(Base) and Taskelem status. This line is printed from Semaphore_post context in SYSBIOS.
ReadyQElem, Task1Elem and Task2Elem addresses are 0x008eb9e0 , 0x00802610, 0x00851118 respectively. Task1 and Task2 are of priority 4 and triggered by semaphore_post in accumulator ISR.
Copying the snippet of the log for understanding how jobs are linked and sequence of event.
Line No Time_stamp(MicroSec) 15922 <I> [C-2] 00000015 3046 (01013) [ 0000] obj elem 0x008eb9e0 prev 0x00802610 next 0x00802610 elem prev 0x008eb9e0 next 0x008eb9e0 15925 <I> [C-2] 00000015 3048 (01013) [Task1 0002] curSet 0x00000011 mask 0x00000010 readyQ Status 0 task1elem->readyQ 0x008eb9e0 task1elem 0x00802610 task1elem->prev 0x008eb9e0 task1elem->next 0x008eb9e0 counter 651 15926 <I> [C-2] 00000015 3048 (01013) [ 0000] obj elem 0x008eb9e0 prev 0x00851118 next 0x00802610 elem prev 0x00802610 next 0x008eb9e0 16014 <I> [C-2] 00000015 3095 (01013) [Task1 0002] curSet 0x00000011 mask 0x00000010 ready...
Thanks
Regards
Mohsen