Assertions are excellent tools for catching conditions that simply shouldn't happen. They provide us with a simple means to check assumptions. See the Creating a task – checking the return value section of Chapter 7 , The FreeRTOS Scheduler, for an example of how to add simple assertions to prevent code from running when the system is in an unacceptable state.
A special FreeRTOS flavor of the assert construct is configAssert.