Task 2 and 3 both have this at the start of their threads (before entering their respective infinite loops):
xTaskNotifyWait(0, 0, NULL, portMAX_DELAY);
Task 2 and 3 never receive the notification. Any idea why?
Maybe there’s a better way to prevent execution of Task 2 and 3 until Task 1 is finished with its initial processing? I’ve tried just starting Task 2 and 3 suspended and resuming them in task 1 sequentially; but that didn’t work either.
Better (read: never ever) use suspend/resume for task synchronization.
Task notifications are fine and are designed for purposes or use cases like yours and you’ve chosen a good approach.
Also your code looks ok.
Are the task handles valid ? Could you show the task creation and the task function code, too ?
I should mention all three tasks are/have been working fine. I just discovered a race condition with the execution of the three and decided to do this to rectify that.
I think the assert comes from a memory corruption of FreeRTOS internal data.
Very often memory corruptions are caused by stack overflows.
Did you enable stack checking for development ?
Or just retry your application with increased stack sizes.
For instance using printf family functions required relatively large stacks.
Turns out I was notifying Task 3 before it had even been created. There was a separate thread in the system that creates and initializes Task 3. Problem solved.