Part Number: RM44L520
Other Parts Discussed in Thread: HALCOGEN
Hello, I have posted the first portion of this to the FreeRTOS Fourms and it seems that this issue is likely due to some issue in my interrupt configuration. Please see below:
I have a program that has 6 task, 4 of these tasks will run based on a combination of hardware and software events while the other 2 are set to run periodically. I will give them names below to make my explanation a bit clearer:
Task A1 - This task will run if Mode A is selected on a dip switch at power up time. It is
controlled with an event group
Task A2 - This task is will run if a software event occurs in Task A1. It is also controlled with
an event group
Task B1 - This task will run if Mode B is selected on a dip switch at power up time. It is
controlled with an event group
Task B2 - This task is will run if a software event occurs in Task A1. It is also controlled
with an event group
Task WD - This task is used to control an internal watchdog. Runs periodically
Task 4-20 - This task is used to control an external 4-20 chip. Runs periodically.
When I comment out one of the 4-20 tasks everything works great and is scheduled/executed exactly as I expect. If I am running in Mode A and comment out one of the Mode B tasks everything works as expected. If I am running in Mode B and comment out one of the Mode A tasks everything works as expected. The issue comes when I run in either Mode A or Mode B with all tasks created. When I do this the system will behave as expected until the 4-20 task is given a time slice. At that point the system will freeze. I have removed all of the task code from the 4-20 task and have just added a vTaskDelay() to rule out some code I have written in that task causing the issue and the system still freezes. Initially this seemed like a memory issue, but I was able to run all of these tasks individually with significantly smaller stack sizes than I have set now and they have behaved as expected individually. I have also added guards when the tasks are created to ensure all of the tasks are created properly. I also tried replacing the vTaskDelay in the 4-20 task with a GIO set function and that works fine. I have attached a sample screenshot from tracealyzer showing the freeze:

I'm wondering if there is some issue with the interrupts that might be causing the context switching to be blocked.
Please feel free to ask any questions.
