This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Interrupt Clashing in RTOS

Other Parts Discussed in Thread: CC2650

Hello Everyone,
We are trying to design a system which has a real time clock, heart rate and a step count into it. We have used CC2650, TI RTOS, CCS 6.1, AFE 4400 and MPU 9250 and designed our own PCB using sensor tag schematics.
We stuck in the middle, Individually we are able to run all 3 sub tasks but after merging them into a single RTOS code, they hampers each other interrupts.
If system is receiving drdy interrupt of heart rate, it will not allow any other interrupt to come after 4 to 5 minutes irrespective of priority of drdyinterrupt(higher or lower than accelerometer & RTC). This can be due to the fact that the time gap between 2 Afe interrupt(drdy) is 2ms while in case of accelerometer it is 3s and in case of RTC it is 10s.
I have also tried to slow down drdy interrupt, by introducing delay inside while loop but in this case we will not able to get accurate data from process data (functions which check data is accurate or garbage), so only time and accelerometer will work since no drdy interrupt. Similar is the case when I somehow busy this drdy interrupt.
If you need any further information please do let me know and do feel free to suggest some appropriate solutions.
Regards
  • Hi Abhinav,

    From your post, I am gathering that you have three sources of interrupts, each occurring at different rates, and it works if you handle only one type at a time, but not if you have all three Tasks running at once, correct?

    If you make the 2ms drdy Task run at the lowest priority, and run the other two Tasks at a higher priority, I'd expect the other two to be scheduled to run, assuming interrupts are handled properly and tasking is not disabled. Are you using semaphores in your ISRs to wake up the Tasks? Are you disabling tasking or interrupts in your code to handle drdy interrupts? Are the ISRs being executed and just the Tasks not getting a chance to run? And what is the loading in your system? If handling of the 2ms drdy interrupts disables tasking in some way and is too CPU intensive, it may explain why the other Tasks do not get to run.

    In situations like these it's good to have a better general understanding of the system. Some tools that help visualize system data are:

    - System Analyzer (to see loading and execution graph): processors.wiki.ti.com/.../System_Analyzer_Tutorials_(CCSv6)
    - RTOS Object Viewer (to look at stack/heap usage, Hwi/Task info): www.youtube.com/watch

    Hope this helps,
    Vincent