vTaksDelay stops scheduler without resuming it after a few calls

This does not look correct and looks like the memory is corrupted. Lets try the following:

  1. Define a new variable right after the definition of uxSchedulerSuspended.
PRIVILEGED_DATA static volatile UBaseType_t uxSchedulerSuspended_Test = ( UBaseType_t ) pdFALSE;
  1. Start debugger and put a breakpoint in your application task (StartDefaultTask).
  2. Put a data breakpoint at the location of your new variable uxSchedulerSuspended_Test.
  3. Remove the breakpoint created in step 2 and let the debugger continue.

The expectation is that the linker places uxSchedulerSuspended_Test and uxSchedulerSuspended close enough and any memory corruption which corrupts uxSchedulerSuspended, will also corrupt uxSchedulerSuspended_Test. Since we have a data breakpoint on uxSchedulerSuspended_Test, the debugger will break as soon as it is changed (which should not happen in a legitimate case).

Thanks.