From 5d94b20aa839593a4bc0ab69e033b3b2972c6f38 Mon Sep 17 00:00:00 2001 From: kar-rahul-aws <118818625+kar-rahul-aws@users.noreply.github.com> Date: Thu, 13 Jul 2023 16:32:05 +0530 Subject: [PATCH] Make changes required for MPU enhancements (#1034) 1. Add macro configUSE_MPU_WRAPPERS_V1 to allow Demo compatibility with the old mpu wrapper . 2. Add Dummy xMPU_SETTINGS in portmacro.h file for Unit Tests . Signed-off-by: kar-rahul-aws --- .../Demo/CORTEX_MPU_M3_MPS2_QEMU_GCC/FreeRTOSConfig.h | 1 + FreeRTOS/Test/CMock/config/portmacro.h | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/FreeRTOS/Demo/CORTEX_MPU_M3_MPS2_QEMU_GCC/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPU_M3_MPS2_QEMU_GCC/FreeRTOSConfig.h index 3aa4d19628..006187adf3 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M3_MPS2_QEMU_GCC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_M3_MPS2_QEMU_GCC/FreeRTOSConfig.h @@ -112,6 +112,7 @@ unsigned long ulGetRunTimeCounterValue( void ); /* Prototype of function that re #define configMAC_INTERRUPT_PRIORITY 5 #define configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY ( 1 ) +#define configUSE_MPU_WRAPPERS_V1 1 /* Prototype for the function used to print out. In this case it prints to the | 10 console before the network is connected then a UDP port after the network has diff --git a/FreeRTOS/Test/CMock/config/portmacro.h b/FreeRTOS/Test/CMock/config/portmacro.h index c20bab70e9..a348f4b570 100644 --- a/FreeRTOS/Test/CMock/config/portmacro.h +++ b/FreeRTOS/Test/CMock/config/portmacro.h @@ -164,6 +164,15 @@ typedef unsigned long UBaseType_t; volatile int fool_static2 = 0; \ void vFunction( void * ( pvParameters ) ) +/* We need to define it here because CMock does not recognize the + * #if ( portUSING_MPU_WRAPPERS == 1 ) guard around xTaskGetMPUSettings + * and then complains about the missing xMPU_SETTINGS type in the + * generated mocks. */ +typedef struct MPU_SETTINGS +{ + uint32_t ulDummy; +} xMPU_SETTINGS; + /*-----------------------------------------------------------*/ /* *INDENT-OFF* */