Init task is stuck on xQueueSemaphoreTake()

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Init task is stuck on xQueueSemaphoreTake()

Jump to solution
2,371 Views
c_joshi
Contributor II

I am using FreeRTOS to run some tasks in my software on S32K144 board . Currently my init task is getting stuck on xQueueSemaphoreTake() function in Queue.c
When I start my program the program runs for a while and then resets and starts with init again. When I see the call stack it shows its stuck on the function i mentioned above. The xQueueSemaphore is invoked while trying to do a blocking receive data from UART peripheral.
In the xQueueSemaphoreTake() function its stuck on portYIELD_WITHIN_API();

I have checked several posts with similiar behavior. I followed their solutions such as stack overflow, or priority setting. I have them all in order.
The configMAX_SYSCALL_INTERRUPT_PRIORITY(5) is number is lower than my UART interrupt(6). I do not have stack issues.

Also when the init task is stuck on the xQueueSemaphore take, the IDLE task is parallely into vApplicationIdleHook() (which i expect is expected behaviour) and then into xPortGetFreeHeapSize() which returns free bytes remaining.
I am new to FreeRTOS and I have exhausted all the solutions online. Can anyone help me?! what could be other possible reasons for this behavior?
Below is the picture of my call stack.
Kindly let me know, if any other details are required.Capture.PNG

Labels (1)
Tags (3)
1 Solution
2,233 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello c.joshi@spike.global‌,

I have figured about what was wrong about this error, this happens due to the lack of heap and stack of the task, so to avoid this increment the configMINIMAL_STACK_SIZE and the Total heap size

 

pastedImage_1.png

 

Let me know if this helps you.

Best Regards,

Alexis Andalon

View solution in original post

1 Reply
2,234 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello c.joshi@spike.global‌,

I have figured about what was wrong about this error, this happens due to the lack of heap and stack of the task, so to avoid this increment the configMINIMAL_STACK_SIZE and the Total heap size

 

pastedImage_1.png

 

Let me know if this helps you.

Best Regards,

Alexis Andalon