Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
Qt for MCUs 2.5, Qt for MCUs 2.2
-
None
Description
When qul is running in a low priority task and writes to the queue using a higher priority task, then it will destroy the queue count, triggering QulError_CircularBuffer_PopEmpty which will cause the display screen to get stuck.
The exact point of failure should be here in file include\platform\private\circularbuffer.h:89
void popFront(void *event)
{
QUL_DEBUG_ASSERT(m_begin != -1 && m_last != -1, QulError_CircularBuffer_PopEmpty);
memcpy(event, m_data + m_begin * m_itemSize, m_itemSize);
if (m_begin == m_last) {
m_begin = -1;
// a higher priority task calls pushBack(const void *event) here
m_last = -1;
} else
}
The probability of this problem is very low, but if using FreeRTOS, adding a 100ms delay to the red section can simply reproduce the problem.
A temporary fix is to put a mutex lock on this part of the code to make it atomic, but this is potentially risky (e.g., causing a priority inversion)