2022-06-10 11:46 PM
I am working with stm32h753zi board and i am tring to implement the task swithcing logic, if task 1 is running task 2 wait on while loop and while task 2 is running task1 should wait of while loop. I task 2 locked inside the osDelay().
2022-07-29 01:09 AM
Hello,
In Task2 code there is no incrementation of user_count, so all will work for first 2000 iterations of Default Task (task1), then it will stay on 2001 and Task2 will stay in the first while loop.
Adding user_count++; after first osDelay(10) in StartTask02() function should solve the issue, but I would limit it from the top as it will count till max 16bit or 32bit number and the application will spend much more time in Task2 vs Task1.
2022-08-09 09:33 AM
Learn a proper thread synchronization - flags, events, semaphores, message queues...