I have a assertion failing in Chibios code, and I am trying to troubleshoot it.
The check condition is the following:
Code: Select all
/* The following condition can be triggered by the use of i-class functions
in a critical section not followed by a chSchResceduleS(), this means
that the current thread has a lower priority than the next thread in
the ready list.*/
chDbgAssert((ch.rlist.queue.next == (thread_t *)&ch.rlist.queue) ||
(ch.rlist.current->prio >= ch.rlist.queue.next->prio),
"priority order violation");
What I would expect is that somewhere, in my thread(?) code there is a missing call to chSchResceduleS().
As I understand from the documentation, I only need to call chSchResceduleS() after a call to an I-class function, when in thread code. I have triple-checked that this is NOT my problem. In fact, I reproduce this issue without even a single call to an I-class function!
Are there any other cases of needing to call chSchResceduleS()? Are there any other causes of failure for this assertion, apart from what is written in the comment? Any other way to troubleshoot this?