Become a leader in the IoT community!
New DevHeads get a 320-point leaderboard boost when joining the DevHeads IoT Integration Community. In addition to learning and advising, active community leaders are rewarded with community recognition and free tech stuff. Start your Legendary Collaboration now!
Your system is likely freezing due to a deadlock between `controlArmTask` and `sendCommandTask`. To fix this:
1. Avoid Infinite Waits: Replace `portMAX_DELAY` with a timed wait, like `pdMS_TO_TICKS(100)`, to prevent tasks from blocking indefinitely.
2. Check Task Priorities: Ensure task priorities are set properly to avoid priority inversion.
3. Avoid Nested Locks: Ensure that mutexes are not nested or locked in different orders by different tasks.
These changes should help resolve the deadlock and prevent the system from freezing.
You did a good job isolating the potential issue to controlArmTask and sendCommandTask
,
Use FreeRTOS built in debugging features or external tools to view you task states, the ownership of your mutex, and potential deadlocks.
You might be holding the mutex for too long . Or use semaphores for synchronization instead
CONTRIBUTE TO THIS THREAD