Please add the following to mpu_wrappers.c
:
#if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
void *MPU_pvPortMalloc( size_t xSize )
{
void *pvReturn;
BaseType_t xRunningPrivileged = prvRaisePrivilege();
pvReturn = pvPortMalloc( xSize );
vPortResetPrivilege( xRunningPrivileged );
return pvReturn;
}
#endif /* configSUPPORT_DYNAMIC_ALLOCATION */
/*-----------------------------------------------------------*/
#if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
void MPU_vPortFree( void *pv )
{
BaseType_t xRunningPrivileged = prvRaisePrivilege();
vPortFree( pv );
vPortResetPrivilege( xRunningPrivileged );
}
#endif /* configSUPPORT_DYNAMIC_ALLOCATION */
/*-----------------------------------------------------------*/
And the following to mpu_wrappers.h
:
#define pvPortMalloc MPU_pvPortMalloc
#define vPortFree MPU_vPortFree
Give it a try and see if it fixes your issue.