I have an application that is using the MSP430X port which is running on an MSP430F5335. I am testing this application running on 4 different boards in our environmental chamber. I am seeing the application get stuck in an endless loop in the xTaskIncrementTick function. So far it has happened twice on the same board but not on the other three boards I am testing. This could be a hardware problem but I would like to have some feedback if anyone can think of software issues that could cause this problem.
I was able to connect my IAR IDE to the board using the “connect to running target” option. I see that the application is stuck in the xTaskIncrementTick function inside the “for( ;; )” loop. The pxDelayedTaskList shows that there is 1 item in the list. pxTCB is read from the pxDelaydTaskList ok. xConstTickCount is equal to xItemValue so uxListRemove( &( pxTCB->xGenericListItem ) ) is called. I would think that pxTCB->xGenericListItem.pvContainer would typically point to the pxDelayedTaskList in this case, but it is pointing to pxReadyTasksLists so the uxListRemove removes it from the pxReadyTasksLists and not the pxDelayedTaskList. pxTCB0>xEventListItem.pvContainer = NULL so removal from the event list was not required. Next, the code adds pxTCB back to pxReadyTasksLists with the call to prvAddTaskToReadyList( pxTCB ). xSwitchRequired is then set to pdTRUE since the Priority of the task is >= the current task.
Since pxTCB is not removed from pxDelayedTaskList, the same sequence just repeats forever. A break is never hit to get out of the loop with the conditions described.
Any ideas on how this condition may have been caused?
I have reviewed the code to see if I have mistakenlly used API calls without the “fromISR” suffix in any interrupt routines or calls with the “fromISR” suffix in standard code but I don’t seen any.
I am using vTaskDelayUntil, xSemaphoreTake & xSemaphoreGive within tasks for synchronization and scheduling.
I am also using xSemaphoreGiveFromISR and portYIELD_FROM_ISR within interrupt routines to trigger certain tasks to execute
Any help would be greatly appreciated.