Am trying to run two thread simultaneously, but the issue is that only one thread is working and another one is not, if there is some delay or some error occurs in 1st thread then the second thread works and first thread stops. I want both the threads to be working together. How can i resolve this?
What are the values of
configUSE_TIME_SLICING in your FreeRTOSConfig.h? What are the priorities of your tasks? Can you share code snippets of tasks?
One thing to remember is that if you have a single core CPU (as many embedded class processors are, and the base FreeRTOS is designed for) then only one task can actually run at any given instance, and multiple tasks running “simultaneously” is only an appearancy cause by switching between tasks as needed.
With Preemption and Time Slicing enabled, FreeRTOS will automatically switch to the highest priority ready task, possibly time slicing between them if there are multiple at the same priority level.
Lower priority tasks can only run if the higher priority tasks “Block” for some condition with a call to a FreeRTOS API function with a specified delay time.