This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

RTX5: High priority thread stalled when other thread running

I am trying to get an application working with two user threads. The first reads a sensor over I2C every time the sensor asserts an interrupt pin. The second runs a periodic calculation which does not yield to the kernel for 200ms or so. The sensor thread has real time priority. The calculation thread has normal priority. Round robin is turned off.

When the calculation starts, the I2C read is blocked. I don't understand this. The interrupt still fires, and events are placed in the sensor message queue, but waiting on the queue does not return until after the calculation thread goes back to sleep.

I tried turning on the round robin. This sort of works, but only reads the sensor intermittently, and then locks up completely pretty quickly.

I'm pretty sure this was all working correctly under RTX4. I upgraded because I thought the CMSIS RTOS2 API was better. I must be doing something wrong.

All suggestions appreciated.

  • I have modified the code to use CMSIS RTOS RTX 4.81 instead. It seems to do exactly what I expect now (I'll see if it's still running in the morning), and didn't exhibit any of the several issues I've encountered with RTX 5.0.0. while I was watching, such as:

    - The PendSV queue overflowing suddenly for no reason.
    - Infinite loop in which thread->next == thread...
    - The calculation thread inexplicably blocking the higher priority sensor thread.

    I have not looked at the latest on GitHub. I hope it is better that what came with Kiel. Memory management and trampling seems to be a particular problem.