Regarding this part (and a few more similar occurrences):
#define DRN_ENTER_CRITICAL_SECTION(_usis) vTaskSuspendAll(); // Note: safe to use before FreeRTOS scheduler started, but not in ISR
#define DRN_EXIT_CRITICAL_SECTION(_usis) xTaskResumeAll(); // Note: safe to use before FreeRTOS scheduler started, but not in ISR
While, as the comment suggests, it may be safe to use before FreeRTOS scheduler is started, it still has a side effect (at least on my M0+ port):
Any call to malloc() before starting the scheduler will then return with interrupts disabled.
I suggest to wrap the above with
if (xTaskGetSchedulerState()!= taskSCHEDULER_NOT_STARTED){ ... }
(Patching FreeRTOS' handling of the variable uxCriticalNesting would be another way to deal with it, but I prefer not to modify these parts.)
Regarding this part (and a few more similar occurrences):
While, as the comment suggests, it may be safe to use before FreeRTOS scheduler is started, it still has a side effect (at least on my M0+ port):
Any call to malloc() before starting the scheduler will then return with interrupts disabled.
I suggest to wrap the above with
if (xTaskGetSchedulerState()!= taskSCHEDULER_NOT_STARTED){ ... }(Patching FreeRTOS' handling of the variable
uxCriticalNestingwould be another way to deal with it, but I prefer not to modify these parts.)