Task stucks in eReady state

pbjacob wrote on Wednesday, March 13, 2019:

Hardware: TI tiva-c TM4C123GXL LaunchPad (MCU: tm4c123gh6pm)
FreeRTOS Version: 10.2.0
IDE: keil mdk 5.26.2

I have totally 6 tasks:
task1: blinky LED and fetch the state of task2 using eTaskGetState function
task2: wait for a Semaphore/Notify (with Highest priority)
task3-6: only do vTaskDelay and nothing else

In the interrupt handler function of URAT, a Semaphore/Notify is given.

When running this project, at first, everything is OK. After a while, the state of task2 is turned into eReady, and is keeping on this state.

At the same time:

  1. All the other tasks are running correctly.
  2. No overflow happens on taks2’s stack.
  3. The UART interrupt handler function correctly gives out Sema/Notify.

Why the task with the highest priority keeps in eReady state while all the other tasks are scheduling normally?

rtel wrote on Wednesday, March 13, 2019:

I’m afraid without seeing some code I don’t know where to start making
suggestions. Can you show the task that it taking the semaphore and the
ISR to start with?

pbjacob wrote on Wednesday, March 13, 2019:

Thank you so much for your reply. I have already uploaded my project in my post.

However, I have already found the key issue.
Definitely, the interrupt priority. After setting the ISR priority below the configMAX_SYSCALL_INTERRUPT_PRIORITY, everything is correct now.

Thank you all the same.