diff --git a/portable/GCC/ARM_CRx_MPU/port.c b/portable/GCC/ARM_CRx_MPU/port.c index bef3a7854..e4904e58d 100644 --- a/portable/GCC/ARM_CRx_MPU/port.c +++ b/portable/GCC/ARM_CRx_MPU/port.c @@ -598,7 +598,9 @@ static BaseType_t prvMPURegionAuthorizesBuffer( const xMPU_REGION_REGISTERS * xT if( ulAccessRequested == tskMPU_READ_PERMISSION ) /* RO. */ { if( ( ulMPURegionAccessPermissions == portMPU_REGION_PRIV_RW_USER_RO ) || - ( ulMPURegionAccessPermissions == portMPU_REGION_PRIV_RO_USER_RO ) ) + ( ulMPURegionAccessPermissions == portMPU_REGION_PRIV_RO_USER_RO ) || + ( ulMPURegionAccessPermissions == portMPU_REGION_PRIV_RW_USER_RW ) ) + { xAccessGranted = pdTRUE; } diff --git a/portable/GCC/ARM_CRx_MPU/portmacro.h b/portable/GCC/ARM_CRx_MPU/portmacro.h index 4ca649f6e..7e80f093e 100644 --- a/portable/GCC/ARM_CRx_MPU/portmacro.h +++ b/portable/GCC/ARM_CRx_MPU/portmacro.h @@ -221,6 +221,13 @@ typedef uint32_t TickType_t; */ #define portMEMORY_BARRIER() __asm volatile( "" ::: "memory" ) +/** + * @brief Ensure a symbol isn't removed from the compilation unit. + * + * @ingroup Port Interface Specifications + */ +#define portDONT_DISCARD __attribute__( ( used ) ) + /** * @brief Defines if the tick count can be accessed atomically. *