Thank you, this is making sense now. I don’t see anywhere in the present code where the source of the SVC is checked though.
So is this whole MPU thing just a leftover from someone elses project, or is this active?
I suppose MMU support is too outside of what average FreeRTOS applications need. For me, it is more about developing a complex program and reducing development time.
Anyway, I suppose it was done this way as to keep code uncluttered, but it seems it would be cleaner if it was something like this.
if config_USEMMU == 1)
define vPortResetPriviledge LowerPriviledge(xRunningPrivileged)
define vPortRaisePriviledge BaseType_t xRunningPrivileged = xPortRaisePrivilege()
BaseType_t xTaskCreate( TaskFunction_t pxTaskCode,
const char * const pcName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
const configSTACK_DEPTH_TYPE usStackDepth,
void * const pvParameters,
TaskHandle_t * const pxCreatedTask )
/* code */