From 5861ac4d7ad9d99a98cfc85d04504a7d99d6039c Mon Sep 17 00:00:00 2001 From: kar-rahul-aws <118818625+kar-rahul-aws@users.noreply.github.com> Date: Thu, 3 Aug 2023 14:28:25 +0530 Subject: [PATCH] Update MPU Demos for Kernel V10.6.0 (#1057) Update MPU Demos for Kernel V10.6.0 --- .../FreeRTOSConfig.h | 148 +++++----- .../GCC_Specific/RTOSDemo.uvoptx | 130 +++------ .../GCC_Specific/RTOSDemo.uvprojx | 17 +- .../GCC_Specific/RegTest.c | 2 + .../GCC_Specific/sections.ld | 58 ++-- .../Keil_Specific/RTOSDemo.sct | 12 +- .../Keil_Specific/RTOSDemo.uvoptx | 54 +++- .../Keil_Specific/RTOSDemo.uvprojx | 20 +- .../main.c | 11 +- .../Config/FreeRTOSConfig.h | 11 + .../utilities/freertos_tasks_c_additions.h | 12 +- .../org.eclipse.core.resources.prefs | 2 + .../Projects/MCUXpresso/FreeRTOSDemo.ld | 2 +- .../Projects/IAR/Config/FreeRTOSConfig.h | 8 + .../IAR/NonSecure/FreeRTOSDemo_ns.ewp | 6 + .../Projects/Keil/Config/FreeRTOSConfig.h | 8 + .../Keil/NonSecure/FreeRTOSDemo_ns.uvoptx | 48 +++- .../Keil/NonSecure/FreeRTOSDemo_ns.uvprojx | 12 +- .../Keil/Secure/FreeRTOSDemo_s.uvprojx | 2 +- .../Projects_NTZ/IAR/Config/FreeRTOSConfig.h | 8 + .../Projects_NTZ/IAR/FreeRTOSDemo.ewd | 20 +- .../Projects_NTZ/IAR/FreeRTOSDemo.ewp | 10 +- .../Projects_NTZ/Keil/Config/FreeRTOSConfig.h | 8 + .../Projects_NTZ/Keil/FreeRTOSDemo.uvoptx | 46 ++- .../Projects_NTZ/Keil/FreeRTOSDemo.uvprojx | 12 +- .../Config/FreeRTOSConfig.h | 8 + .../FreeRTOSDemo.emProject | 2 + .../Projects/IAR/Config/FreeRTOSConfig.h | 8 + .../IAR/NonSecure/FreeRTOSDemo_ns.ewp | 6 + .../MCUXpresso/Config/FreeRTOSConfig.h | 8 + .../Projects_NTZ/IAR/Config/FreeRTOSConfig.h | 8 + .../Projects_NTZ/IAR/FreeRTOSDemo.ewp | 6 + .../MCUXpresso/Config/FreeRTOSConfig.h | 8 + .../Config/FreeRTOSConfig.h | 8 + .../FreeRTOSDemo.emProject | 2 + .../Config/FreeRTOSConfig.h | 8 + .../NonSecure/FreeRTOSDemo_ns.uvoptx | 48 +++- .../NonSecure/FreeRTOSDemo_ns.uvprojx | 12 +- .../FreeRTOSConfig.h | 11 +- .../Demo/CORTEX_MPU_M3_MPS2_QEMU_GCC/Makefile | 3 + .../init/startup.c | 2 +- .../scripts/mps2_m3.ld | 6 +- .../Config/FreeRTOSConfig.h | 136 ++++----- .../Projects/GCC/STM32L152RETX_FLASH.ld | 14 +- .../Config/FreeRTOSConfig.h | 8 + .../Projects/GCC/STM32H743ZITX_FLASH.ld | 4 +- .../Projects/IAR/FreeRTOSDemo.ewp | 6 + .../Projects/Keil/FreeRTOSDemo.uvoptx | 266 +++++++++-------- .../Projects/Keil/FreeRTOSDemo.uvprojx | 10 + .../Projects/Keil_V5/FreeRTOSDemo.uvoptx | 268 ++++++++++-------- .../Projects/Keil_V5/FreeRTOSDemo.uvprojx | 10 + .../Config/FreeRTOSConfig.h | 141 +++++---- .../Projects/GCC/STM32L475VGTX_FLASH.ld | 2 +- .../Projects/IAR/MPUDemo.ewp | 165 +++++++---- .../Projects/Keil/MPUDemo.sct | 2 +- .../Projects/Keil/MPUDemo.uvoptx | 116 +++++--- .../Projects/Keil/MPUDemo.uvprojx | 35 ++- .../Projects/Keil/memfault_handler.c | 2 +- .../FreeRTOSConfig.h | 149 +++++----- .../GCC_Specific/RTOSDemo.uvoptx | 40 ++- .../GCC_Specific/RTOSDemo.uvprojx | 13 +- .../GCC_Specific/sections.ld | 6 +- .../Keil_Specific/RTOSDemo.sct | 11 +- .../Keil_Specific/RTOSDemo.uvoptx | 49 ++-- .../Keil_Specific/RTOSDemo.uvprojx | 15 +- .../Demo/CORTEX_MPU_Simulator_Keil_GCC/main.c | 27 +- .../FreeRTOSConfig.h | 152 +++++----- .../GCC_Specific/RTOSDemo.uvoptx | 39 ++- .../GCC_Specific/RTOSDemo.uvprojx | 24 +- .../GCC_Specific/RegTest.c | 2 + .../GCC_Specific/sections.ld | 4 +- .../Keil_Specific/RTOSDemo.sct | 11 +- .../Keil_Specific/RTOSDemo.uvoptx | 38 ++- .../Keil_Specific/RTOSDemo.uvprojx | 20 +- .../main.c | 57 ++-- .../simulator.ini | 5 + 76 files changed, 1653 insertions(+), 1015 deletions(-) create mode 100644 FreeRTOS/Demo/CORTEX_MPU_LPC54018_MCUXpresso/Projects/MCUXpresso/.settings/org.eclipse.core.resources.prefs create mode 100644 FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/simulator.ini diff --git a/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/FreeRTOSConfig.h index 868512ea0..c51491bf2 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/FreeRTOSConfig.h @@ -47,34 +47,34 @@ extern "C" { /* The MPU version of port.c includes and excludes functions depending on the settings within this file. Therefore, to ensure all the functions in port.c build, this configuration file has all options turned on. */ - -#define configUSE_PREEMPTION 1 -#define configTICK_RATE_HZ ( 1000 ) -#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 -#define configUSE_QUEUE_SETS 1 -#define configUSE_IDLE_HOOK 1 -#define configUSE_TICK_HOOK 1 -#define configCPU_CLOCK_HZ 48000000 -#define configMAX_PRIORITIES ( 5 ) -#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 120 ) -#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 16 * 1024 ) ) -#define configMAX_TASK_NAME_LEN ( 10 ) -#define configUSE_TRACE_FACILITY 1 -#define configUSE_16_BIT_TICKS 0 -#define configIDLE_SHOULD_YIELD 1 -#define configUSE_MUTEXES 1 -#define configQUEUE_REGISTRY_SIZE 5 -#define configCHECK_FOR_STACK_OVERFLOW 2 -#define configUSE_RECURSIVE_MUTEXES 1 -#define configUSE_MALLOC_FAILED_HOOK 1 -#define configUSE_APPLICATION_TASK_TAG 1 -#define configUSE_COUNTING_SEMAPHORES 1 -#define configSUPPORT_STATIC_ALLOCATION 1 -#define configUSE_TICKLESS_IDLE 0 -#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 2 + +#define configUSE_PREEMPTION 1 +#define configTICK_RATE_HZ ( 1000 ) +#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 +#define configUSE_QUEUE_SETS 1 +#define configUSE_IDLE_HOOK 1 +#define configUSE_TICK_HOOK 1 +#define configCPU_CLOCK_HZ 48000000 +#define configMAX_PRIORITIES ( 5 ) +#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 120 ) +#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 16 * 1024 ) ) +#define configMAX_TASK_NAME_LEN ( 10 ) +#define configUSE_TRACE_FACILITY 1 +#define configUSE_16_BIT_TICKS 0 +#define configIDLE_SHOULD_YIELD 1 +#define configUSE_MUTEXES 1 +#define configQUEUE_REGISTRY_SIZE 5 +#define configCHECK_FOR_STACK_OVERFLOW 2 +#define configUSE_RECURSIVE_MUTEXES 1 +#define configUSE_MALLOC_FAILED_HOOK 1 +#define configUSE_APPLICATION_TASK_TAG 1 +#define configUSE_COUNTING_SEMAPHORES 1 +#define configSUPPORT_STATIC_ALLOCATION 1 +#define configUSE_TICKLESS_IDLE 0 +#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 2 /* Run time stats gathering definitions. */ -#define configGENERATE_RUN_TIME_STATS 0 +#define configGENERATE_RUN_TIME_STATS 0 #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() #define portGET_RUN_TIME_COUNTER_VALUE() @@ -82,89 +82,99 @@ build, this configuration file has all options turned on. */ format the raw data provided by the uxTaskGetSystemState() function in to human readable ASCII form. See the notes in the implementation of vTaskList() within FreeRTOS/Source/tasks.c for limitations. */ -#define configUSE_STATS_FORMATTING_FUNCTIONS 0 +#define configUSE_STATS_FORMATTING_FUNCTIONS 0 /* Co-routine definitions. */ -#define configUSE_CO_ROUTINES 0 -#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ -#define configUSE_TIMERS 1 -#define configTIMER_TASK_PRIORITY ( 2 ) -#define configTIMER_QUEUE_LENGTH 5 -#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE ) +#define configUSE_TIMERS 1 +#define configTIMER_TASK_PRIORITY ( 2 ) +#define configTIMER_QUEUE_LENGTH 5 +#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ -#define INCLUDE_vTaskPrioritySet 1 -#define INCLUDE_uxTaskPriorityGet 1 -#define INCLUDE_vTaskDelete 1 -#define INCLUDE_vTaskCleanUpResources 1 -#define INCLUDE_vTaskSuspend 1 -#define INCLUDE_vTaskDelayUntil 1 -#define INCLUDE_vTaskDelay 1 -#define INCLUDE_eTaskGetState 1 -#define INCLUDE_xTimerPendFunctionCall 0 -#define INCLUDE_xSemaphoreGetMutexHolder 1 -#define INCLUDE_xTaskGetHandle 1 -#define INCLUDE_xTaskGetCurrentTaskHandle 1 -#define INCLUDE_xTaskGetIdleTaskHandle 1 -#define INCLUDE_xTaskAbortDelay 1 -#define INCLUDE_xTaskGetSchedulerState 1 -#define INCLUDE_xTaskGetIdleTaskHandle 1 -#define INCLUDE_uxTaskGetStackHighWaterMark 1 +#define INCLUDE_vTaskPrioritySet 1 +#define INCLUDE_uxTaskPriorityGet 1 +#define INCLUDE_vTaskDelete 1 +#define INCLUDE_vTaskCleanUpResources 1 +#define INCLUDE_vTaskSuspend 1 +#define INCLUDE_vTaskDelayUntil 1 +#define INCLUDE_vTaskDelay 1 +#define INCLUDE_eTaskGetState 1 +#define INCLUDE_xTimerPendFunctionCall 0 +#define INCLUDE_xSemaphoreGetMutexHolder 1 +#define INCLUDE_xTaskGetHandle 1 +#define INCLUDE_xTaskGetCurrentTaskHandle 1 +#define INCLUDE_xTaskGetIdleTaskHandle 1 +#define INCLUDE_xTaskAbortDelay 1 +#define INCLUDE_xTaskGetSchedulerState 1 +#define INCLUDE_xTaskGetIdleTaskHandle 1 +#define INCLUDE_uxTaskGetStackHighWaterMark 1 /* Cortex-M specific definitions. */ #ifdef __NVIC_PRIO_BITS - /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */ - #define configPRIO_BITS __NVIC_PRIO_BITS + /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */ + #define configPRIO_BITS __NVIC_PRIO_BITS #else - #define configPRIO_BITS 3 /* 7 priority levels */ + #define configPRIO_BITS 3 /* 7 priority levels */ #endif /* The lowest interrupt priority that can be used in a call to a "set priority" function. */ -#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0x7 +#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0x7 /* The highest interrupt priority that can be used by any interrupt service routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER PRIORITY THAN THIS! (higher priorities are lower numeric values. */ -#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 +#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 /* Interrupt priorities used by the kernel port layer itself. These are generic to all Cortex-M ports, and do not rely on any particular library functions. */ -#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) +#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << ( 8 - configPRIO_BITS ) ) /* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ -#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) +#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << ( 8 - configPRIO_BITS ) ) +/* Set configUSE_MPU_WRAPPERS_V1 to 0 to use new MPU wrapper. + * See https://freertos.org/a00110.html#configUSE_MPU_WRAPPERS_V1 for details. */ +#define configUSE_MPU_WRAPPERS_V1 ( 0 ) +/* See https://freertos.org/a00110.html#configPROTECTED_KERNEL_OBJECT_POOL_SIZE for details. */ +#define configPROTECTED_KERNEL_OBJECT_POOL_SIZE ( 150 ) +/* See https://freertos.org/a00110.html#configSYSTEM_CALL_STACK_SIZE for details. */ +#define configSYSTEM_CALL_STACK_SIZE ( 128 ) + +#define configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY ( 1 ) +#define configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS ( 0 ) /* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS standard names. */ -#define xPortPendSVHandler PendSV_Handler -#define vPortSVCHandler SVC_Handler -#define xPortSysTickHandler SysTick_Handler +#define xPortPendSVHandler PendSV_Handler +#define vPortSVCHandler SVC_Handler +#define xPortSysTickHandler SysTick_Handler /* Normal assert() semantics without relying on the provision of an assert.h header file. */ -#define configASSERT( x ) if( ( x ) == 0UL ) { taskDISABLE_INTERRUPTS(); for( ;; ); } +#define configASSERT( x ) if( ! ( x ) ) { taskDISABLE_INTERRUPTS(); for( ;; ); } /* LED not used at present, so just increment a variable to keep a count of the number of times the LED would otherwise have been toggled. */ -#define configTOGGLE_LED() ulLED++ +#define configTOGGLE_LED() ulLED++ /* Definitions for the messages that can be sent to the check task. */ -#define configREG_TEST_1_STILL_EXECUTING ( 0 ) -#define configREG_TEST_2_STILL_EXECUTING ( 1 ) -#define configTIMER_STILL_EXECUTING ( 2 ) -#define configPRINT_SYSTEM_STATUS ( 3 ) +#define configREG_TEST_1_STILL_EXECUTING ( 0 ) +#define configREG_TEST_2_STILL_EXECUTING ( 1 ) +#define configTIMER_STILL_EXECUTING ( 2 ) +#define configPRINT_SYSTEM_STATUS ( 3 ) /* Parameters that are passed into the third and fourth register check tasks solely for the purpose of ensuring parameters are passed into tasks correctly. */ -#define configREG_TEST_TASK_1_PARAMETER ( ( void * ) 0x11112222 ) -#define configREG_TEST_TASK_3_PARAMETER ( ( void * ) 0x12345678 ) -#define configREG_TEST_TASK_4_PARAMETER ( ( void * ) 0x87654321 ) +#define configREG_TEST_TASK_1_PARAMETER ( ( void * ) 0x11112222 ) +#define configREG_TEST_TASK_3_PARAMETER ( ( void * ) 0x12345678 ) +#define configREG_TEST_TASK_4_PARAMETER ( ( void * ) 0x87654321 ) #ifdef __cplusplus } diff --git a/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/GCC_Specific/RTOSDemo.uvoptx b/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/GCC_Specific/RTOSDemo.uvoptx index 238905024..9e5938baa 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/GCC_Specific/RTOSDemo.uvoptx +++ b/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/GCC_Specific/RTOSDemo.uvoptx @@ -10,7 +10,7 @@ *.obj; *.o *.lib - *.txt; *.h; *.inc + *.txt; *.h; *.inc; *.md *.plm *.cpp 0 @@ -101,6 +101,8 @@ 0 0 1 + 0 + 0 0 @@ -151,72 +153,7 @@ -UV1115SAE -O3047 -S0 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO19 -TC48000000 -TP21 -TDS8028 -TDT0 -TDC1F -TIE1 -TIP8 -FO11 -FD118000 -FC8000 -FN1 -FF0NEW_DEVICE.FLM -FS0E0000 -FL038000 -FP0($$Device:ARMCM4_FP$Device\ARM\Flash\NEW_DEVICE.FLM) - - - 0 - 0 - 2428 - 1 -
926184
- 0 - 0 - 0 - 0 - 0 - 1 - C:\E\Dev\FreeRTOS\Trial\Active\Microchip_CEC1302\WorkingCopy\Source\tasks.c - - \\RTOSDemo\../../../Source/tasks.c\2428 -
- - 1 - 0 - 851 - 1 -
953140
- 0 - 0 - 0 - 0 - 0 - 1 - C:\E\Dev\FreeRTOS\Trial\Active\Microchip_CEC1302\WorkingCopy\Demo\CORTEX_MPU_MEC1701_Keil_GCC\main.c - - \\RTOSDemo\../main.c\851 -
- - 2 - 0 - 307 - 1 -
939148
- 0 - 0 - 0 - 0 - 0 - 1 - C:\E\Dev\FreeRTOS\Trial\Active\Microchip_CEC1302\WorkingCopy\Source\portable\GCC\ARM_CM4_MPU\port.c - - \\RTOSDemo\../../../Source/portable/GCC/ARM_CM4_MPU/port.c\307 -
- - 3 - 0 - 916 - 1 -
953232
- 0 - 0 - 0 - 0 - 0 - 1 - C:\E\Dev\FreeRTOS\Trial\Active\Microchip_CEC1302\WorkingCopy\Demo\CORTEX_MPU_MEC1701_Keil_GCC\main.c - - \\RTOSDemo\../main.c\916 -
-
+ 0 @@ -244,14 +181,6 @@ xSchedulerRunning - - - 1 - 2 - 0x100000 - 4 - - 0 @@ -296,6 +225,7 @@ 1 + 0 0 2 10000000 @@ -305,7 +235,7 @@ System - 1 + 0 0 0 0 @@ -337,7 +267,7 @@ main_and_config - 1 + 0 0 0 0 @@ -381,7 +311,7 @@ FreeRTOS_Source - 1 + 0 0 0 0 @@ -476,6 +406,18 @@ 0 0 0 + ..\..\..\Source\portable\Common\mpu_wrappers_v2.c + mpu_wrappers_v2.c + 0 + 0 + + + 3 + 14 + 1 + 0 + 0 + 0 ..\..\..\Source\portable\GCC\ARM_CM4_MPU\port.c port.c 0 @@ -483,7 +425,19 @@ 3 - 14 + 15 + 1 + 0 + 0 + 0 + ..\..\..\Source\portable\GCC\ARM_CM4_MPU\mpu_wrappers_v2_asm.c + mpu_wrappers_v2_asm.c + 0 + 0 + + + 3 + 16 1 0 0 @@ -497,13 +451,13 @@ peripheral_library - 1 + 0 0 0 0 4 - 15 + 17 1 0 0 @@ -515,7 +469,7 @@ 4 - 16 + 18 1 0 0 @@ -527,7 +481,7 @@ 4 - 17 + 19 1 0 0 @@ -539,7 +493,7 @@ 4 - 18 + 20 1 0 0 @@ -551,7 +505,7 @@ 4 - 19 + 21 1 0 0 @@ -563,7 +517,7 @@ 4 - 20 + 22 1 0 0 @@ -575,7 +529,7 @@ 4 - 21 + 23 1 0 0 @@ -587,7 +541,7 @@ 4 - 22 + 24 1 0 0 diff --git a/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/GCC_Specific/RTOSDemo.uvprojx b/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/GCC_Specific/RTOSDemo.uvprojx index 1a137e0ee..2f2a4ea0a 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/GCC_Specific/RTOSDemo.uvprojx +++ b/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/GCC_Specific/RTOSDemo.uvprojx @@ -15,7 +15,7 @@ ARMCM4_FP ARM - ARM.CMSIS.5.0.1 + ARM.CMSIS.5.9.0 http://www.keil.com/pack/ IROM(0x00000000,0x80000) IRAM(0x20000000,0x20000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ESEL ELITTLE @@ -167,6 +167,9 @@ 0 0 2 + 0 + 0 + 0 0 0 @@ -235,7 +238,7 @@ 0 0 1 - 3 + 2 1 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -ffunction-sections -fdata-sections -O0 -g @@ -344,11 +347,21 @@ 1 ..\..\..\Source\portable\Common\mpu_wrappers.c + + mpu_wrappers_v2.c + 1 + ..\..\..\Source\portable\Common\mpu_wrappers_v2.c + port.c 1 ..\..\..\Source\portable\GCC\ARM_CM4_MPU\port.c + + mpu_wrappers_v2_asm.c + 1 + ..\..\..\Source\portable\GCC\ARM_CM4_MPU\mpu_wrappers_v2_asm.c + stream_buffer.c 1 diff --git a/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/GCC_Specific/RegTest.c b/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/GCC_Specific/RegTest.c index c054195be..57412954d 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/GCC_Specific/RegTest.c +++ b/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/GCC_Specific/RegTest.c @@ -626,6 +626,7 @@ void HardFault_Handler( void ) " ldr r1, [r0, #24] \n" " ldr r2, handler_address_const \n" " bx r2 \n" + " .align 4 \n" " handler_address_const: .word hard_fault_handler \n" ); } @@ -643,6 +644,7 @@ void MemManage_Handler( void ) " ldr r1, [r0, #24] \n" " ldr r2, handler2_address_const \n" " bx r2 \n" + " .align 4 \n" " handler2_address_const: .word hard_fault_handler \n" ); }/*-----------------------------------------------------------*/ diff --git a/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/GCC_Specific/sections.ld b/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/GCC_Specific/sections.ld index 644cd6230..77c7b2d9d 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/GCC_Specific/sections.ld +++ b/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/GCC_Specific/sections.ld @@ -20,8 +20,8 @@ MEMORY } /* Variables used by FreeRTOS-MPU. */ -_Privileged_Functions_Region_Size = 32K; -_Privileged_Data_Region_Size = 512; +_Privileged_Functions_Region_Size = 64K; +_Privileged_Data_Region_Size = 32K; __FLASH_segment_start__ = ORIGIN( ROM ); __FLASH_segment_end__ = __FLASH_segment_start__ + LENGTH( ROM ); @@ -85,28 +85,32 @@ SECTIONS * For Cortex-M devices, the beginning of the startup code is stored in * the .isr_vector section, which goes to ROM */ - .isr_vector : - { - . = ALIGN(4); - _isr_vector = .; - KEEP(*(.isr_vector)) - } >ROM + .isr_vector : + { + . = ALIGN(4); + _isr_vector = .; + KEEP(*(.isr_vector)) + } >ROM - privileged_functions : - { - . = ALIGN(4); - *(privileged_functions) - - /* Non privileged code is after _Privileged_Functions_Region_Size. */ - __privileged_functions_actual_end__ = .; - . = _Privileged_Functions_Region_Size; - } > ROM + privileged_functions : + { + . = ALIGN(4); + *(privileged_functions) + + /* Non privileged code is after _Privileged_Functions_Region_Size. */ + __privileged_functions_actual_end__ = .; + . = _Privileged_Functions_Region_Size; + } > ROM .text : { . = ALIGN(4); + /* Place the FreeRTOS System Calls first in the unprivileged region. */ + __syscalls_flash_start__ = .; + *(freertos_system_calls) + __syscalls_flash_end__ = .; /* * This section is here for convenience, to store the @@ -233,14 +237,14 @@ SECTIONS */ - privileged_data : - { - *(privileged_data) - /* Non kernel data is kept out of the first _Privileged_Data_Region_Size - bytes of SRAM. */ - __privileged_data_actual_end__ = .; - . = _Privileged_Data_Region_Size; - } > RAM + privileged_data : + { + *(privileged_data) + /* Non kernel data is kept out of the first _Privileged_Data_Region_Size + bytes of SRAM. */ + __privileged_data_actual_end__ = .; + . = _Privileged_Data_Region_Size; + } > RAM /* * The initialised data section. @@ -254,7 +258,7 @@ SECTIONS . = ALIGN(4); /* This is used by the startup code to initialise the .data section */ - _sdata = . ; /* STM specific definition */ + _sdata = . ; /* STM specific definition */ __data_start__ = . ; *(.data_begin .data_begin.*) @@ -264,7 +268,7 @@ SECTIONS . = ALIGN(4); /* This is used by the startup code to initialise the .data section */ - _edata = . ; /* STM specific definition */ + _edata = . ; /* STM specific definition */ __data_end__ = . ; } >RAM diff --git a/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/Keil_Specific/RTOSDemo.sct b/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/Keil_Specific/RTOSDemo.sct index d4b4063cb..8cbe1961c 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/Keil_Specific/RTOSDemo.sct +++ b/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/Keil_Specific/RTOSDemo.sct @@ -5,22 +5,26 @@ LR_IROM1 0xE0000 0x40000 ; load region size_region { - ER_PRIVILEGED_FUNCTIONS 0xE0000 0x8000 { + ER_PRIVILEGED_FUNCTIONS 0xE0000 { *.o (RESET, +First) startup_MPS_CM4.o *(InRoot$$Sections) *( privileged_functions ) } - ER_UNPRIVILEGED_FUNCTIONS 0xE8000 0x18000 { + ER_FREERTOS_SYSTEM_CALLS 0xF0000 FIXED { + *(freertos_system_calls) + } + + ER_UNPRIVILEGED_FUNCTIONS +0 { .ANY (+RO) } - RW_PRIVILEGED_DATA 0x100000 0x200 { + RW_PRIVILEGED_DATA 0x100000 { *( privileged_data ) } - RW_UNPRIVILEGED_DATA 0x100200 0x1FE00 { + RW_UNPRIVILEGED_DATA 0x108000 { .ANY (+RW +ZI) } } diff --git a/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/Keil_Specific/RTOSDemo.uvoptx b/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/Keil_Specific/RTOSDemo.uvoptx index dd3248d69..30a093e8f 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/Keil_Specific/RTOSDemo.uvoptx +++ b/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/Keil_Specific/RTOSDemo.uvoptx @@ -10,7 +10,7 @@ *.s*; *.src; *.a* *.obj; *.o *.lib - *.txt; *.h; *.inc + *.txt; *.h; *.inc; *.md *.plm *.cpp 0 @@ -101,6 +101,8 @@ 0 0 1 + 0 + 0 0 @@ -209,7 +211,7 @@ System - 1 + 0 0 0 0 @@ -229,7 +231,7 @@ main_and_config - 1 + 0 0 0 0 @@ -273,7 +275,7 @@ FreeRTOS_Source - 1 + 0 0 0 0 @@ -368,6 +370,18 @@ 0 0 0 + ..\..\..\Source\portable\RVDS\ARM_CM4_MPU\mpu_wrappers_v2_asm.c + mpu_wrappers_v2_asm.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 ..\..\..\Source\portable\Common\mpu_wrappers.c mpu_wrappers.c 0 @@ -375,7 +389,19 @@ 3 - 13 + 14 + 1 + 0 + 0 + 0 + ..\..\..\Source\portable\Common\mpu_wrappers_v2.c + mpu_wrappers_v2.c + 0 + 0 + + + 3 + 15 1 0 0 @@ -389,13 +415,13 @@ peripheral_library - 1 + 0 0 0 0 4 - 14 + 16 1 0 0 @@ -407,7 +433,7 @@ 4 - 15 + 17 1 0 0 @@ -419,7 +445,7 @@ 4 - 16 + 18 1 0 0 @@ -431,7 +457,7 @@ 4 - 17 + 19 1 0 0 @@ -443,7 +469,7 @@ 4 - 18 + 20 1 0 0 @@ -455,7 +481,7 @@ 4 - 19 + 21 1 0 0 @@ -467,7 +493,7 @@ 4 - 20 + 22 1 0 0 @@ -479,7 +505,7 @@ 4 - 21 + 23 1 0 0 diff --git a/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/Keil_Specific/RTOSDemo.uvprojx b/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/Keil_Specific/RTOSDemo.uvprojx index be9875133..ed14f58fe 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/Keil_Specific/RTOSDemo.uvprojx +++ b/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/Keil_Specific/RTOSDemo.uvprojx @@ -10,13 +10,13 @@ RTOSDemo 0x4 ARM-ADS - 5060528::V5.06 update 5 (build 528)::ARMCC + 5060960::V5.06 update 7 (build 960)::..\..\Program Files (x86)\ARM_Compiler_5.06u7 0 ARMCM4_FP ARM - ARM.CMSIS.5.0.1 + ARM.CMSIS.5.9.0 http://www.keil.com/pack/ IROM(0x00000000,0x80000) IRAM(0x20000000,0x20000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ESEL ELITTLE @@ -184,6 +184,9 @@ 0 0 2 + 0 + 0 + 0 0 0 8 @@ -324,6 +327,7 @@ 0 0 0 + 0 0 0 0 @@ -349,7 +353,7 @@ 0 0 0 - 0 + 4 @@ -445,11 +449,21 @@ 1 ..\..\..\Source\portable\RVDS\ARM_CM4_MPU\port.c + + mpu_wrappers_v2_asm.c + 1 + ..\..\..\Source\portable\RVDS\ARM_CM4_MPU\mpu_wrappers_v2_asm.c + mpu_wrappers.c 1 ..\..\..\Source\portable\Common\mpu_wrappers.c + + mpu_wrappers_v2.c + 1 + ..\..\..\Source\portable\Common\mpu_wrappers_v2.c + stream_buffer.c 1 diff --git a/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/main.c b/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/main.c index bdbfa2fed..c8fd35b9a 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/main.c +++ b/FreeRTOS/Demo/CORTEX_MPU_CEC_MEC_17xx_51xx_Keil_GCC/main.c @@ -230,14 +230,19 @@ static TimerHandle_t xTimer = NULL; extern uint32_t __privileged_functions_actual_end__[]; extern uint32_t __privileged_data_actual_end__[]; #else + extern uint32_t Image$$ER_FREERTOS_SYSTEM_CALLS$$Base; + extern uint32_t Image$$ER_FREERTOS_SYSTEM_CALLS$$Limit; + const uint32_t * __FLASH_segment_start__ = ( uint32_t * ) 0xE0000UL; const uint32_t * __FLASH_segment_end__ = ( uint32_t * ) 0x100000UL; const uint32_t * __SRAM_segment_start__ = ( uint32_t * ) 0x100000UL; - const uint32_t * __SRAM_segment_end__ = ( uint32_t * ) 0x120000; + const uint32_t * __SRAM_segment_end__ = ( uint32_t * ) 0x120000UL; const uint32_t * __privileged_functions_start__ = ( uint32_t * ) 0xE0000UL; - const uint32_t * __privileged_functions_end__ = ( uint32_t * ) 0xE4000UL; + const uint32_t * __privileged_functions_end__ = ( uint32_t * ) 0xF0000UL; + const uint32_t * __syscalls_flash_start__ = ( uint32_t * ) &( Image$$ER_FREERTOS_SYSTEM_CALLS$$Base ); + const uint32_t * __syscalls_flash_end__ = ( uint32_t * ) &( Image$$ER_FREERTOS_SYSTEM_CALLS$$Limit ); const uint32_t * __privileged_data_start__ = ( uint32_t * ) 0x100000UL; - const uint32_t * __privileged_data_end__ = ( uint32_t * ) 0x100200UL; + const uint32_t * __privileged_data_end__ = ( uint32_t * ) 0x108000UL; #endif /*-----------------------------------------------------------*/ /* Data used by the 'check' task. ---------------------------*/ diff --git a/FreeRTOS/Demo/CORTEX_MPU_LPC54018_MCUXpresso/Config/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPU_LPC54018_MCUXpresso/Config/FreeRTOSConfig.h index 9178e590c..d1ee25674 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_LPC54018_MCUXpresso/Config/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_LPC54018_MCUXpresso/Config/FreeRTOSConfig.h @@ -148,6 +148,14 @@ to all Cortex-M ports, and do not rely on any particular library functions. */ See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ #define configMAX_SYSCALL_INTERRUPT_PRIORITY (configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS)) +/* Set configUSE_MPU_WRAPPERS_V1 to 0 to use new MPU wrapper. + * See https://freertos.org/a00110.html#configUSE_MPU_WRAPPERS_V1 for details. */ +#define configUSE_MPU_WRAPPERS_V1 ( 0 ) +/* See https://freertos.org/a00110.html#configPROTECTED_KERNEL_OBJECT_POOL_SIZE for details. */ +#define configPROTECTED_KERNEL_OBJECT_POOL_SIZE ( 150 ) +/* See https://freertos.org/a00110.html#configSYSTEM_CALL_STACK_SIZE for details. */ +#define configSYSTEM_CALL_STACK_SIZE ( 128 ) + /* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS standard names. */ #define vPortSVCHandler SVC_Handler @@ -157,4 +165,7 @@ standard names. */ /* Ensure that system calls can only be made from kernel code. */ #define configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY 1 +/* Do not allow unprivileged critical sections. */ +#define configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS 0 + #endif /* FREERTOS_CONFIG_H */ diff --git a/FreeRTOS/Demo/CORTEX_MPU_LPC54018_MCUXpresso/NXP_Code/utilities/freertos_tasks_c_additions.h b/FreeRTOS/Demo/CORTEX_MPU_LPC54018_MCUXpresso/NXP_Code/utilities/freertos_tasks_c_additions.h index 00f564633..0d1a6e8ef 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_LPC54018_MCUXpresso/NXP_Code/utilities/freertos_tasks_c_additions.h +++ b/FreeRTOS/Demo/CORTEX_MPU_LPC54018_MCUXpresso/NXP_Code/utilities/freertos_tasks_c_additions.h @@ -96,15 +96,15 @@ const uint8_t FreeRTOSDebugConfig[] = configFRTOS_MEMORY_SCHEME, offsetof(struct tskTaskControlBlock, pxTopOfStack), #if (tskKERNEL_VERSION_MAJOR > 8) - offsetof(struct tskTaskControlBlock, xStateListItem), + (uint8_t)offsetof(struct tskTaskControlBlock, xStateListItem), #else offsetof(struct tskTaskControlBlock, xGenericListItem), #endif - offsetof(struct tskTaskControlBlock, xEventListItem), - offsetof(struct tskTaskControlBlock, pxStack), - offsetof(struct tskTaskControlBlock, pcTaskName), - offsetof(struct tskTaskControlBlock, uxTCBNumber), - offsetof(struct tskTaskControlBlock, uxTaskNumber), + (uint8_t)offsetof(struct tskTaskControlBlock, xEventListItem), + (uint8_t)offsetof(struct tskTaskControlBlock, pxStack), + (uint8_t)offsetof(struct tskTaskControlBlock, pcTaskName), + (uint8_t)offsetof(struct tskTaskControlBlock, uxTCBNumber), + (uint8_t)offsetof(struct tskTaskControlBlock, uxTaskNumber), configMAX_TASK_NAME_LEN, configMAX_PRIORITIES, configENABLE_MPU, diff --git a/FreeRTOS/Demo/CORTEX_MPU_LPC54018_MCUXpresso/Projects/MCUXpresso/.settings/org.eclipse.core.resources.prefs b/FreeRTOS/Demo/CORTEX_MPU_LPC54018_MCUXpresso/Projects/MCUXpresso/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_MPU_LPC54018_MCUXpresso/Projects/MCUXpresso/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/FreeRTOS/Demo/CORTEX_MPU_LPC54018_MCUXpresso/Projects/MCUXpresso/FreeRTOSDemo.ld b/FreeRTOS/Demo/CORTEX_MPU_LPC54018_MCUXpresso/Projects/MCUXpresso/FreeRTOSDemo.ld index 580fd4e47..bca0bf584 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_LPC54018_MCUXpresso/Projects/MCUXpresso/FreeRTOSDemo.ld +++ b/FreeRTOS/Demo/CORTEX_MPU_LPC54018_MCUXpresso/Projects/MCUXpresso/FreeRTOSDemo.ld @@ -36,7 +36,7 @@ MEMORY /* Initial 32K SRAMX_CODE is used to store kernel functions and * initial 16K bytes of SRAM_0_1_2_3 is used to store kernel data. */ -__privileged_functions_region_size__ = 32K; +__privileged_functions_region_size__ = 64K; __privileged_data_region_size__ = 16K; /* Symbols needed by the MPU setup code. */ diff --git a/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects/IAR/Config/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects/IAR/Config/FreeRTOSConfig.h index 51d626a9f..f2f40a118 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects/IAR/Config/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects/IAR/Config/FreeRTOSConfig.h @@ -146,6 +146,14 @@ * to all Cortex-M ports, and do not rely on any particular library functions. */ #define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << ( 8 - configPRIO_BITS ) ) +/* Set configUSE_MPU_WRAPPERS_V1 to 0 to use new MPU wrapper. + * See https://freertos.org/a00110.html#configUSE_MPU_WRAPPERS_V1 for details. */ +#define configUSE_MPU_WRAPPERS_V1 ( 0 ) +/* See https://freertos.org/a00110.html#configPROTECTED_KERNEL_OBJECT_POOL_SIZE for details. */ +#define configPROTECTED_KERNEL_OBJECT_POOL_SIZE ( 150 ) +/* See https://freertos.org/a00110.html#configSYSTEM_CALL_STACK_SIZE for details. */ +#define configSYSTEM_CALL_STACK_SIZE ( 128 ) + /* The #ifdef guards against the file being included from IAR assembly files. */ #ifndef __IASMARM__ diff --git a/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects/IAR/NonSecure/FreeRTOSDemo_ns.ewp b/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects/IAR/NonSecure/FreeRTOSDemo_ns.ewp index d6839b9c1..1ab1a0707 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects/IAR/NonSecure/FreeRTOSDemo_ns.ewp +++ b/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects/IAR/NonSecure/FreeRTOSDemo_ns.ewp @@ -1152,6 +1152,9 @@ $PROJ_DIR$\..\..\..\..\..\Source\portable\Common\mpu_wrappers.c + + $PROJ_DIR$\..\..\..\..\..\Source\portable\Common\mpu_wrappers_v2.c + $PROJ_DIR$\..\..\..\..\..\Source\portable\IAR\ARM_CM23\non_secure\port.c @@ -1161,6 +1164,9 @@ $PROJ_DIR$\..\..\..\..\..\Source\portable\IAR\ARM_CM23\non_secure\portasm.s + + $PROJ_DIR$\..\..\..\..\..\Source\portable\IAR\ARM_CM23\non_secure\mpu_wrappers_v2_asm.S + $PROJ_DIR$\..\..\..\..\..\Source\portable\IAR\ARM_CM23\non_secure\portmacro.h diff --git a/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects/Keil/Config/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects/Keil/Config/FreeRTOSConfig.h index 05a93655c..8a7bfadba 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects/Keil/Config/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects/Keil/Config/FreeRTOSConfig.h @@ -141,6 +141,14 @@ extern uint32_t SystemCoreClock; * to all Cortex-M ports, and do not rely on any particular library functions. */ #define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << ( 8 - configPRIO_BITS ) ) +/* Set configUSE_MPU_WRAPPERS_V1 to 0 to use new MPU wrapper. + * See https://freertos.org/a00110.html#configUSE_MPU_WRAPPERS_V1 for details. */ +#define configUSE_MPU_WRAPPERS_V1 ( 0 ) +/* See https://freertos.org/a00110.html#configPROTECTED_KERNEL_OBJECT_POOL_SIZE for details. */ +#define configPROTECTED_KERNEL_OBJECT_POOL_SIZE ( 150 ) +/* See https://freertos.org/a00110.html#configSYSTEM_CALL_STACK_SIZE for details. */ +#define configSYSTEM_CALL_STACK_SIZE ( 128 ) + /* The #ifdef guards against the file being included from IAR assembly files. */ #ifndef __IASMARM__ diff --git a/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects/Keil/NonSecure/FreeRTOSDemo_ns.uvoptx b/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects/Keil/NonSecure/FreeRTOSDemo_ns.uvoptx index a4e011e60..b6fd6c85f 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects/Keil/NonSecure/FreeRTOSDemo_ns.uvoptx +++ b/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects/Keil/NonSecure/FreeRTOSDemo_ns.uvoptx @@ -409,6 +409,18 @@ 0 0 0 + ..\..\..\..\..\Source\portable\Common\mpu_wrappers_v2.c + mpu_wrappers_v2.c + 0 + 0 + + + 4 + 17 + 1 + 0 + 0 + 0 ..\..\..\..\..\Source\portable\GCC\ARM_CM23\non_secure\port.c port.c 0 @@ -416,7 +428,7 @@ 4 - 17 + 18 1 0 0 @@ -428,7 +440,19 @@ 4 - 18 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Source\portable\GCC\ARM_CM23\non_secure\mpu_wrappers_v2_asm.c + mpu_wrappers_v2_asm.c + 0 + 0 + + + 4 + 20 5 0 0 @@ -440,7 +464,7 @@ 4 - 19 + 21 5 0 0 @@ -460,7 +484,7 @@ 0 5 - 20 + 22 5 0 0 @@ -472,7 +496,7 @@ 5 - 21 + 23 1 0 0 @@ -484,7 +508,7 @@ 5 - 22 + 24 5 0 0 @@ -496,7 +520,7 @@ 5 - 23 + 25 1 0 0 @@ -508,7 +532,7 @@ 5 - 24 + 26 1 0 0 @@ -520,7 +544,7 @@ 5 - 25 + 27 5 0 0 @@ -532,7 +556,7 @@ 5 - 26 + 28 1 0 0 @@ -544,7 +568,7 @@ 5 - 27 + 29 5 0 0 @@ -564,7 +588,7 @@ 0 6 - 28 + 30 1 0 0 diff --git a/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects/Keil/NonSecure/FreeRTOSDemo_ns.uvprojx b/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects/Keil/NonSecure/FreeRTOSDemo_ns.uvprojx index 02f216bff..d69d374bd 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects/Keil/NonSecure/FreeRTOSDemo_ns.uvprojx +++ b/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects/Keil/NonSecure/FreeRTOSDemo_ns.uvprojx @@ -16,7 +16,7 @@ M2351KIAAEES Nuvoton - Nuvoton.NuMicro_DFP.1.3.19 + Nuvoton.NuMicro_DFP.1.3.20 https://github.com/OpenNuvoton/cmsis-packs/raw/master/Nuvoton_DFP/ IRAM(0x20000000,0x18000) IROM(0x00000000,0x00080000) CPUTYPE("ARMV8MBL") TZ CLOCK(12000000) ESEL ELITTLE @@ -474,6 +474,11 @@ 1 ..\..\..\..\..\Source\portable\Common\mpu_wrappers.c + + mpu_wrappers_v2.c + 1 + ..\..\..\..\..\Source\portable\Common\mpu_wrappers_v2.c + port.c 1 @@ -484,6 +489,11 @@ 1 ..\..\..\..\..\Source\portable\GCC\ARM_CM23\non_secure\portasm.c + + mpu_wrappers_v2_asm.c + 1 + ..\..\..\..\..\Source\portable\GCC\ARM_CM23\non_secure\mpu_wrappers_v2_asm.c + portasm.h 5 diff --git a/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects/Keil/Secure/FreeRTOSDemo_s.uvprojx b/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects/Keil/Secure/FreeRTOSDemo_s.uvprojx index 1f6c9dab0..1935b660d 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects/Keil/Secure/FreeRTOSDemo_s.uvprojx +++ b/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects/Keil/Secure/FreeRTOSDemo_s.uvprojx @@ -16,7 +16,7 @@ M2351KIAAEES Nuvoton - Nuvoton.NuMicro_DFP.1.3.19 + Nuvoton.NuMicro_DFP.1.3.20 https://github.com/OpenNuvoton/cmsis-packs/raw/master/Nuvoton_DFP/ IRAM(0x20000000,0x18000) IROM(0x00000000,0x00080000) CPUTYPE("ARMV8MBL") TZ CLOCK(12000000) ESEL ELITTLE diff --git a/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects_NTZ/IAR/Config/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects_NTZ/IAR/Config/FreeRTOSConfig.h index 5ba177214..63d7a9da4 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects_NTZ/IAR/Config/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects_NTZ/IAR/Config/FreeRTOSConfig.h @@ -146,6 +146,14 @@ * to all Cortex-M ports, and do not rely on any particular library functions. */ #define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << ( 8 - configPRIO_BITS ) ) +/* Set configUSE_MPU_WRAPPERS_V1 to 0 to use new MPU wrapper. + * See https://freertos.org/a00110.html#configUSE_MPU_WRAPPERS_V1 for details. */ +#define configUSE_MPU_WRAPPERS_V1 ( 0 ) +/* See https://freertos.org/a00110.html#configPROTECTED_KERNEL_OBJECT_POOL_SIZE for details. */ +#define configPROTECTED_KERNEL_OBJECT_POOL_SIZE ( 150 ) +/* See https://freertos.org/a00110.html#configSYSTEM_CALL_STACK_SIZE for details. */ +#define configSYSTEM_CALL_STACK_SIZE ( 128 ) + /* The #ifdef guards against the file being included from IAR assembly files. */ #ifndef __IASMARM__ diff --git a/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects_NTZ/IAR/FreeRTOSDemo.ewd b/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects_NTZ/IAR/FreeRTOSDemo.ewd index 8491b4e1a..722af9eac 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects_NTZ/IAR/FreeRTOSDemo.ewd +++ b/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects_NTZ/IAR/FreeRTOSDemo.ewd @@ -44,7 +44,7 @@ IAR ARM_CM23_NTZ + + $PROJ_DIR$\..\..\..\..\Source\portable\IAR\ARM_CM23_NTZ\non_secure\mpu_wrappers_v2_asm.S + $PROJ_DIR$\..\..\..\..\Source\portable\IAR\ARM_CM23_NTZ\non_secure\port.c diff --git a/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects_NTZ/Keil/Config/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects_NTZ/Keil/Config/FreeRTOSConfig.h index ee4d24ca6..4bf648148 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects_NTZ/Keil/Config/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects_NTZ/Keil/Config/FreeRTOSConfig.h @@ -141,6 +141,14 @@ extern uint32_t SystemCoreClock; * to all Cortex-M ports, and do not rely on any particular library functions. */ #define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << ( 8 - configPRIO_BITS ) ) +/* Set configUSE_MPU_WRAPPERS_V1 to 0 to use new MPU wrapper. + * See https://freertos.org/a00110.html#configUSE_MPU_WRAPPERS_V1 for details. */ +#define configUSE_MPU_WRAPPERS_V1 ( 0 ) +/* See https://freertos.org/a00110.html#configPROTECTED_KERNEL_OBJECT_POOL_SIZE for details. */ +#define configPROTECTED_KERNEL_OBJECT_POOL_SIZE ( 150 ) +/* See https://freertos.org/a00110.html#configSYSTEM_CALL_STACK_SIZE for details. */ +#define configSYSTEM_CALL_STACK_SIZE ( 128 ) + /* The #ifdef guards against the file being included from IAR assembly files. */ #ifndef __IASMARM__ diff --git a/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects_NTZ/Keil/FreeRTOSDemo.uvoptx b/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects_NTZ/Keil/FreeRTOSDemo.uvoptx index 6c5549d78..27903251c 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects_NTZ/Keil/FreeRTOSDemo.uvoptx +++ b/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects_NTZ/Keil/FreeRTOSDemo.uvoptx @@ -385,6 +385,18 @@ 4 15 + 1 + 0 + 0 + 0 + ..\..\..\..\Source\portable\GCC\ARM_CM23_NTZ\non_secure\mpu_wrappers_v2_asm.c + mpu_wrappers_v2_asm.c + 0 + 0 + + + 4 + 16 5 0 0 @@ -396,7 +408,7 @@ 4 - 16 + 17 5 0 0 @@ -408,7 +420,7 @@ 4 - 17 + 18 5 0 0 @@ -420,7 +432,7 @@ 4 - 18 + 19 1 0 0 @@ -432,7 +444,7 @@ 4 - 19 + 20 1 0 0 @@ -442,6 +454,18 @@ 0 0 + + 4 + 21 + 1 + 0 + 0 + 0 + ..\..\..\..\Source\portable\Common\mpu_wrappers_v2.c + mpu_wrappers_v2.c + 0 + 0 + @@ -452,7 +476,7 @@ 0 5 - 20 + 22 1 0 0 @@ -464,7 +488,7 @@ 5 - 21 + 23 5 0 0 @@ -476,7 +500,7 @@ 5 - 22 + 24 1 0 0 @@ -488,7 +512,7 @@ 5 - 23 + 25 5 0 0 @@ -508,7 +532,7 @@ 0 6 - 24 + 26 1 0 0 @@ -520,7 +544,7 @@ 6 - 25 + 27 1 0 0 @@ -532,7 +556,7 @@ 6 - 26 + 28 5 0 0 diff --git a/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects_NTZ/Keil/FreeRTOSDemo.uvprojx b/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects_NTZ/Keil/FreeRTOSDemo.uvprojx index 6f68fa4b8..b9c71c1e3 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects_NTZ/Keil/FreeRTOSDemo.uvprojx +++ b/FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Projects_NTZ/Keil/FreeRTOSDemo.uvprojx @@ -16,7 +16,7 @@ M2351KIAAEES Nuvoton - Nuvoton.NuMicro_DFP.1.3.19 + Nuvoton.NuMicro_DFP.1.3.20 https://github.com/OpenNuvoton/cmsis-packs/raw/master/Nuvoton_DFP/ IRAM(0x20000000,0x18000) IROM(0x00000000,0x00080000) CPUTYPE("ARMV8MBL") TZ CLOCK(12000000) ESEL ELITTLE @@ -469,6 +469,11 @@ 1 ..\..\..\..\Source\portable\GCC\ARM_CM23_NTZ\non_secure\portasm.c + + mpu_wrappers_v2_asm.c + 1 + ..\..\..\..\Source\portable\GCC\ARM_CM23_NTZ\non_secure\mpu_wrappers_v2_asm.c + portasm.h 5 @@ -494,6 +499,11 @@ 1 ..\..\..\..\Source\portable\Common\mpu_wrappers.c + + mpu_wrappers_v2.c + 1 + ..\..\..\..\Source\portable\Common\mpu_wrappers_v2.c + diff --git a/FreeRTOS/Demo/CORTEX_MPU_M33F_NTZ_Nordic_NRF9160_SES/Config/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPU_M33F_NTZ_Nordic_NRF9160_SES/Config/FreeRTOSConfig.h index 923bb8179..391a62949 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M33F_NTZ_Nordic_NRF9160_SES/Config/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_M33F_NTZ_Nordic_NRF9160_SES/Config/FreeRTOSConfig.h @@ -157,6 +157,14 @@ extern uint32_t SystemCoreClock; * See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ #define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << ( 8 - configPRIO_BITS ) ) +/* Set configUSE_MPU_WRAPPERS_V1 to 0 to use new MPU wrapper. + * See https://freertos.org/a00110.html#configUSE_MPU_WRAPPERS_V1 for details. */ +#define configUSE_MPU_WRAPPERS_V1 ( 0 ) +/* See https://freertos.org/a00110.html#configPROTECTED_KERNEL_OBJECT_POOL_SIZE for details. */ +#define configPROTECTED_KERNEL_OBJECT_POOL_SIZE ( 150 ) +/* See https://freertos.org/a00110.html#configSYSTEM_CALL_STACK_SIZE for details. */ +#define configSYSTEM_CALL_STACK_SIZE ( 128 ) + /* Constants related to the generation of run time stats. */ #define configGENERATE_RUN_TIME_STATS 0 #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() diff --git a/FreeRTOS/Demo/CORTEX_MPU_M33F_NTZ_Nordic_NRF9160_SES/FreeRTOSDemo.emProject b/FreeRTOS/Demo/CORTEX_MPU_M33F_NTZ_Nordic_NRF9160_SES/FreeRTOSDemo.emProject index 0eae156f3..0dc66229e 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M33F_NTZ_Nordic_NRF9160_SES/FreeRTOSDemo.emProject +++ b/FreeRTOS/Demo/CORTEX_MPU_M33F_NTZ_Nordic_NRF9160_SES/FreeRTOSDemo.emProject @@ -76,9 +76,11 @@ + + diff --git a/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/IAR/Config/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/IAR/Config/FreeRTOSConfig.h index 681d846a7..b02100760 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/IAR/Config/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/IAR/Config/FreeRTOSConfig.h @@ -152,6 +152,14 @@ * See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ #define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << ( 8 - configPRIO_BITS ) ) +/* Set configUSE_MPU_WRAPPERS_V1 to 0 to use new MPU wrapper. + * See https://freertos.org/a00110.html#configUSE_MPU_WRAPPERS_V1 for details. */ +#define configUSE_MPU_WRAPPERS_V1 ( 0 ) +/* See https://freertos.org/a00110.html#configPROTECTED_KERNEL_OBJECT_POOL_SIZE for details. */ +#define configPROTECTED_KERNEL_OBJECT_POOL_SIZE ( 150 ) +/* See https://freertos.org/a00110.html#configSYSTEM_CALL_STACK_SIZE for details. */ +#define configSYSTEM_CALL_STACK_SIZE ( 128 ) + /* The #ifdef guards against the file being included from IAR assembly files. */ #ifndef __IASMARM__ diff --git a/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/IAR/NonSecure/FreeRTOSDemo_ns.ewp b/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/IAR/NonSecure/FreeRTOSDemo_ns.ewp index f6535af54..6b69d229a 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/IAR/NonSecure/FreeRTOSDemo_ns.ewp +++ b/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/IAR/NonSecure/FreeRTOSDemo_ns.ewp @@ -1188,6 +1188,9 @@ $PROJ_DIR$\..\..\..\..\..\Source\portable\Common\mpu_wrappers.c + + $PROJ_DIR$\..\..\..\..\..\Source\portable\Common\mpu_wrappers_v2.c + IAR @@ -1204,6 +1207,9 @@ $PROJ_DIR$\..\..\..\..\..\Source\portable\IAR\ARM_CM33\non_secure\portasm.s + + $PROJ_DIR$\..\..\..\..\..\Source\portable\IAR\ARM_CM33\non_secure\mpu_wrappers_v2_asm.S + $PROJ_DIR$\..\..\..\..\..\Source\portable\IAR\ARM_CM33\non_secure\portmacro.h diff --git a/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Config/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Config/FreeRTOSConfig.h index d15222fe9..a1e21d292 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Config/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Config/FreeRTOSConfig.h @@ -151,6 +151,14 @@ * See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ #define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << ( 8 - configPRIO_BITS ) ) +/* Set configUSE_MPU_WRAPPERS_V1 to 0 to use new MPU wrapper. + * See https://freertos.org/a00110.html#configUSE_MPU_WRAPPERS_V1 for details. */ +#define configUSE_MPU_WRAPPERS_V1 ( 0 ) +/* See https://freertos.org/a00110.html#configPROTECTED_KERNEL_OBJECT_POOL_SIZE for details. */ +#define configPROTECTED_KERNEL_OBJECT_POOL_SIZE ( 150 ) +/* See https://freertos.org/a00110.html#configSYSTEM_CALL_STACK_SIZE for details. */ +#define configSYSTEM_CALL_STACK_SIZE ( 128 ) + /* The #ifdef guards against the file being included from IAR assembly files. */ #ifndef __IASMARM__ diff --git a/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects_NTZ/IAR/Config/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects_NTZ/IAR/Config/FreeRTOSConfig.h index 64b7bcb9c..c2084aef4 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects_NTZ/IAR/Config/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects_NTZ/IAR/Config/FreeRTOSConfig.h @@ -153,6 +153,14 @@ * See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ #define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << ( 8 - configPRIO_BITS ) ) +/* Set configUSE_MPU_WRAPPERS_V1 to 0 to use new MPU wrapper. + * See https://freertos.org/a00110.html#configUSE_MPU_WRAPPERS_V1 for details. */ +#define configUSE_MPU_WRAPPERS_V1 ( 0 ) +/* See https://freertos.org/a00110.html#configPROTECTED_KERNEL_OBJECT_POOL_SIZE for details. */ +#define configPROTECTED_KERNEL_OBJECT_POOL_SIZE ( 150 ) +/* See https://freertos.org/a00110.html#configSYSTEM_CALL_STACK_SIZE for details. */ +#define configSYSTEM_CALL_STACK_SIZE ( 128 ) + /* The #ifdef guards against the file being included from IAR assembly files. */ #ifndef __IASMARM__ diff --git a/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects_NTZ/IAR/FreeRTOSDemo.ewp b/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects_NTZ/IAR/FreeRTOSDemo.ewp index ca25e6247..26d898062 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects_NTZ/IAR/FreeRTOSDemo.ewp +++ b/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects_NTZ/IAR/FreeRTOSDemo.ewp @@ -1119,6 +1119,9 @@ $PROJ_DIR$\..\..\..\..\Source\portable\Common\mpu_wrappers.c + + $PROJ_DIR$\..\..\..\..\Source\portable\Common\mpu_wrappers_v2.c + MemMang @@ -1141,6 +1144,9 @@ $PROJ_DIR$\..\..\..\..\Source\portable\IAR\ARM_CM33_NTZ\non_secure\portasm.s + + $PROJ_DIR$\..\..\..\..\Source\portable\IAR\ARM_CM33_NTZ\non_secure\mpu_wrappers_v2_asm.S + $PROJ_DIR$\..\..\..\..\Source\portable\IAR\ARM_CM33_NTZ\non_secure\portmacro.h diff --git a/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects_NTZ/MCUXpresso/Config/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects_NTZ/MCUXpresso/Config/FreeRTOSConfig.h index fb4e4d652..674d898cd 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects_NTZ/MCUXpresso/Config/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects_NTZ/MCUXpresso/Config/FreeRTOSConfig.h @@ -151,6 +151,14 @@ * See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ #define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << ( 8 - configPRIO_BITS ) ) +/* Set configUSE_MPU_WRAPPERS_V1 to 0 to use new MPU wrapper. + * See https://freertos.org/a00110.html#configUSE_MPU_WRAPPERS_V1 for details. */ +#define configUSE_MPU_WRAPPERS_V1 ( 0 ) +/* See https://freertos.org/a00110.html#configPROTECTED_KERNEL_OBJECT_POOL_SIZE for details. */ +#define configPROTECTED_KERNEL_OBJECT_POOL_SIZE ( 150 ) +/* See https://freertos.org/a00110.html#configSYSTEM_CALL_STACK_SIZE for details. */ +#define configSYSTEM_CALL_STACK_SIZE ( 128 ) + /* The #ifdef guards against the file being included from IAR assembly files. */ #ifndef __IASMARM__ diff --git a/FreeRTOS/Demo/CORTEX_MPU_M33F_Nordic_NRF9160_SES/Config/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPU_M33F_Nordic_NRF9160_SES/Config/FreeRTOSConfig.h index a67deec87..150e68a53 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M33F_Nordic_NRF9160_SES/Config/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_M33F_Nordic_NRF9160_SES/Config/FreeRTOSConfig.h @@ -154,6 +154,14 @@ extern uint32_t SystemCoreClock; * See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ #define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << ( 8 - configPRIO_BITS ) ) +/* Set configUSE_MPU_WRAPPERS_V1 to 0 to use new MPU wrapper. + * See https://freertos.org/a00110.html#configUSE_MPU_WRAPPERS_V1 for details. */ +#define configUSE_MPU_WRAPPERS_V1 ( 0 ) +/* See https://freertos.org/a00110.html#configPROTECTED_KERNEL_OBJECT_POOL_SIZE for details. */ +#define configPROTECTED_KERNEL_OBJECT_POOL_SIZE ( 150 ) +/* See https://freertos.org/a00110.html#configSYSTEM_CALL_STACK_SIZE for details. */ +#define configSYSTEM_CALL_STACK_SIZE ( 128 ) + /* Constants related to the generation of run time stats. */ #define configGENERATE_RUN_TIME_STATS 0 #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() diff --git a/FreeRTOS/Demo/CORTEX_MPU_M33F_Nordic_NRF9160_SES/FreeRTOSDemo.emProject b/FreeRTOS/Demo/CORTEX_MPU_M33F_Nordic_NRF9160_SES/FreeRTOSDemo.emProject index 3185248ac..23049f3a3 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M33F_Nordic_NRF9160_SES/FreeRTOSDemo.emProject +++ b/FreeRTOS/Demo/CORTEX_MPU_M33F_Nordic_NRF9160_SES/FreeRTOSDemo.emProject @@ -78,11 +78,13 @@ + + diff --git a/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/Config/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/Config/FreeRTOSConfig.h index 21d185825..a35154ab1 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/Config/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/Config/FreeRTOSConfig.h @@ -151,6 +151,14 @@ extern uint32_t SystemCoreClock; * See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ #define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << ( 8 - configPRIO_BITS ) ) +/* Set configUSE_MPU_WRAPPERS_V1 to 0 to use new MPU wrapper. + * See https://freertos.org/a00110.html#configUSE_MPU_WRAPPERS_V1 for details. */ +#define configUSE_MPU_WRAPPERS_V1 ( 0 ) +/* See https://freertos.org/a00110.html#configPROTECTED_KERNEL_OBJECT_POOL_SIZE for details. */ +#define configPROTECTED_KERNEL_OBJECT_POOL_SIZE ( 150 ) +/* See https://freertos.org/a00110.html#configSYSTEM_CALL_STACK_SIZE for details. */ +#define configSYSTEM_CALL_STACK_SIZE ( 128 ) + /* The #ifdef guards against the file being included from IAR assembly files. */ #ifndef __IASMARM__ diff --git a/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/NonSecure/FreeRTOSDemo_ns.uvoptx b/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/NonSecure/FreeRTOSDemo_ns.uvoptx index 87d315157..f2f27cdfa 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/NonSecure/FreeRTOSDemo_ns.uvoptx +++ b/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/NonSecure/FreeRTOSDemo_ns.uvoptx @@ -326,6 +326,18 @@ 2 11 + 1 + 0 + 0 + 0 + ..\..\..\Source\portable\GCC\ARM_CM33\non_secure\mpu_wrappers_v2_asm.c + mpu_wrappers_v2_asm.c + 0 + 0 + + + 2 + 12 5 0 0 @@ -337,7 +349,7 @@ 2 - 12 + 13 5 0 0 @@ -349,7 +361,7 @@ 2 - 13 + 14 1 0 0 @@ -359,6 +371,18 @@ 0 0 + + 2 + 15 + 1 + 0 + 0 + 0 + ..\..\..\Source\portable\Common\mpu_wrappers_v2.c + mpu_wrappers_v2.c + 0 + 0 + @@ -369,7 +393,7 @@ 0 3 - 14 + 16 5 0 0 @@ -389,7 +413,7 @@ 0 4 - 15 + 17 5 0 0 @@ -401,7 +425,7 @@ 4 - 16 + 18 1 0 0 @@ -413,7 +437,7 @@ 4 - 17 + 19 5 0 0 @@ -425,7 +449,7 @@ 4 - 18 + 20 1 0 0 @@ -437,7 +461,7 @@ 4 - 19 + 21 1 0 0 @@ -449,7 +473,7 @@ 4 - 20 + 22 5 0 0 @@ -461,7 +485,7 @@ 4 - 21 + 23 1 0 0 @@ -473,7 +497,7 @@ 4 - 22 + 24 5 0 0 @@ -493,7 +517,7 @@ 0 5 - 23 + 25 1 0 0 diff --git a/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/NonSecure/FreeRTOSDemo_ns.uvprojx b/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/NonSecure/FreeRTOSDemo_ns.uvprojx index 4ffd0dd58..8423d394e 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/NonSecure/FreeRTOSDemo_ns.uvprojx +++ b/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/NonSecure/FreeRTOSDemo_ns.uvprojx @@ -353,7 +353,7 @@ 0 0 0 - 4 + 1 @@ -439,6 +439,11 @@ 1 ..\..\..\Source\portable\GCC\ARM_CM33\non_secure\port.c + + mpu_wrappers_v2_asm.c + 1 + ..\..\..\Source\portable\GCC\ARM_CM33\non_secure\mpu_wrappers_v2_asm.c + portasm.h 5 @@ -454,6 +459,11 @@ 1 ..\..\..\Source\portable\GCC\ARM_CM33\non_secure\portasm.c + + mpu_wrappers_v2.c + 1 + ..\..\..\Source\portable\Common\mpu_wrappers_v2.c + 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 006187adf..9b6bfae76 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M3_MPS2_QEMU_GCC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_M3_MPS2_QEMU_GCC/FreeRTOSConfig.h @@ -54,7 +54,7 @@ extern void vAssertCalled( void ); #define configCPU_CLOCK_HZ ( ( unsigned long ) 20000000 ) #define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 256 ) -#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 1024 ) ) +#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 10 * 1024 ) ) #define configMAX_TASK_NAME_LEN ( 10 ) #define configUSE_TRACE_FACILITY 1 #define configUSE_16_BIT_TICKS 0 @@ -112,7 +112,14 @@ 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 + +/* Set configUSE_MPU_WRAPPERS_V1 to 0 to use new MPU wrapper. + * See https://freertos.org/a00110.html#configUSE_MPU_WRAPPERS_V1 for details. */ +#define configUSE_MPU_WRAPPERS_V1 ( 0 ) +/* See https://freertos.org/a00110.html#configPROTECTED_KERNEL_OBJECT_POOL_SIZE for details. */ +#define configPROTECTED_KERNEL_OBJECT_POOL_SIZE ( 150 ) +/* See https://freertos.org/a00110.html#configSYSTEM_CALL_STACK_SIZE for details. */ +#define configSYSTEM_CALL_STACK_SIZE ( 128 ) /* 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/Demo/CORTEX_MPU_M3_MPS2_QEMU_GCC/Makefile b/FreeRTOS/Demo/CORTEX_MPU_M3_MPS2_QEMU_GCC/Makefile index ede0ce1bf..e577429d0 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M3_MPS2_QEMU_GCC/Makefile +++ b/FreeRTOS/Demo/CORTEX_MPU_M3_MPS2_QEMU_GCC/Makefile @@ -12,9 +12,11 @@ SOURCE_FILES += init/startup.c syscall.c main.c # platform portable source file SOURCE_FILES += $(KERNEL_DIR)/portable/GCC/ARM_CM3_MPU/port.c +SOURCE_FILES += $(KERNEL_DIR)/portable/GCC/ARM_CM3_MPU/mpu_wrappers_v2_asm.c # Kernel source files SOURCE_FILES += $(KERNEL_DIR)/portable/Common/mpu_wrappers.c +SOURCE_FILES += $(KERNEL_DIR)/portable/Common/mpu_wrappers_v2.c SOURCE_FILES += $(KERNEL_DIR)/tasks.c SOURCE_FILES += $(KERNEL_DIR)/list.c SOURCE_FILES += $(KERNEL_DIR)/queue.c @@ -46,6 +48,7 @@ CFLAGS += -Wextra CFLAGS += -fstrict-aliasing CFLAGS += -Wstrict-aliasing CFLAGS += -Wno-error=address-of-packed-member +CFLAGS += -Wno-unused-parameter CFLAGS += $(INCLUDE_DIRS) LDFLAGS = -T ./scripts/mps2_m3.ld diff --git a/FreeRTOS/Demo/CORTEX_MPU_M3_MPS2_QEMU_GCC/init/startup.c b/FreeRTOS/Demo/CORTEX_MPU_M3_MPS2_QEMU_GCC/init/startup.c index acc09fe79..5deb2bfad 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M3_MPS2_QEMU_GCC/init/startup.c +++ b/FreeRTOS/Demo/CORTEX_MPU_M3_MPS2_QEMU_GCC/init/startup.c @@ -195,7 +195,7 @@ void Debug_Handler( void ) ); } -const uint32_t * isr_vector[] __attribute__( ( section( ".isr_vector" ) ) ) = +const uint32_t * const isr_vector[] __attribute__( ( section( ".isr_vector" ) ) ) = { ( uint32_t * ) &_estack, ( uint32_t * ) &Reset_Handler, /* Reset -15 */ diff --git a/FreeRTOS/Demo/CORTEX_MPU_M3_MPS2_QEMU_GCC/scripts/mps2_m3.ld b/FreeRTOS/Demo/CORTEX_MPU_M3_MPS2_QEMU_GCC/scripts/mps2_m3.ld index 76abfb5cd..cd9665fdb 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M3_MPS2_QEMU_GCC/scripts/mps2_m3.ld +++ b/FreeRTOS/Demo/CORTEX_MPU_M3_MPS2_QEMU_GCC/scripts/mps2_m3.ld @@ -41,7 +41,7 @@ MEMORY M_VECTOR_RAM_SIZE = (16 + 48) * 4; -__privileged_functions_region_size__ = 32K; /* 32000 bytes */ +__privileged_functions_region_size__ = 64K; /* 64000 bytes */ __privileged_data_region_size__ = 32K; /* 32000 bytes */ __FLASH_segment_start__ = ORIGIN( FLASH ); @@ -128,7 +128,7 @@ SECTIONS PROVIDE_HIDDEN (__preinit_array_end = .); . = ALIGN(4); } >FLASH - + .init_array : { . = ALIGN(4); @@ -138,7 +138,7 @@ SECTIONS PROVIDE_HIDDEN (__init_array_end = .); . = ALIGN(4); } >FLASH - + .fini_array : { . = ALIGN(4); diff --git a/FreeRTOS/Demo/CORTEX_MPU_M3_NUCLEO_L152RE_GCC/Config/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPU_M3_NUCLEO_L152RE_GCC/Config/FreeRTOSConfig.h index c1d66bfa1..234b79673 100755 --- a/FreeRTOS/Demo/CORTEX_MPU_M3_NUCLEO_L152RE_GCC/Config/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_M3_NUCLEO_L152RE_GCC/Config/FreeRTOSConfig.h @@ -48,116 +48,124 @@ extern "C" { settings within this file. Therefore, to ensure all the functions in port.c build, this configuration file has all options turned on. */ -#define configUSE_PREEMPTION 1 -#define configTICK_RATE_HZ ( 1000 ) -#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 -#define configUSE_QUEUE_SETS 1 -#define configUSE_IDLE_HOOK 0 -#define configUSE_TICK_HOOK 0 -#define configCPU_CLOCK_HZ 48000000 -#define configMAX_PRIORITIES ( 5 ) -#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 256 ) -#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 16 * 1024 ) ) -#define configMAX_TASK_NAME_LEN ( 10 ) -#define configUSE_TRACE_FACILITY 1 -#define configUSE_16_BIT_TICKS 0 -#define configIDLE_SHOULD_YIELD 1 -#define configUSE_MUTEXES 1 -#define configQUEUE_REGISTRY_SIZE 5 -#define configCHECK_FOR_STACK_OVERFLOW 2 -#define configUSE_RECURSIVE_MUTEXES 1 -#define configUSE_MALLOC_FAILED_HOOK 1 -#define configUSE_APPLICATION_TASK_TAG 1 -#define configUSE_COUNTING_SEMAPHORES 1 -#define configUSE_TICKLESS_IDLE 0 -#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 2 +#define configUSE_PREEMPTION 1 +#define configTICK_RATE_HZ ( 1000 ) +#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 +#define configUSE_QUEUE_SETS 1 +#define configUSE_IDLE_HOOK 0 +#define configUSE_TICK_HOOK 0 +#define configCPU_CLOCK_HZ 48000000 +#define configMAX_PRIORITIES ( 5 ) +#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 256 ) +#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 16 * 1024 ) ) +#define configMAX_TASK_NAME_LEN ( 10 ) +#define configUSE_TRACE_FACILITY 1 +#define configUSE_16_BIT_TICKS 0 +#define configIDLE_SHOULD_YIELD 1 +#define configUSE_MUTEXES 1 +#define configQUEUE_REGISTRY_SIZE 5 +#define configCHECK_FOR_STACK_OVERFLOW 2 +#define configUSE_RECURSIVE_MUTEXES 1 +#define configUSE_MALLOC_FAILED_HOOK 1 +#define configUSE_APPLICATION_TASK_TAG 1 +#define configUSE_COUNTING_SEMAPHORES 1 +#define configUSE_TICKLESS_IDLE 0 +#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 2 /* This demo shows the MPU being used without any dynamic memory allocation. */ -#define configSUPPORT_STATIC_ALLOCATION 1 -#define configSUPPORT_DYNAMIC_ALLOCATION 1 +#define configSUPPORT_STATIC_ALLOCATION 1 +#define configSUPPORT_DYNAMIC_ALLOCATION 1 /* Run time stats gathering definitions. */ -#define configGENERATE_RUN_TIME_STATS 1 +#define configGENERATE_RUN_TIME_STATS 1 #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() -#define portGET_RUN_TIME_COUNTER_VALUE() 0 +#define portGET_RUN_TIME_COUNTER_VALUE() 0 /* This demo makes use of one or more example stats formatting functions. These format the raw data provided by the uxTaskGetSystemState() function in to human readable ASCII form. See the notes in the implementation of vTaskList() within FreeRTOS/Source/tasks.c for limitations. */ -#define configUSE_STATS_FORMATTING_FUNCTIONS 0 +#define configUSE_STATS_FORMATTING_FUNCTIONS 0 /* Co-routine definitions. */ -#define configUSE_CO_ROUTINES 0 -#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ -#define configUSE_TIMERS 1 -#define configTIMER_TASK_PRIORITY ( 2 ) -#define configTIMER_QUEUE_LENGTH 5 -#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE ) +#define configUSE_TIMERS 1 +#define configTIMER_TASK_PRIORITY ( 2 ) +#define configTIMER_QUEUE_LENGTH 5 +#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ -#define INCLUDE_vTaskPrioritySet 1 -#define INCLUDE_uxTaskPriorityGet 1 -#define INCLUDE_vTaskDelete 1 -#define INCLUDE_vTaskCleanUpResources 1 -#define INCLUDE_vTaskSuspend 1 -#define INCLUDE_vTaskDelayUntil 1 -#define INCLUDE_vTaskDelay 1 -#define INCLUDE_eTaskGetState 1 -#define INCLUDE_xTimerPendFunctionCall 0 -#define INCLUDE_xSemaphoreGetMutexHolder 1 -#define INCLUDE_xTaskGetHandle 1 -#define INCLUDE_xTaskGetCurrentTaskHandle 1 -#define INCLUDE_xTaskGetIdleTaskHandle 1 -#define INCLUDE_xTaskAbortDelay 1 -#define INCLUDE_xTaskGetSchedulerState 1 -#define INCLUDE_xTaskGetIdleTaskHandle 1 -#define INCLUDE_uxTaskGetStackHighWaterMark 1 +#define INCLUDE_vTaskPrioritySet 1 +#define INCLUDE_uxTaskPriorityGet 1 +#define INCLUDE_vTaskDelete 1 +#define INCLUDE_vTaskCleanUpResources 1 +#define INCLUDE_vTaskSuspend 1 +#define INCLUDE_vTaskDelayUntil 1 +#define INCLUDE_vTaskDelay 1 +#define INCLUDE_eTaskGetState 1 +#define INCLUDE_xTimerPendFunctionCall 0 +#define INCLUDE_xSemaphoreGetMutexHolder 1 +#define INCLUDE_xTaskGetHandle 1 +#define INCLUDE_xTaskGetCurrentTaskHandle 1 +#define INCLUDE_xTaskGetIdleTaskHandle 1 +#define INCLUDE_xTaskAbortDelay 1 +#define INCLUDE_xTaskGetSchedulerState 1 +#define INCLUDE_xTaskGetIdleTaskHandle 1 +#define INCLUDE_uxTaskGetStackHighWaterMark 1 /* Cortex-M specific definitions. */ #ifdef __NVIC_PRIO_BITS - /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */ - #define configPRIO_BITS __NVIC_PRIO_BITS + /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */ + #define configPRIO_BITS __NVIC_PRIO_BITS #else - #define configPRIO_BITS 4 /* 15 priority levels */ + #define configPRIO_BITS 4 /* 15 priority levels */ #endif /* The lowest interrupt priority that can be used in a call to a "set priority" function. */ -#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0xf +#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0xf /* The highest interrupt priority that can be used by any interrupt service routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER PRIORITY THAN THIS! (higher priorities are lower numeric values. */ -#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 +#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 /* Interrupt priorities used by the kernel port layer itself. These are generic to all Cortex-M ports, and do not rely on any particular library functions. */ -#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) +#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) /* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ -#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) +#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) /* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS standard names. */ -#define xPortPendSVHandler PendSV_Handler -#define vPortSVCHandler SVC_Handler -#define xPortSysTickHandler SysTick_Handler +#define xPortPendSVHandler PendSV_Handler +#define vPortSVCHandler SVC_Handler +#define xPortSysTickHandler SysTick_Handler /* Normal assert() semantics without relying on the provision of an assert.h header file. */ -#define configASSERT( x ) if( ( x ) == 0 ) { portDISABLE_INTERRUPTS(); for( ;; ); } +#define configASSERT( x ) if( ( x ) == 0 ) { portDISABLE_INTERRUPTS(); for( ;; ); } /* Ensure that system calls can only be made from kernel code. */ -#define configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY 1 +#define configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY 1 + +/* Set configUSE_MPU_WRAPPERS_V1 to 0 to use new MPU wrapper. + * See https://freertos.org/a00110.html#configUSE_MPU_WRAPPERS_V1 for details. */ +#define configUSE_MPU_WRAPPERS_V1 ( 0 ) +/* See https://freertos.org/a00110.html#configPROTECTED_KERNEL_OBJECT_POOL_SIZE for details. */ +#define configPROTECTED_KERNEL_OBJECT_POOL_SIZE ( 150 ) +/* See https://freertos.org/a00110.html#configSYSTEM_CALL_STACK_SIZE for details. */ +#define configSYSTEM_CALL_STACK_SIZE ( 128 ) /* Do not allow critical sections from unprivileged tasks. */ -#define configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS 0 +#define configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS 0 #ifdef __cplusplus } diff --git a/FreeRTOS/Demo/CORTEX_MPU_M3_NUCLEO_L152RE_GCC/Projects/GCC/STM32L152RETX_FLASH.ld b/FreeRTOS/Demo/CORTEX_MPU_M3_NUCLEO_L152RE_GCC/Projects/GCC/STM32L152RETX_FLASH.ld index cf1290573..3629b5941 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M3_NUCLEO_L152RE_GCC/Projects/GCC/STM32L152RETX_FLASH.ld +++ b/FreeRTOS/Demo/CORTEX_MPU_M3_NUCLEO_L152RE_GCC/Projects/GCC/STM32L152RETX_FLASH.ld @@ -69,9 +69,9 @@ MEMORY FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 512K } -/* Initial 32K Flash is used to store kernel functions and +/* Initial 64K Flash is used to store kernel functions and * initial 512 bytes of RAM is used to store kernel data. */ -__privileged_functions_region_size__ = 32K; +__privileged_functions_region_size__ = 64K; __privileged_data_region_size__ = 32K; __FLASH_segment_start__ = ORIGIN( FLASH ); @@ -140,12 +140,12 @@ SECTIONS } >FLASH .ARM.extab : - { + { . = ALIGN(4); *(.ARM.extab* .gnu.linkonce.armextab.*) . = ALIGN(4); } >FLASH - + .ARM : { . = ALIGN(4); @@ -163,7 +163,7 @@ SECTIONS PROVIDE_HIDDEN (__preinit_array_end = .); . = ALIGN(4); } >FLASH - + .init_array : { . = ALIGN(4); @@ -173,7 +173,7 @@ SECTIONS PROVIDE_HIDDEN (__init_array_end = .); . = ALIGN(4); } >FLASH - + .fini_array : { . = ALIGN(4); @@ -204,7 +204,7 @@ SECTIONS } >RAM AT> FLASH /* Initialized data sections into "RAM" Ram type memory. */ - .data : + .data : { . = ALIGN(4); *(.data) /* .data sections. */ diff --git a/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Config/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Config/FreeRTOSConfig.h index bbfb3caf6..755cd86cd 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Config/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Config/FreeRTOSConfig.h @@ -141,4 +141,12 @@ See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ /* Do not allow critical sections from unprivileged tasks. */ #define configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS 0 + +/* Set configUSE_MPU_WRAPPERS_V1 to 0 to use new MPU wrapper. + * See https://freertos.org/a00110.html#configUSE_MPU_WRAPPERS_V1 for details. */ +#define configUSE_MPU_WRAPPERS_V1 ( 0 ) +/* See https://freertos.org/a00110.html#configPROTECTED_KERNEL_OBJECT_POOL_SIZE for details. */ +#define configPROTECTED_KERNEL_OBJECT_POOL_SIZE ( 150 ) +/* See https://freertos.org/a00110.html#configSYSTEM_CALL_STACK_SIZE for details. */ +#define configSYSTEM_CALL_STACK_SIZE ( 128 ) #endif /* FREERTOS_CONFIG_H */ diff --git a/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Projects/GCC/STM32H743ZITX_FLASH.ld b/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Projects/GCC/STM32H743ZITX_FLASH.ld index ddf6c2615..f051a41af 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Projects/GCC/STM32H743ZITX_FLASH.ld +++ b/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Projects/GCC/STM32H743ZITX_FLASH.ld @@ -73,9 +73,9 @@ MEMORY FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 2048K } -/* Initial 32K Flash is used to store kernel functions and +/* Initial 64K Flash is used to store kernel functions and * initial 32K RAM is used to store kernel data. */ -__privileged_functions_region_size__ = 32K; +__privileged_functions_region_size__ = 64K; __privileged_data_region_size__ = 32K; __FLASH_segment_start__ = ORIGIN( FLASH ); diff --git a/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Projects/IAR/FreeRTOSDemo.ewp b/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Projects/IAR/FreeRTOSDemo.ewp index dcaccd7d3..48c4ae4b2 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Projects/IAR/FreeRTOSDemo.ewp +++ b/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Projects/IAR/FreeRTOSDemo.ewp @@ -1164,11 +1164,17 @@ $PROJ_DIR$\..\..\..\..\Source\portable\Common\mpu_wrappers.c + + $PROJ_DIR$\..\..\..\..\Source\portable\Common\mpu_wrappers_v2.c + IAR ARM_CM4F_MPU + + $PROJ_DIR$\..\..\..\..\Source\portable\IAR\ARM_CM4F_MPU\mpu_wrappers_v2_asm.S + $PROJ_DIR$\..\..\..\..\Source\portable\IAR\ARM_CM4F_MPU\port.c diff --git a/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Projects/Keil/FreeRTOSDemo.uvoptx b/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Projects/Keil/FreeRTOSDemo.uvoptx index fce0ba11e..358c0ff6f 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Projects/Keil/FreeRTOSDemo.uvoptx +++ b/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Projects/Keil/FreeRTOSDemo.uvoptx @@ -439,6 +439,30 @@ 0 0 + + 3 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\Source\portable\Common\mpu_wrappers_v2.c + mpu_wrappers_v2.c + 0 + 0 + + + 3 + 20 + 1 + 0 + 0 + 0 + ..\..\..\..\Source\portable\GCC\ARM_CM4_MPU\mpu_wrappers_v2_asm.c + mpu_wrappers_v2_asm.c + 0 + 0 + @@ -449,7 +473,7 @@ 0 4 - 19 + 21 1 0 0 @@ -461,7 +485,7 @@ 4 - 20 + 22 1 0 0 @@ -473,7 +497,7 @@ 4 - 21 + 23 1 0 0 @@ -485,7 +509,7 @@ 4 - 22 + 24 1 0 0 @@ -497,7 +521,7 @@ 4 - 23 + 25 1 0 0 @@ -517,7 +541,7 @@ 0 5 - 24 + 26 1 0 0 @@ -529,7 +553,7 @@ 5 - 25 + 27 1 0 0 @@ -541,7 +565,7 @@ 5 - 26 + 28 1 0 0 @@ -553,7 +577,7 @@ 5 - 27 + 29 1 0 0 @@ -565,7 +589,7 @@ 5 - 28 + 30 1 0 0 @@ -577,7 +601,7 @@ 5 - 29 + 31 1 0 0 @@ -589,7 +613,7 @@ 5 - 30 + 32 1 0 0 @@ -601,7 +625,7 @@ 5 - 31 + 33 1 0 0 @@ -613,7 +637,7 @@ 5 - 32 + 34 1 0 0 @@ -625,7 +649,7 @@ 5 - 33 + 35 1 0 0 @@ -637,7 +661,7 @@ 5 - 34 + 36 1 0 0 @@ -649,7 +673,7 @@ 5 - 35 + 37 1 0 0 @@ -661,7 +685,7 @@ 5 - 36 + 38 1 0 0 @@ -673,7 +697,7 @@ 5 - 37 + 39 1 0 0 @@ -685,7 +709,7 @@ 5 - 38 + 40 1 0 0 @@ -697,7 +721,7 @@ 5 - 39 + 41 1 0 0 @@ -709,7 +733,7 @@ 5 - 40 + 42 1 0 0 @@ -721,7 +745,7 @@ 5 - 41 + 43 1 0 0 @@ -733,7 +757,7 @@ 5 - 42 + 44 1 0 0 @@ -745,7 +769,7 @@ 5 - 43 + 45 1 0 0 @@ -757,7 +781,7 @@ 5 - 44 + 46 1 0 0 @@ -769,7 +793,7 @@ 5 - 45 + 47 1 0 0 @@ -781,7 +805,7 @@ 5 - 46 + 48 1 0 0 @@ -793,7 +817,7 @@ 5 - 47 + 49 1 0 0 @@ -805,7 +829,7 @@ 5 - 48 + 50 1 0 0 @@ -817,7 +841,7 @@ 5 - 49 + 51 1 0 0 @@ -829,7 +853,7 @@ 5 - 50 + 52 1 0 0 @@ -841,7 +865,7 @@ 5 - 51 + 53 1 0 0 @@ -853,7 +877,7 @@ 5 - 52 + 54 1 0 0 @@ -865,7 +889,7 @@ 5 - 53 + 55 1 0 0 @@ -877,7 +901,7 @@ 5 - 54 + 56 1 0 0 @@ -889,7 +913,7 @@ 5 - 55 + 57 1 0 0 @@ -901,7 +925,7 @@ 5 - 56 + 58 1 0 0 @@ -913,7 +937,7 @@ 5 - 57 + 59 1 0 0 @@ -925,7 +949,7 @@ 5 - 58 + 60 1 0 0 @@ -937,7 +961,7 @@ 5 - 59 + 61 1 0 0 @@ -949,7 +973,7 @@ 5 - 60 + 62 1 0 0 @@ -961,7 +985,7 @@ 5 - 61 + 63 1 0 0 @@ -973,7 +997,7 @@ 5 - 62 + 64 1 0 0 @@ -985,7 +1009,7 @@ 5 - 63 + 65 1 0 0 @@ -997,7 +1021,7 @@ 5 - 64 + 66 1 0 0 @@ -1009,7 +1033,7 @@ 5 - 65 + 67 1 0 0 @@ -1021,7 +1045,7 @@ 5 - 66 + 68 1 0 0 @@ -1033,7 +1057,7 @@ 5 - 67 + 69 1 0 0 @@ -1045,7 +1069,7 @@ 5 - 68 + 70 1 0 0 @@ -1057,7 +1081,7 @@ 5 - 69 + 71 1 0 0 @@ -1069,7 +1093,7 @@ 5 - 70 + 72 1 0 0 @@ -1081,7 +1105,7 @@ 5 - 71 + 73 1 0 0 @@ -1093,7 +1117,7 @@ 5 - 72 + 74 1 0 0 @@ -1105,7 +1129,7 @@ 5 - 73 + 75 1 0 0 @@ -1117,7 +1141,7 @@ 5 - 74 + 76 1 0 0 @@ -1129,7 +1153,7 @@ 5 - 75 + 77 1 0 0 @@ -1141,7 +1165,7 @@ 5 - 76 + 78 1 0 0 @@ -1153,7 +1177,7 @@ 5 - 77 + 79 1 0 0 @@ -1165,7 +1189,7 @@ 5 - 78 + 80 1 0 0 @@ -1177,7 +1201,7 @@ 5 - 79 + 81 1 0 0 @@ -1189,7 +1213,7 @@ 5 - 80 + 82 1 0 0 @@ -1201,7 +1225,7 @@ 5 - 81 + 83 1 0 0 @@ -1213,7 +1237,7 @@ 5 - 82 + 84 1 0 0 @@ -1225,7 +1249,7 @@ 5 - 83 + 85 1 0 0 @@ -1237,7 +1261,7 @@ 5 - 84 + 86 1 0 0 @@ -1249,7 +1273,7 @@ 5 - 85 + 87 1 0 0 @@ -1261,7 +1285,7 @@ 5 - 86 + 88 1 0 0 @@ -1273,7 +1297,7 @@ 5 - 87 + 89 1 0 0 @@ -1285,7 +1309,7 @@ 5 - 88 + 90 1 0 0 @@ -1297,7 +1321,7 @@ 5 - 89 + 91 1 0 0 @@ -1309,7 +1333,7 @@ 5 - 90 + 92 1 0 0 @@ -1321,7 +1345,7 @@ 5 - 91 + 93 1 0 0 @@ -1333,7 +1357,7 @@ 5 - 92 + 94 1 0 0 @@ -1345,7 +1369,7 @@ 5 - 93 + 95 1 0 0 @@ -1357,7 +1381,7 @@ 5 - 94 + 96 1 0 0 @@ -1369,7 +1393,7 @@ 5 - 95 + 97 1 0 0 @@ -1381,7 +1405,7 @@ 5 - 96 + 98 1 0 0 @@ -1393,7 +1417,7 @@ 5 - 97 + 99 1 0 0 @@ -1405,7 +1429,7 @@ 5 - 98 + 100 1 0 0 @@ -1417,7 +1441,7 @@ 5 - 99 + 101 1 0 0 @@ -1429,7 +1453,7 @@ 5 - 100 + 102 1 0 0 @@ -1441,7 +1465,7 @@ 5 - 101 + 103 1 0 0 @@ -1453,7 +1477,7 @@ 5 - 102 + 104 1 0 0 @@ -1465,7 +1489,7 @@ 5 - 103 + 105 1 0 0 @@ -1477,7 +1501,7 @@ 5 - 104 + 106 1 0 0 @@ -1489,7 +1513,7 @@ 5 - 105 + 107 1 0 0 @@ -1501,7 +1525,7 @@ 5 - 106 + 108 1 0 0 @@ -1513,7 +1537,7 @@ 5 - 107 + 109 1 0 0 @@ -1525,7 +1549,7 @@ 5 - 108 + 110 1 0 0 @@ -1537,7 +1561,7 @@ 5 - 109 + 111 1 0 0 @@ -1549,7 +1573,7 @@ 5 - 110 + 112 1 0 0 @@ -1561,7 +1585,7 @@ 5 - 111 + 113 1 0 0 @@ -1573,7 +1597,7 @@ 5 - 112 + 114 1 0 0 @@ -1585,7 +1609,7 @@ 5 - 113 + 115 1 0 0 @@ -1597,7 +1621,7 @@ 5 - 114 + 116 1 0 0 @@ -1609,7 +1633,7 @@ 5 - 115 + 117 1 0 0 @@ -1621,7 +1645,7 @@ 5 - 116 + 118 1 0 0 @@ -1633,7 +1657,7 @@ 5 - 117 + 119 1 0 0 @@ -1645,7 +1669,7 @@ 5 - 118 + 120 1 0 0 @@ -1657,7 +1681,7 @@ 5 - 119 + 121 1 0 0 @@ -1669,7 +1693,7 @@ 5 - 120 + 122 1 0 0 @@ -1681,7 +1705,7 @@ 5 - 121 + 123 1 0 0 @@ -1693,7 +1717,7 @@ 5 - 122 + 124 1 0 0 @@ -1705,7 +1729,7 @@ 5 - 123 + 125 1 0 0 @@ -1717,7 +1741,7 @@ 5 - 124 + 126 1 0 0 @@ -1729,7 +1753,7 @@ 5 - 125 + 127 1 0 0 @@ -1741,7 +1765,7 @@ 5 - 126 + 128 1 0 0 @@ -1753,7 +1777,7 @@ 5 - 127 + 129 1 0 0 @@ -1765,7 +1789,7 @@ 5 - 128 + 130 1 0 0 @@ -1777,7 +1801,7 @@ 5 - 129 + 131 1 0 0 @@ -1789,7 +1813,7 @@ 5 - 130 + 132 1 0 0 @@ -1801,7 +1825,7 @@ 5 - 131 + 133 1 0 0 @@ -1813,7 +1837,7 @@ 5 - 132 + 134 1 0 0 @@ -1825,7 +1849,7 @@ 5 - 133 + 135 1 0 0 @@ -1837,7 +1861,7 @@ 5 - 134 + 136 1 0 0 @@ -1849,7 +1873,7 @@ 5 - 135 + 137 1 0 0 @@ -1861,7 +1885,7 @@ 5 - 136 + 138 1 0 0 @@ -1873,7 +1897,7 @@ 5 - 137 + 139 1 0 0 @@ -1893,7 +1917,7 @@ 0 6 - 138 + 140 1 0 0 @@ -1905,7 +1929,7 @@ 6 - 139 + 141 2 0 0 diff --git a/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Projects/Keil/FreeRTOSDemo.uvprojx b/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Projects/Keil/FreeRTOSDemo.uvprojx index ab02655a8..ff5b9bda5 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Projects/Keil/FreeRTOSDemo.uvprojx +++ b/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Projects/Keil/FreeRTOSDemo.uvprojx @@ -484,6 +484,16 @@ 1 ..\..\..\..\Source\portable\MemMang\heap_4.c + + mpu_wrappers_v2.c + 1 + ..\..\..\..\Source\portable\Common\mpu_wrappers_v2.c + + + mpu_wrappers_v2_asm.c + 1 + ..\..\..\..\Source\portable\GCC\ARM_CM4_MPU\mpu_wrappers_v2_asm.c + diff --git a/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Projects/Keil_V5/FreeRTOSDemo.uvoptx b/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Projects/Keil_V5/FreeRTOSDemo.uvoptx index 5d0b06c3e..0f492d385 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Projects/Keil_V5/FreeRTOSDemo.uvoptx +++ b/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Projects/Keil_V5/FreeRTOSDemo.uvoptx @@ -422,6 +422,18 @@ 0 0 0 + ..\..\..\..\Source\portable\Common\mpu_wrappers_v2.c + mpu_wrappers_v2.c + 0 + 0 + + + 3 + 18 + 1 + 0 + 0 + 0 ..\..\..\..\Source\portable\RVDS\ARM_CM4_MPU\port.c port.c 0 @@ -429,7 +441,7 @@ 3 - 18 + 19 5 0 0 @@ -439,6 +451,18 @@ 0 0 + + 3 + 20 + 1 + 0 + 0 + 0 + ..\..\..\..\Source\portable\RVDS\ARM_CM4_MPU\mpu_wrappers_v2_asm.c + mpu_wrappers_v2_asm.c + 0 + 0 + @@ -449,7 +473,7 @@ 0 4 - 19 + 21 1 0 0 @@ -461,7 +485,7 @@ 4 - 20 + 22 1 0 0 @@ -473,7 +497,7 @@ 4 - 21 + 23 1 0 0 @@ -485,7 +509,7 @@ 4 - 22 + 24 1 0 0 @@ -497,7 +521,7 @@ 4 - 23 + 25 1 0 0 @@ -517,7 +541,7 @@ 0 5 - 24 + 26 1 0 0 @@ -529,7 +553,7 @@ 5 - 25 + 27 1 0 0 @@ -541,7 +565,7 @@ 5 - 26 + 28 1 0 0 @@ -553,7 +577,7 @@ 5 - 27 + 29 1 0 0 @@ -565,7 +589,7 @@ 5 - 28 + 30 1 0 0 @@ -577,7 +601,7 @@ 5 - 29 + 31 1 0 0 @@ -589,7 +613,7 @@ 5 - 30 + 32 1 0 0 @@ -601,7 +625,7 @@ 5 - 31 + 33 1 0 0 @@ -613,7 +637,7 @@ 5 - 32 + 34 1 0 0 @@ -625,7 +649,7 @@ 5 - 33 + 35 1 0 0 @@ -637,7 +661,7 @@ 5 - 34 + 36 1 0 0 @@ -649,7 +673,7 @@ 5 - 35 + 37 1 0 0 @@ -661,7 +685,7 @@ 5 - 36 + 38 1 0 0 @@ -673,7 +697,7 @@ 5 - 37 + 39 1 0 0 @@ -685,7 +709,7 @@ 5 - 38 + 40 1 0 0 @@ -697,7 +721,7 @@ 5 - 39 + 41 1 0 0 @@ -709,7 +733,7 @@ 5 - 40 + 42 1 0 0 @@ -721,7 +745,7 @@ 5 - 41 + 43 1 0 0 @@ -733,7 +757,7 @@ 5 - 42 + 44 1 0 0 @@ -745,7 +769,7 @@ 5 - 43 + 45 1 0 0 @@ -757,7 +781,7 @@ 5 - 44 + 46 1 0 0 @@ -769,7 +793,7 @@ 5 - 45 + 47 1 0 0 @@ -781,7 +805,7 @@ 5 - 46 + 48 1 0 0 @@ -793,7 +817,7 @@ 5 - 47 + 49 1 0 0 @@ -805,7 +829,7 @@ 5 - 48 + 50 1 0 0 @@ -817,7 +841,7 @@ 5 - 49 + 51 1 0 0 @@ -829,7 +853,7 @@ 5 - 50 + 52 1 0 0 @@ -841,7 +865,7 @@ 5 - 51 + 53 1 0 0 @@ -853,7 +877,7 @@ 5 - 52 + 54 1 0 0 @@ -865,7 +889,7 @@ 5 - 53 + 55 1 0 0 @@ -877,7 +901,7 @@ 5 - 54 + 56 1 0 0 @@ -889,7 +913,7 @@ 5 - 55 + 57 1 0 0 @@ -901,7 +925,7 @@ 5 - 56 + 58 1 0 0 @@ -913,7 +937,7 @@ 5 - 57 + 59 1 0 0 @@ -925,7 +949,7 @@ 5 - 58 + 60 1 0 0 @@ -937,7 +961,7 @@ 5 - 59 + 61 1 0 0 @@ -949,7 +973,7 @@ 5 - 60 + 62 1 0 0 @@ -961,7 +985,7 @@ 5 - 61 + 63 1 0 0 @@ -973,7 +997,7 @@ 5 - 62 + 64 1 0 0 @@ -985,7 +1009,7 @@ 5 - 63 + 65 1 0 0 @@ -997,7 +1021,7 @@ 5 - 64 + 66 1 0 0 @@ -1009,7 +1033,7 @@ 5 - 65 + 67 1 0 0 @@ -1021,7 +1045,7 @@ 5 - 66 + 68 1 0 0 @@ -1033,7 +1057,7 @@ 5 - 67 + 69 1 0 0 @@ -1045,7 +1069,7 @@ 5 - 68 + 70 1 0 0 @@ -1057,7 +1081,7 @@ 5 - 69 + 71 1 0 0 @@ -1069,7 +1093,7 @@ 5 - 70 + 72 1 0 0 @@ -1081,7 +1105,7 @@ 5 - 71 + 73 1 0 0 @@ -1093,7 +1117,7 @@ 5 - 72 + 74 1 0 0 @@ -1105,7 +1129,7 @@ 5 - 73 + 75 1 0 0 @@ -1117,7 +1141,7 @@ 5 - 74 + 76 1 0 0 @@ -1129,7 +1153,7 @@ 5 - 75 + 77 1 0 0 @@ -1141,7 +1165,7 @@ 5 - 76 + 78 1 0 0 @@ -1153,7 +1177,7 @@ 5 - 77 + 79 1 0 0 @@ -1165,7 +1189,7 @@ 5 - 78 + 80 1 0 0 @@ -1177,7 +1201,7 @@ 5 - 79 + 81 1 0 0 @@ -1189,7 +1213,7 @@ 5 - 80 + 82 1 0 0 @@ -1201,7 +1225,7 @@ 5 - 81 + 83 1 0 0 @@ -1213,7 +1237,7 @@ 5 - 82 + 84 1 0 0 @@ -1225,7 +1249,7 @@ 5 - 83 + 85 1 0 0 @@ -1237,7 +1261,7 @@ 5 - 84 + 86 1 0 0 @@ -1249,7 +1273,7 @@ 5 - 85 + 87 1 0 0 @@ -1261,7 +1285,7 @@ 5 - 86 + 88 1 0 0 @@ -1273,7 +1297,7 @@ 5 - 87 + 89 1 0 0 @@ -1285,7 +1309,7 @@ 5 - 88 + 90 1 0 0 @@ -1297,7 +1321,7 @@ 5 - 89 + 91 1 0 0 @@ -1309,7 +1333,7 @@ 5 - 90 + 92 1 0 0 @@ -1321,7 +1345,7 @@ 5 - 91 + 93 1 0 0 @@ -1333,7 +1357,7 @@ 5 - 92 + 94 1 0 0 @@ -1345,7 +1369,7 @@ 5 - 93 + 95 1 0 0 @@ -1357,7 +1381,7 @@ 5 - 94 + 96 1 0 0 @@ -1369,7 +1393,7 @@ 5 - 95 + 97 1 0 0 @@ -1381,7 +1405,7 @@ 5 - 96 + 98 1 0 0 @@ -1393,7 +1417,7 @@ 5 - 97 + 99 1 0 0 @@ -1405,7 +1429,7 @@ 5 - 98 + 100 1 0 0 @@ -1417,7 +1441,7 @@ 5 - 99 + 101 1 0 0 @@ -1429,7 +1453,7 @@ 5 - 100 + 102 1 0 0 @@ -1441,7 +1465,7 @@ 5 - 101 + 103 1 0 0 @@ -1453,7 +1477,7 @@ 5 - 102 + 104 1 0 0 @@ -1465,7 +1489,7 @@ 5 - 103 + 105 1 0 0 @@ -1477,7 +1501,7 @@ 5 - 104 + 106 1 0 0 @@ -1489,7 +1513,7 @@ 5 - 105 + 107 1 0 0 @@ -1501,7 +1525,7 @@ 5 - 106 + 108 1 0 0 @@ -1513,7 +1537,7 @@ 5 - 107 + 109 1 0 0 @@ -1525,7 +1549,7 @@ 5 - 108 + 110 1 0 0 @@ -1537,7 +1561,7 @@ 5 - 109 + 111 1 0 0 @@ -1549,7 +1573,7 @@ 5 - 110 + 112 1 0 0 @@ -1561,7 +1585,7 @@ 5 - 111 + 113 1 0 0 @@ -1573,7 +1597,7 @@ 5 - 112 + 114 1 0 0 @@ -1585,7 +1609,7 @@ 5 - 113 + 115 1 0 0 @@ -1597,7 +1621,7 @@ 5 - 114 + 116 1 0 0 @@ -1609,7 +1633,7 @@ 5 - 115 + 117 1 0 0 @@ -1621,7 +1645,7 @@ 5 - 116 + 118 1 0 0 @@ -1633,7 +1657,7 @@ 5 - 117 + 119 1 0 0 @@ -1645,7 +1669,7 @@ 5 - 118 + 120 1 0 0 @@ -1657,7 +1681,7 @@ 5 - 119 + 121 1 0 0 @@ -1669,7 +1693,7 @@ 5 - 120 + 122 1 0 0 @@ -1681,7 +1705,7 @@ 5 - 121 + 123 1 0 0 @@ -1693,7 +1717,7 @@ 5 - 122 + 124 1 0 0 @@ -1705,7 +1729,7 @@ 5 - 123 + 125 1 0 0 @@ -1717,7 +1741,7 @@ 5 - 124 + 126 1 0 0 @@ -1729,7 +1753,7 @@ 5 - 125 + 127 1 0 0 @@ -1741,7 +1765,7 @@ 5 - 126 + 128 1 0 0 @@ -1753,7 +1777,7 @@ 5 - 127 + 129 1 0 0 @@ -1765,7 +1789,7 @@ 5 - 128 + 130 1 0 0 @@ -1777,7 +1801,7 @@ 5 - 129 + 131 1 0 0 @@ -1789,7 +1813,7 @@ 5 - 130 + 132 1 0 0 @@ -1801,7 +1825,7 @@ 5 - 131 + 133 1 0 0 @@ -1813,7 +1837,7 @@ 5 - 132 + 134 1 0 0 @@ -1825,7 +1849,7 @@ 5 - 133 + 135 1 0 0 @@ -1837,7 +1861,7 @@ 5 - 134 + 136 1 0 0 @@ -1849,7 +1873,7 @@ 5 - 135 + 137 1 0 0 @@ -1861,7 +1885,7 @@ 5 - 136 + 138 1 0 0 @@ -1873,7 +1897,7 @@ 5 - 137 + 139 1 0 0 @@ -1893,7 +1917,7 @@ 0 6 - 138 + 140 1 0 0 @@ -1905,7 +1929,7 @@ 6 - 139 + 141 2 0 0 diff --git a/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Projects/Keil_V5/FreeRTOSDemo.uvprojx b/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Projects/Keil_V5/FreeRTOSDemo.uvprojx index ba0ab789c..db512b130 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Projects/Keil_V5/FreeRTOSDemo.uvprojx +++ b/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Projects/Keil_V5/FreeRTOSDemo.uvprojx @@ -474,6 +474,11 @@ 1 ..\..\..\..\Source\portable\MemMang\heap_4.c + + mpu_wrappers_v2.c + 1 + ..\..\..\..\Source\portable\Common\mpu_wrappers_v2.c + port.c 1 @@ -484,6 +489,11 @@ 5 ..\..\..\..\Source\portable\RVDS\ARM_CM4_MPU\portmacro.h + + mpu_wrappers_v2_asm.c + 1 + ..\..\..\..\Source\portable\RVDS\ARM_CM4_MPU\mpu_wrappers_v2_asm.c + diff --git a/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Config/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Config/FreeRTOSConfig.h index a8393c46a..2b18a173e 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Config/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Config/FreeRTOSConfig.h @@ -47,113 +47,128 @@ extern "C" { settings within this file. Therefore, to ensure all the functions in port.c build, this configuration file has all options turned on. */ -#define configUSE_PREEMPTION 1 -#define configTICK_RATE_HZ ( 1000 ) -#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 -#define configUSE_QUEUE_SETS 1 -#define configUSE_IDLE_HOOK 0 -#define configUSE_TICK_HOOK 0 -#define configCPU_CLOCK_HZ 48000000 -#define configMAX_PRIORITIES ( 5 ) -#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 256 ) -#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 16 * 1024 ) ) -#define configMAX_TASK_NAME_LEN ( 10 ) -#define configUSE_TRACE_FACILITY 1 -#define configUSE_16_BIT_TICKS 0 -#define configIDLE_SHOULD_YIELD 1 -#define configUSE_MUTEXES 1 -#define configQUEUE_REGISTRY_SIZE 5 -#define configCHECK_FOR_STACK_OVERFLOW 2 -#define configUSE_RECURSIVE_MUTEXES 1 -#define configUSE_MALLOC_FAILED_HOOK 1 -#define configUSE_APPLICATION_TASK_TAG 1 -#define configUSE_COUNTING_SEMAPHORES 1 -#define configUSE_TICKLESS_IDLE 0 -#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 2 +/* Ensure definitions are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) + #include + extern uint32_t SystemCoreClock; +#endif + +#define configUSE_PREEMPTION 1 +#define configTICK_RATE_HZ ( 1000 ) +#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 +#define configUSE_QUEUE_SETS 1 +#define configUSE_IDLE_HOOK 0 +#define configUSE_TICK_HOOK 0 +#define configCPU_CLOCK_HZ ( SystemCoreClock ) +#define configMAX_PRIORITIES ( 5 ) +#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 256 ) +#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 16 * 1024 ) ) +#define configMAX_TASK_NAME_LEN ( 10 ) +#define configUSE_TRACE_FACILITY 1 +#define configUSE_16_BIT_TICKS 0 +#define configIDLE_SHOULD_YIELD 1 +#define configUSE_MUTEXES 1 +#define configQUEUE_REGISTRY_SIZE 5 +#define configCHECK_FOR_STACK_OVERFLOW 2 +#define configUSE_RECURSIVE_MUTEXES 1 +#define configUSE_MALLOC_FAILED_HOOK 1 +#define configUSE_APPLICATION_TASK_TAG 1 +#define configUSE_COUNTING_SEMAPHORES 1 +#define configUSE_TICKLESS_IDLE 0 +#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 2 /* This demo shows the MPU being used without any dynamic memory allocation. */ -#define configSUPPORT_STATIC_ALLOCATION 1 -#define configSUPPORT_DYNAMIC_ALLOCATION 1 +#define configSUPPORT_STATIC_ALLOCATION 1 +#define configSUPPORT_DYNAMIC_ALLOCATION 1 /* Run time stats gathering definitions. */ -#define configGENERATE_RUN_TIME_STATS 1 +#define configGENERATE_RUN_TIME_STATS 1 #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() -#define portGET_RUN_TIME_COUNTER_VALUE() 0 +#define portGET_RUN_TIME_COUNTER_VALUE() 0 /* This demo makes use of one or more example stats formatting functions. These format the raw data provided by the uxTaskGetSystemState() function in to human readable ASCII form. See the notes in the implementation of vTaskList() within FreeRTOS/Source/tasks.c for limitations. */ -#define configUSE_STATS_FORMATTING_FUNCTIONS 0 +#define configUSE_STATS_FORMATTING_FUNCTIONS 0 /* Co-routine definitions. */ -#define configUSE_CO_ROUTINES 0 -#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ -#define configUSE_TIMERS 1 -#define configTIMER_TASK_PRIORITY ( 2 ) -#define configTIMER_QUEUE_LENGTH 5 -#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE ) +#define configUSE_TIMERS 1 +#define configTIMER_TASK_PRIORITY ( 2 ) +#define configTIMER_QUEUE_LENGTH 5 +#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ -#define INCLUDE_vTaskPrioritySet 1 -#define INCLUDE_uxTaskPriorityGet 1 -#define INCLUDE_vTaskDelete 1 -#define INCLUDE_vTaskCleanUpResources 1 -#define INCLUDE_vTaskSuspend 1 -#define INCLUDE_vTaskDelayUntil 1 -#define INCLUDE_vTaskDelay 1 -#define INCLUDE_eTaskGetState 1 -#define INCLUDE_xTimerPendFunctionCall 0 -#define INCLUDE_xSemaphoreGetMutexHolder 1 -#define INCLUDE_xTaskGetHandle 1 -#define INCLUDE_xTaskGetCurrentTaskHandle 1 -#define INCLUDE_xTaskGetIdleTaskHandle 1 -#define INCLUDE_xTaskAbortDelay 1 -#define INCLUDE_xTaskGetSchedulerState 1 -#define INCLUDE_xTaskGetIdleTaskHandle 1 -#define INCLUDE_uxTaskGetStackHighWaterMark 1 +#define INCLUDE_vTaskPrioritySet 1 +#define INCLUDE_uxTaskPriorityGet 1 +#define INCLUDE_vTaskDelete 1 +#define INCLUDE_vTaskCleanUpResources 1 +#define INCLUDE_vTaskSuspend 1 +#define INCLUDE_vTaskDelayUntil 1 +#define INCLUDE_vTaskDelay 1 +#define INCLUDE_eTaskGetState 1 +#define INCLUDE_xTimerPendFunctionCall 0 +#define INCLUDE_xSemaphoreGetMutexHolder 1 +#define INCLUDE_xTaskGetHandle 1 +#define INCLUDE_xTaskGetCurrentTaskHandle 1 +#define INCLUDE_xTaskGetIdleTaskHandle 1 +#define INCLUDE_xTaskAbortDelay 1 +#define INCLUDE_xTaskGetSchedulerState 1 +#define INCLUDE_xTaskGetIdleTaskHandle 1 +#define INCLUDE_uxTaskGetStackHighWaterMark 1 /* Cortex-M specific definitions. */ #ifdef __NVIC_PRIO_BITS - /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */ - #define configPRIO_BITS __NVIC_PRIO_BITS + /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */ + #define configPRIO_BITS __NVIC_PRIO_BITS #else - #define configPRIO_BITS 4 /* 15 priority levels */ + #define configPRIO_BITS 4 /* 15 priority levels */ #endif /* The lowest interrupt priority that can be used in a call to a "set priority" function. */ -#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0xf +#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0xf /* The highest interrupt priority that can be used by any interrupt service routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER PRIORITY THAN THIS! (higher priorities are lower numeric values. */ -#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 +#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 /* Interrupt priorities used by the kernel port layer itself. These are generic to all Cortex-M ports, and do not rely on any particular library functions. */ -#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) +#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) /* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ -#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) +#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) +/* Set configUSE_MPU_WRAPPERS_V1 to 0 to use new MPU wrapper. + * See https://freertos.org/a00110.html#configUSE_MPU_WRAPPERS_V1 for details. */ +#define configUSE_MPU_WRAPPERS_V1 ( 0 ) +/* See https://freertos.org/a00110.html#configPROTECTED_KERNEL_OBJECT_POOL_SIZE for details. */ +#define configPROTECTED_KERNEL_OBJECT_POOL_SIZE ( 150 ) +/* See https://freertos.org/a00110.html#configSYSTEM_CALL_STACK_SIZE for details. */ +#define configSYSTEM_CALL_STACK_SIZE ( 128 ) /* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS standard names. */ -#define xPortPendSVHandler PendSV_Handler -#define vPortSVCHandler SVC_Handler -#define xPortSysTickHandler SysTick_Handler +#define xPortPendSVHandler PendSV_Handler +#define vPortSVCHandler SVC_Handler +#define xPortSysTickHandler SysTick_Handler /* Normal assert() semantics without relying on the provision of an assert.h header file. */ -#define configASSERT( x ) if( ( x ) == 0 ) { portDISABLE_INTERRUPTS(); for( ;; ); } +#define configASSERT( x ) if( ( x ) == 0 ) { portDISABLE_INTERRUPTS(); for( ;; ); } /* Ensure that system calls can only be made from kernel code. */ -#define configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY 1 +#define configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY 1 +/* Do no allow unprivileged critical sections. */ +#define configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS 0 #ifdef __cplusplus } diff --git a/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/GCC/STM32L475VGTX_FLASH.ld b/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/GCC/STM32L475VGTX_FLASH.ld index 7e4ed39ed..2cc88ce14 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/GCC/STM32L475VGTX_FLASH.ld +++ b/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/GCC/STM32L475VGTX_FLASH.ld @@ -69,7 +69,7 @@ MEMORY /* Initial 32K Flash is used to store kernel functions and * initial 32K RAM is used to store kernel data. */ -__privileged_functions_region_size__ = 32K; +__privileged_functions_region_size__ = 64K; __privileged_data_region_size__ = 32K; __FLASH_segment_start__ = ORIGIN( FLASH ); diff --git a/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/IAR/MPUDemo.ewp b/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/IAR/MPUDemo.ewp index 73440282a..3e46c9d73 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/IAR/MPUDemo.ewp +++ b/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/IAR/MPUDemo.ewp @@ -11,9 +11,13 @@ General 3 - 31 + 35 1 1 + - - - - - + + + + + ICCARM 2 - 34 + 37 1 1 - - - + + AARM 2 - 10 + 11 1 1 + @@ -674,13 +674,9 @@ 0 + inputOutputBased - - BICOMP - 0 - - BUILDACTION 1 @@ -693,17 +689,13 @@ ILINK 0 - 21 + 27 1 1 - + + + + + + + + + + + + + + @@ -1032,11 +1080,6 @@ - - BILINK - 0 - - Config @@ -1076,6 +1119,12 @@ $PROJ_DIR$\..\..\..\..\Source\portable\Common\mpu_wrappers.c + + $PROJ_DIR$\..\..\..\..\Source\portable\Common\mpu_wrappers_v2.c + + + $PROJ_DIR$\..\..\..\..\Source\portable\IAR\ARM_CM4F_MPU\mpu_wrappers_v2_asm.S + $PROJ_DIR$\..\..\..\..\Source\portable\IAR\ARM_CM4F_MPU\port.c diff --git a/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/Keil/MPUDemo.sct b/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/Keil/MPUDemo.sct index 729d7ad50..e9203f22e 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/Keil/MPUDemo.sct +++ b/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/Keil/MPUDemo.sct @@ -23,7 +23,7 @@ LR_APP 0x08000000 0x100000 ; load region size_region *(privileged_functions) } - ER_IROM_FREERTOS_SYSTEM_CALLS 0x08008000 FIXED + ER_IROM_FREERTOS_SYSTEM_CALLS 0x08010000 FIXED { *(freertos_system_calls) } diff --git a/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/Keil/MPUDemo.uvoptx b/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/Keil/MPUDemo.uvoptx index 6cdaf39cd..19a7dcbd6 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/Keil/MPUDemo.uvoptx +++ b/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/Keil/MPUDemo.uvoptx @@ -10,7 +10,7 @@ *.s*; *.src; *.a* *.obj; *.o *.lib - *.txt; *.h; *.inc + *.txt; *.h; *.inc; *.md *.plm *.cpp 0 @@ -103,7 +103,7 @@ 1 0 0 - 5 + 6 @@ -342,6 +342,18 @@ 0 0 0 + ../../../../Source/portable/Common/mpu_wrappers_v2.c + mpu_wrappers_v2.c + 0 + 0 + + + 2 + 12 + 1 + 0 + 0 + 0 ../../../../Source/portable/GCC/ARM_CM4_MPU/port.c port.c 0 @@ -349,7 +361,19 @@ 2 - 12 + 13 + 5 + 0 + 0 + 0 + ../../../../Source/portable/GCC/ARM_CM4_MPU/mpu_wrappers_v2_asm.c + portmacro.h + 0 + 0 + + + 2 + 14 5 0 0 @@ -361,7 +385,7 @@ 2 - 13 + 15 1 0 0 @@ -371,6 +395,18 @@ 0 0 + + 2 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\Source\portable\GCC\ARM_CM4_MPU\mpu_wrappers_v2_asm.c + mpu_wrappers_v2_asm.c + 0 + 0 + @@ -381,7 +417,7 @@ 0 3 - 14 + 17 5 0 0 @@ -401,7 +437,7 @@ 0 4 - 15 + 18 1 0 0 @@ -413,7 +449,7 @@ 4 - 16 + 19 5 0 0 @@ -425,7 +461,7 @@ 4 - 17 + 20 1 0 0 @@ -437,7 +473,7 @@ 4 - 18 + 21 5 0 0 @@ -457,7 +493,7 @@ 0 5 - 19 + 22 1 0 0 @@ -469,7 +505,7 @@ 5 - 20 + 23 1 0 0 @@ -481,7 +517,7 @@ 5 - 21 + 24 1 0 0 @@ -493,7 +529,7 @@ 5 - 22 + 25 1 0 0 @@ -513,7 +549,7 @@ 0 6 - 23 + 26 1 0 0 @@ -525,7 +561,7 @@ 6 - 24 + 27 1 0 0 @@ -537,7 +573,7 @@ 6 - 25 + 28 1 0 0 @@ -549,7 +585,7 @@ 6 - 26 + 29 1 0 0 @@ -561,7 +597,7 @@ 6 - 27 + 30 1 0 0 @@ -573,7 +609,7 @@ 6 - 28 + 31 1 0 0 @@ -585,7 +621,7 @@ 6 - 29 + 32 1 0 0 @@ -597,7 +633,7 @@ 6 - 30 + 33 1 0 0 @@ -609,7 +645,7 @@ 6 - 31 + 34 1 0 0 @@ -621,7 +657,7 @@ 6 - 32 + 35 1 0 0 @@ -633,7 +669,7 @@ 6 - 33 + 36 1 0 0 @@ -645,7 +681,7 @@ 6 - 34 + 37 1 0 0 @@ -657,7 +693,7 @@ 6 - 35 + 38 1 0 0 @@ -669,7 +705,7 @@ 6 - 36 + 39 1 0 0 @@ -681,7 +717,7 @@ 6 - 37 + 40 1 0 0 @@ -693,7 +729,7 @@ 6 - 38 + 41 1 0 0 @@ -705,7 +741,7 @@ 6 - 39 + 42 1 0 0 @@ -717,7 +753,7 @@ 6 - 40 + 43 1 0 0 @@ -729,7 +765,7 @@ 6 - 41 + 44 1 0 0 @@ -741,7 +777,7 @@ 6 - 42 + 45 1 0 0 @@ -753,7 +789,7 @@ 6 - 43 + 46 1 0 0 @@ -765,7 +801,7 @@ 6 - 44 + 47 1 0 0 @@ -777,7 +813,7 @@ 6 - 45 + 48 1 0 0 @@ -789,7 +825,7 @@ 6 - 46 + 49 1 0 0 @@ -801,7 +837,7 @@ 6 - 47 + 50 1 0 0 @@ -813,7 +849,7 @@ 6 - 48 + 51 1 0 0 @@ -833,7 +869,7 @@ 0 7 - 49 + 52 1 0 0 diff --git a/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/Keil/MPUDemo.uvprojx b/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/Keil/MPUDemo.uvprojx index b69de9de1..5aa766a90 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/Keil/MPUDemo.uvprojx +++ b/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/Keil/MPUDemo.uvprojx @@ -10,14 +10,14 @@ MPUDemo 0x4 ARM-ADS - 6130001::V6.13.1::.\ARMCLANG + 6190000::V6.19::ARMCLANG 1 STM32L475VGTx STMicroelectronics - Keil.STM32L4xx_DFP.2.2.0 - http://www.keil.com/pack + Keil.STM32L4xx_DFP.2.6.2 + https://www.keil.com/pack/ IRAM(0x20000000-0x20017FFF) IRAM2(0x10000000-0x10007FFF) IROM(0x8000000-0x80FFFFF) CLOCK(8000000) FPU2 CPUTYPE("Cortex-M4") @@ -185,6 +185,8 @@ 0 2 0 + 0 + 0 1 0 8 @@ -305,14 +307,14 @@ 0 0x10000000 - 0x8000 + 0x40000 1 - 1 + 2 0 0 1 @@ -328,7 +330,7 @@ 0 0 3 - 3 + 5 1 1 0 @@ -351,7 +353,7 @@ 0 0 0 - 0 + 4 @@ -437,11 +439,21 @@ 1 ../../../../Source/portable/Common/mpu_wrappers.c + + mpu_wrappers_v2.c + 1 + ../../../../Source/portable/Common/mpu_wrappers_v2.c + port.c 1 ../../../../Source/portable/GCC/ARM_CM4_MPU/port.c + + portmacro.h + 5 + ../../../../Source/portable/GCC/ARM_CM4_MPU/mpu_wrappers_v2_asm.c + portmacro.h 5 @@ -452,6 +464,11 @@ 1 ../../../../Source/portable/MemMang/heap_4.c + + mpu_wrappers_v2_asm.c + 1 + ..\..\..\..\Source\portable\GCC\ARM_CM4_MPU\mpu_wrappers_v2_asm.c + @@ -720,8 +737,8 @@ - - + + diff --git a/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/Keil/memfault_handler.c b/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/Keil/memfault_handler.c index d2186c483..b4589e05d 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/Keil/memfault_handler.c +++ b/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/Keil/memfault_handler.c @@ -37,7 +37,7 @@ const uint32_t * __SRAM_segment_start__ = ( uint32_t * ) 0x20000000; const uint32_t * __SRAM_segment_end__ = ( uint32_t * ) 0x20018000; const uint32_t * __privileged_functions_start__ = ( uint32_t * ) 0x08000000; -const uint32_t * __privileged_functions_end__ = ( uint32_t * ) 0x08008000; +const uint32_t * __privileged_functions_end__ = ( uint32_t * ) 0x08010000; const uint32_t * __privileged_data_start__ = ( uint32_t * ) 0x20000000; const uint32_t * __privileged_data_end__ = ( uint32_t * ) 0x20008000; diff --git a/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/FreeRTOSConfig.h index 2b1e13223..722108fef 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/FreeRTOSConfig.h @@ -47,106 +47,113 @@ extern "C" { /* The MPU version of port.c includes and excludes functions depending on the settings within this file. Therefore, to ensure all the functions in port.c build, this configuration file has all options turned on. */ -#define configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY 1 -#define configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS 0 -#define configUSE_PREEMPTION 1 -#define configTICK_RATE_HZ ( 1000 ) -#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 -#define configUSE_QUEUE_SETS 1 -#define configUSE_IDLE_HOOK 1 -#define configUSE_TICK_HOOK 1 -#define configCPU_CLOCK_HZ 48000000 -#define configMAX_PRIORITIES ( 5 ) -#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 120 ) -#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 15 * 1024 ) ) -#define configMAX_TASK_NAME_LEN ( 10 ) -#define configUSE_TRACE_FACILITY 1 -#define configUSE_16_BIT_TICKS 0 -#define configIDLE_SHOULD_YIELD 1 -#define configUSE_MUTEXES 1 -#define configQUEUE_REGISTRY_SIZE 5 -#define configCHECK_FOR_STACK_OVERFLOW 2 -#define configUSE_RECURSIVE_MUTEXES 1 -#define configUSE_MALLOC_FAILED_HOOK 1 -#define configUSE_APPLICATION_TASK_TAG 1 -#define configUSE_COUNTING_SEMAPHORES 1 -#define configSUPPORT_STATIC_ALLOCATION 0 -#define configUSE_TICKLESS_IDLE 0 -#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 2 +#define configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY 1 +#define configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS 0 +#define configUSE_PREEMPTION 1 +#define configTICK_RATE_HZ ( 1000 ) +#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 +#define configUSE_QUEUE_SETS 1 +#define configUSE_IDLE_HOOK 1 +#define configUSE_TICK_HOOK 1 +#define configCPU_CLOCK_HZ 48000000 +#define configMAX_PRIORITIES ( 5 ) +#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 120 ) +#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 12 * 1024 ) ) +#define configMAX_TASK_NAME_LEN ( 10 ) +#define configUSE_TRACE_FACILITY 1 +#define configUSE_16_BIT_TICKS 0 +#define configIDLE_SHOULD_YIELD 1 +#define configUSE_MUTEXES 1 +#define configQUEUE_REGISTRY_SIZE 5 +#define configCHECK_FOR_STACK_OVERFLOW 2 +#define configUSE_RECURSIVE_MUTEXES 1 +#define configUSE_MALLOC_FAILED_HOOK 1 +#define configUSE_APPLICATION_TASK_TAG 1 +#define configUSE_COUNTING_SEMAPHORES 1 +#define configSUPPORT_STATIC_ALLOCATION 0 +#define configUSE_TICKLESS_IDLE 0 +#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 2 /* Run time stats gathering definitions. */ -#define configGENERATE_RUN_TIME_STATS 1 +#define configGENERATE_RUN_TIME_STATS 1 #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() -#define portGET_RUN_TIME_COUNTER_VALUE() 0 +#define portGET_RUN_TIME_COUNTER_VALUE() 0 /* This demo makes use of one or more example stats formatting functions. These format the raw data provided by the uxTaskGetSystemState() function in to human readable ASCII form. See the notes in the implementation of vTaskList() within FreeRTOS/Source/tasks.c for limitations. */ -#define configUSE_STATS_FORMATTING_FUNCTIONS 0 +#define configUSE_STATS_FORMATTING_FUNCTIONS 0 /* Co-routine definitions. */ -#define configUSE_CO_ROUTINES 0 -#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ -#define configUSE_TIMERS 1 -#define configTIMER_TASK_PRIORITY ( 2 ) -#define configTIMER_QUEUE_LENGTH 5 -#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE ) +#define configUSE_TIMERS 1 +#define configTIMER_TASK_PRIORITY ( 2 ) +#define configTIMER_QUEUE_LENGTH 5 +#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ -#define INCLUDE_vTaskPrioritySet 1 -#define INCLUDE_uxTaskPriorityGet 1 -#define INCLUDE_vTaskDelete 1 -#define INCLUDE_vTaskCleanUpResources 1 -#define INCLUDE_vTaskSuspend 1 -#define INCLUDE_vTaskDelayUntil 1 -#define INCLUDE_vTaskDelay 1 -#define INCLUDE_eTaskGetState 1 -#define INCLUDE_xTimerPendFunctionCall 1 -#define INCLUDE_xSemaphoreGetMutexHolder 1 -#define INCLUDE_xTaskGetHandle 1 -#define INCLUDE_xTaskGetCurrentTaskHandle 1 -#define INCLUDE_xTaskGetIdleTaskHandle 1 -#define INCLUDE_xTaskAbortDelay 1 -#define INCLUDE_xTaskGetSchedulerState 1 -#define INCLUDE_xTaskGetIdleTaskHandle 1 -#define INCLUDE_uxTaskGetStackHighWaterMark 1 -#define INCLUDE_uxTaskGetStackHighWaterMark2 1 +#define INCLUDE_vTaskPrioritySet 1 +#define INCLUDE_uxTaskPriorityGet 1 +#define INCLUDE_vTaskDelete 1 +#define INCLUDE_vTaskCleanUpResources 1 +#define INCLUDE_vTaskSuspend 1 +#define INCLUDE_vTaskDelayUntil 1 +#define INCLUDE_vTaskDelay 1 +#define INCLUDE_eTaskGetState 1 +#define INCLUDE_xTimerPendFunctionCall 1 +#define INCLUDE_xSemaphoreGetMutexHolder 1 +#define INCLUDE_xTaskGetHandle 1 +#define INCLUDE_xTaskGetCurrentTaskHandle 1 +#define INCLUDE_xTaskGetIdleTaskHandle 1 +#define INCLUDE_xTaskAbortDelay 1 +#define INCLUDE_xTaskGetSchedulerState 1 +#define INCLUDE_xTaskGetIdleTaskHandle 1 +#define INCLUDE_uxTaskGetStackHighWaterMark 1 +#define INCLUDE_uxTaskGetStackHighWaterMark2 1 /* Cortex-M specific definitions. */ #ifdef __NVIC_PRIO_BITS - /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */ - #define configPRIO_BITS __NVIC_PRIO_BITS + /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */ + #define configPRIO_BITS __NVIC_PRIO_BITS #else - #define configPRIO_BITS 4 /* 15 priority levels */ + #define configPRIO_BITS 4 /* 15 priority levels */ #endif /* The lowest interrupt priority that can be used in a call to a "set priority" function. */ -#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0xf +#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0xf /* The highest interrupt priority that can be used by any interrupt service routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER PRIORITY THAN THIS! (higher priorities are lower numeric values. */ -#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 +#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 /* Interrupt priorities used by the kernel port layer itself. These are generic to all Cortex-M ports, and do not rely on any particular library functions. */ -#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) +#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << ( 8 - configPRIO_BITS ) ) /* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ -#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) +#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << ( 8 - configPRIO_BITS ) ) +/* Set configUSE_MPU_WRAPPERS_V1 to 0 to use new MPU wrapper. + * See https://freertos.org/a00110.html#configUSE_MPU_WRAPPERS_V1 for details. */ +#define configUSE_MPU_WRAPPERS_V1 ( 0 ) +/* See https://freertos.org/a00110.html#configPROTECTED_KERNEL_OBJECT_POOL_SIZE for details. */ +#define configPROTECTED_KERNEL_OBJECT_POOL_SIZE ( 150 ) +/* See https://freertos.org/a00110.html#configSYSTEM_CALL_STACK_SIZE for details. */ +#define configSYSTEM_CALL_STACK_SIZE ( 128 ) /* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS standard names. */ -#define xPortPendSVHandler PendSV_Handler -#define vPortSVCHandler SVC_Handler -#define xPortSysTickHandler SysTick_Handler +#define xPortPendSVHandler PendSV_Handler +#define vPortSVCHandler SVC_Handler +#define xPortSysTickHandler SysTick_Handler /* Normal assert() semantics without relying on the provision of an assert.h header file. */ @@ -154,19 +161,19 @@ header file. */ /* LED not used at present, so just increment a variable to keep a count of the number of times the LED would otherwise have been toggled. */ -#define configTOGGLE_LED() ulLED++ +#define configTOGGLE_LED() ulLED++ /* Definitions for the messages that can be sent to the check task. */ -#define configREG_TEST_1_STILL_EXECUTING ( 0 ) -#define configREG_TEST_2_STILL_EXECUTING ( 1 ) -#define configTIMER_STILL_EXECUTING ( 2 ) -#define configPRINT_SYSTEM_STATUS ( 3 ) +#define configREG_TEST_1_STILL_EXECUTING ( 0 ) +#define configREG_TEST_2_STILL_EXECUTING ( 1 ) +#define configTIMER_STILL_EXECUTING ( 2 ) +#define configPRINT_SYSTEM_STATUS ( 3 ) /* Parameters that are passed into the third and fourth register check tasks solely for the purpose of ensuring parameters are passed into tasks correctly. */ -#define configREG_TEST_TASK_1_PARAMETER ( ( void * ) 0x11112222 ) -#define configREG_TEST_TASK_3_PARAMETER ( ( void * ) 0x12345678 ) -#define configREG_TEST_TASK_4_PARAMETER ( ( void * ) 0x87654321 ) +#define configREG_TEST_TASK_1_PARAMETER ( ( void * ) 0x11112222 ) +#define configREG_TEST_TASK_3_PARAMETER ( ( void * ) 0x12345678 ) +#define configREG_TEST_TASK_4_PARAMETER ( ( void * ) 0x87654321 ) #ifdef __cplusplus } diff --git a/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/GCC_Specific/RTOSDemo.uvoptx b/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/GCC_Specific/RTOSDemo.uvoptx index 44044fed4..e8fac7290 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/GCC_Specific/RTOSDemo.uvoptx +++ b/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/GCC_Specific/RTOSDemo.uvoptx @@ -171,14 +171,6 @@ pxCurrentTCB - - - 1 - 2 - 0x20000598 - 4 - - 0 @@ -226,7 +218,7 @@ System - 1 + 0 0 0 0 @@ -246,7 +238,7 @@ application_and_config - 1 + 0 0 0 0 @@ -290,7 +282,7 @@ FreeRTOS_Source - 1 + 0 0 0 0 @@ -385,6 +377,18 @@ 0 0 0 + ..\..\..\Source\portable\Common\mpu_wrappers_v2.c + mpu_wrappers_v2.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 ..\..\..\Source\portable\GCC\ARM_CM4_MPU\port.c port.c 0 @@ -392,7 +396,19 @@ 3 - 13 + 14 + 1 + 0 + 0 + 0 + ..\..\..\Source\portable\GCC\ARM_CM4_MPU\mpu_wrappers_v2_asm.c + mpu_wrappers_v2_asm.c + 0 + 0 + + + 3 + 15 1 0 0 diff --git a/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/GCC_Specific/RTOSDemo.uvprojx b/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/GCC_Specific/RTOSDemo.uvprojx index e96b4afe6..fd6c5f414 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/GCC_Specific/RTOSDemo.uvprojx +++ b/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/GCC_Specific/RTOSDemo.uvprojx @@ -16,7 +16,7 @@ ARMCM4_FP ARM - ARM.CMSIS.5.8.0 + ARM.CMSIS.5.9.0 http://www.keil.com/pack/ IRAM(0x20000000,0x00020000) IROM(0x00000000,0x00040000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ESEL ELITTLE @@ -170,6 +170,7 @@ 2 0 0 + 0 0 0 @@ -342,11 +343,21 @@ 1 ..\..\..\Source\portable\Common\mpu_wrappers.c + + mpu_wrappers_v2.c + 1 + ..\..\..\Source\portable\Common\mpu_wrappers_v2.c + port.c 1 ..\..\..\Source\portable\GCC\ARM_CM4_MPU\port.c + + mpu_wrappers_v2_asm.c + 1 + ..\..\..\Source\portable\GCC\ARM_CM4_MPU\mpu_wrappers_v2_asm.c + stream_buffer.c 1 diff --git a/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/GCC_Specific/sections.ld b/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/GCC_Specific/sections.ld index 7ca08513e..f0137fd94 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/GCC_Specific/sections.ld +++ b/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/GCC_Specific/sections.ld @@ -2,12 +2,12 @@ MEMORY { ROM (rx) : ORIGIN = 0x00, LENGTH = 0x80000 - RAM (rw) : ORIGIN = 0x20000000, LENGTH = 0x8000 + RAM (rw) : ORIGIN = 0x20000000, LENGTH = 0x08000 } /* Variables used by FreeRTOS-MPU. */ -_Privileged_Functions_Region_Size = 32K; -_Privileged_Data_Region_Size = 16384; +_Privileged_Functions_Region_Size = 64K; +_Privileged_Data_Region_Size = 16K; __FLASH_segment_start__ = ORIGIN( ROM ); __FLASH_segment_end__ = __FLASH_segment_start__ + LENGTH( ROM ); diff --git a/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.sct b/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.sct index 9b73fb1d0..7701da1e9 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.sct +++ b/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.sct @@ -4,18 +4,21 @@ LR_IROM1 0x00000000 { ; load region size_region - ER_IROM1 0x00000000 { ; load address = execution address + ER_IROM_PRIVILEGED 0x00000000 { ; load address = execution address *.o (RESET, +First) *(InRoot$$Sections) *( privileged_functions ) } - ER_IROM2 0x8000 FIXED { + ER_IROM_FREERTOS_SYSTEM_CALLS 0x00010000 FIXED { + *(freertos_system_calls) + } + ER_IROM_UNPRIVILEGED +0 { .ANY (+RO) } - RW_IRAM1 0x20000000 { ; RW data + RW_IRAM_PRIVILEGED 0x20000000 { ; RW data *( privileged_data ) } - RW_IRAM2 0x20000200 { ; RW data + RW_IRAM_UNPRIVILEGED 0x20004000 { ; RW data .ANY (+RW +ZI) } } diff --git a/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.uvoptx b/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.uvoptx index 34aaca798..a002768bd 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.uvoptx +++ b/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.uvoptx @@ -108,7 +108,7 @@ - + ..\simulator.ini @@ -120,7 +120,7 @@ 0 DLGDARM - (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0) + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(1012=2616,304,3091,618,0) 0 @@ -160,20 +160,7 @@ 1 ulCycleCount - - 2 - 1 - *(unsigned long *)0x200005E4 - - - - 1 - 2 - 0xe000e284 - 4 - - 0 @@ -221,7 +208,7 @@ System - 1 + 0 0 0 0 @@ -241,7 +228,7 @@ main_and_config - 1 + 0 0 0 0 @@ -285,7 +272,7 @@ FreeRTOS_Source - 1 + 0 0 0 0 @@ -380,6 +367,18 @@ 0 0 0 + ..\..\..\Source\portable\RVDS\ARM_CM4_MPU\mpu_wrappers_v2_asm.c + mpu_wrappers_v2_asm.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 ..\..\..\Source\portable\Common\mpu_wrappers.c mpu_wrappers.c 0 @@ -387,7 +386,19 @@ 3 - 13 + 14 + 1 + 0 + 0 + 0 + ..\..\..\Source\portable\Common\mpu_wrappers_v2.c + mpu_wrappers_v2.c + 0 + 0 + + + 3 + 15 1 0 0 diff --git a/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.uvprojx b/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.uvprojx index c4c29d0c9..3fbf7dbf0 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.uvprojx +++ b/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.uvprojx @@ -10,13 +10,13 @@ RTOSDemo 0x4 ARM-ADS - 5060960::V5.06 update 7 (build 960)::.\ARMCC + 5060960::V5.06 update 7 (build 960)::..\..\Program Files (x86)\ARM_Compiler_5.06u7 0 ARMCM4_FP ARM - ARM.CMSIS.5.8.0 + ARM.CMSIS.5.9.0 http://www.keil.com/pack/ IROM(0x00000000,0x80000) IRAM(0x20000000,0x20000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ESEL ELITTLE @@ -186,6 +186,7 @@ 2 0 0 + 0 0 0 8 @@ -448,11 +449,21 @@ 1 ..\..\..\Source\portable\RVDS\ARM_CM4_MPU\port.c + + mpu_wrappers_v2_asm.c + 1 + ..\..\..\Source\portable\RVDS\ARM_CM4_MPU\mpu_wrappers_v2_asm.c + mpu_wrappers.c 1 ..\..\..\Source\portable\Common\mpu_wrappers.c + + mpu_wrappers_v2.c + 1 + ..\..\..\Source\portable\Common\mpu_wrappers_v2.c + stream_buffer.c 1 diff --git a/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/main.c b/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/main.c index b79cb37a2..868b8dc5f 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/main.c +++ b/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/main.c @@ -137,9 +137,9 @@ static void prvCheckTask( void *pvParameters ); * * It is not possible to use xTaskCreate() to create an unprivileged task since * heap moved to the privileged data section, so the access tests implemented by - * this function are now called from an unprivileged register check task created - * using the xTaskCreateRestricted() API. - */ + * this function are now called from an unprivileged register check task created + * using the xTaskCreateRestricted() API. + */ static void prvOldStyleUserModeTask( void ); /* @@ -240,15 +240,20 @@ volatile uint32_t ul1 = 0x123, ul2 = 0; extern uint32_t __privileged_functions_actual_end__[]; extern uint32_t __privileged_data_actual_end__[]; #else + extern uint32_t Image$$ER_IROM_FREERTOS_SYSTEM_CALLS$$Base; + extern uint32_t Image$$ER_IROM_FREERTOS_SYSTEM_CALLS$$Limit; + /* Must be set manually to match memory map. */ - const uint32_t * __FLASH_segment_start__ = ( uint32_t * ) 0x00UL; + const uint32_t * __FLASH_segment_start__ = ( uint32_t * ) 0x00000000UL; const uint32_t * __FLASH_segment_end__ = ( uint32_t * ) 0x00080000UL; const uint32_t * __SRAM_segment_start__ = ( uint32_t * ) 0x20000000UL; const uint32_t * __SRAM_segment_end__ = ( uint32_t * ) 0x20008000UL; - const uint32_t * __privileged_functions_start__ = ( uint32_t * ) 0x00UL; - const uint32_t * __privileged_functions_end__ = ( uint32_t * ) 0x8000UL; + const uint32_t * __privileged_functions_start__ = ( uint32_t * ) 0x00000000UL; + const uint32_t * __privileged_functions_end__ = ( uint32_t * ) 0x00010000UL; + const uint32_t * __syscalls_flash_start__ = ( uint32_t * ) &( Image$$ER_IROM_FREERTOS_SYSTEM_CALLS$$Base ); + const uint32_t * __syscalls_flash_end__ = ( uint32_t * ) &( Image$$ER_IROM_FREERTOS_SYSTEM_CALLS$$Limit ); const uint32_t * __privileged_data_start__ = ( uint32_t * ) 0x20000000UL; - const uint32_t * __privileged_data_end__ = ( uint32_t * ) 0x20000200UL; + const uint32_t * __privileged_data_end__ = ( uint32_t * ) 0x20004000UL; #endif /*-----------------------------------------------------------*/ /* Data used by the 'check' task. ---------------------------*/ @@ -263,7 +268,7 @@ stack size is defined in words, not bytes. */ automatically create an MPU region for the stack. The stack alignment must match its size, so if 128 words are reserved for the stack then it must be aligned to ( 128 * 4 ) bytes. */ -PRIVILEGED_DATA static portSTACK_TYPE xCheckTaskStack[ mainCHECK_TASK_STACK_SIZE_WORDS ] mainALIGN_TO( mainCHECK_TASK_STACK_ALIGNMENT ); +static portSTACK_TYPE xCheckTaskStack[ mainCHECK_TASK_STACK_SIZE_WORDS ] mainALIGN_TO( mainCHECK_TASK_STACK_ALIGNMENT ); /* Declare three arrays - an MPU region will be created for each array using the TaskParameters_t structure below. THIS IS JUST TO DEMONSTRATE THE @@ -429,7 +434,7 @@ static TaskParameters_t xTaskToDeleteParameters = mainTASK_TO_DELETE_NAME, /* pcName */ mainDELETE_TASK_STACK_SIZE_WORDS, /* usStackDepth */ ( void * ) NULL, /* pvParameters - this task uses the parameter to pass in a queue handle, but the queue is not created yet. */ - tskIDLE_PRIORITY + 1, /* uxPriority */ + ( tskIDLE_PRIORITY + 1 ) | portPRIVILEGE_BIT, /* uxPriority - this task is privileged because it creates and deletes kernel objects. */ xDeleteTaskStack, /* puxStackBuffer - the array to use as the task stack, as declared above. */ { /* xRegions - this task does not use any non-stack data hence all members are zero. */ /* Base address Length Parameters */ @@ -812,7 +817,7 @@ static void prvTaskToDelete( void *pvParameters ) configASSERT( uxTaskGetStackHighWaterMark2( NULL ) > 0 ); /* Run time stats are not being gathered - this is just to exercise API. */ - configASSERT( ulTaskGetIdleRunTimeCounter() == 0 ); + configASSERT( ulTaskGetIdleRunTimeCounter() == 0 ); vTaskSuspend( NULL ); } /*-----------------------------------------------------------*/ @@ -1232,7 +1237,7 @@ static void prvRegTest3Task( void *pvParameters ) Since the heap moved to the privileged data section xTaskCreate() can no longer be used to create unprivileged tasks. */ prvOldStyleUserModeTask(); - + /* Start the part of the test that is written in assembler. */ vRegTest3Implementation(); } diff --git a/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/FreeRTOSConfig.h index 17d51d7d2..3a460f9cb 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/FreeRTOSConfig.h @@ -48,106 +48,113 @@ extern "C" { settings within this file. Therefore, to ensure all the functions in port.c build, this configuration file has all options turned on. */ -#define configUSE_PREEMPTION 1 -#define configTICK_RATE_HZ ( 1000 ) -#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 -#define configUSE_QUEUE_SETS 1 -#define configUSE_IDLE_HOOK 1 -#define configUSE_TICK_HOOK 1 -#define configCPU_CLOCK_HZ 48000000 -#define configMAX_PRIORITIES ( 5 ) -#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 120 ) -#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 16 * 1024 ) ) -#define configMAX_TASK_NAME_LEN ( 10 ) -#define configUSE_TRACE_FACILITY 1 -#define configUSE_16_BIT_TICKS 0 -#define configIDLE_SHOULD_YIELD 1 -#define configUSE_MUTEXES 1 -#define configQUEUE_REGISTRY_SIZE 5 -#define configCHECK_FOR_STACK_OVERFLOW 2 -#define configUSE_RECURSIVE_MUTEXES 1 -#define configUSE_MALLOC_FAILED_HOOK 1 -#define configUSE_APPLICATION_TASK_TAG 1 -#define configUSE_COUNTING_SEMAPHORES 1 -#define configUSE_TICKLESS_IDLE 0 -#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 2 +#define configUSE_PREEMPTION 1 +#define configTICK_RATE_HZ ( 1000 ) +#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 +#define configUSE_QUEUE_SETS 1 +#define configUSE_IDLE_HOOK 1 +#define configUSE_TICK_HOOK 1 +#define configCPU_CLOCK_HZ 48000000 +#define configMAX_PRIORITIES ( 5 ) +#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 120 ) +#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 16 * 1024 ) ) +#define configMAX_TASK_NAME_LEN ( 10 ) +#define configUSE_TRACE_FACILITY 1 +#define configUSE_16_BIT_TICKS 0 +#define configIDLE_SHOULD_YIELD 1 +#define configUSE_MUTEXES 1 +#define configQUEUE_REGISTRY_SIZE 5 +#define configCHECK_FOR_STACK_OVERFLOW 2 +#define configUSE_RECURSIVE_MUTEXES 1 +#define configUSE_MALLOC_FAILED_HOOK 1 +#define configUSE_APPLICATION_TASK_TAG 1 +#define configUSE_COUNTING_SEMAPHORES 1 +#define configUSE_TICKLESS_IDLE 0 +#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 2 /* This demo shows the MPU being used without any dynamic memory allocation. */ -#define configSUPPORT_STATIC_ALLOCATION 1 -#define configSUPPORT_DYNAMIC_ALLOCATION 0 +#define configSUPPORT_STATIC_ALLOCATION 1 +#define configSUPPORT_DYNAMIC_ALLOCATION 0 /* Run time stats gathering definitions. */ -#define configGENERATE_RUN_TIME_STATS 1 +#define configGENERATE_RUN_TIME_STATS 1 #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() -#define portGET_RUN_TIME_COUNTER_VALUE() 0 +#define portGET_RUN_TIME_COUNTER_VALUE() 0 /* This demo makes use of one or more example stats formatting functions. These format the raw data provided by the uxTaskGetSystemState() function in to human readable ASCII form. See the notes in the implementation of vTaskList() within FreeRTOS/Source/tasks.c for limitations. */ -#define configUSE_STATS_FORMATTING_FUNCTIONS 0 +#define configUSE_STATS_FORMATTING_FUNCTIONS 0 /* Co-routine definitions. */ -#define configUSE_CO_ROUTINES 0 -#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Software timer definitions. */ -#define configUSE_TIMERS 1 -#define configTIMER_TASK_PRIORITY ( 2 ) -#define configTIMER_QUEUE_LENGTH 5 -#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE ) +#define configUSE_TIMERS 1 +#define configTIMER_TASK_PRIORITY ( 2 ) +#define configTIMER_QUEUE_LENGTH 5 +#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE ) /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ -#define INCLUDE_vTaskPrioritySet 1 -#define INCLUDE_uxTaskPriorityGet 1 -#define INCLUDE_vTaskDelete 1 -#define INCLUDE_vTaskCleanUpResources 1 -#define INCLUDE_vTaskSuspend 1 -#define INCLUDE_vTaskDelayUntil 1 -#define INCLUDE_vTaskDelay 1 -#define INCLUDE_eTaskGetState 1 -#define INCLUDE_xTimerPendFunctionCall 0 -#define INCLUDE_xSemaphoreGetMutexHolder 1 -#define INCLUDE_xTaskGetHandle 1 -#define INCLUDE_xTaskGetCurrentTaskHandle 1 -#define INCLUDE_xTaskGetIdleTaskHandle 1 -#define INCLUDE_xTaskAbortDelay 1 -#define INCLUDE_xTaskGetSchedulerState 1 -#define INCLUDE_xTaskGetIdleTaskHandle 1 -#define INCLUDE_uxTaskGetStackHighWaterMark 1 +#define INCLUDE_vTaskPrioritySet 1 +#define INCLUDE_uxTaskPriorityGet 1 +#define INCLUDE_vTaskDelete 1 +#define INCLUDE_vTaskCleanUpResources 1 +#define INCLUDE_vTaskSuspend 1 +#define INCLUDE_vTaskDelayUntil 1 +#define INCLUDE_vTaskDelay 1 +#define INCLUDE_eTaskGetState 1 +#define INCLUDE_xTimerPendFunctionCall 0 +#define INCLUDE_xSemaphoreGetMutexHolder 1 +#define INCLUDE_xTaskGetHandle 1 +#define INCLUDE_xTaskGetCurrentTaskHandle 1 +#define INCLUDE_xTaskGetIdleTaskHandle 1 +#define INCLUDE_xTaskAbortDelay 1 +#define INCLUDE_xTaskGetSchedulerState 1 +#define INCLUDE_xTaskGetIdleTaskHandle 1 +#define INCLUDE_uxTaskGetStackHighWaterMark 1 /* Cortex-M specific definitions. */ #ifdef __NVIC_PRIO_BITS - /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */ - #define configPRIO_BITS __NVIC_PRIO_BITS + /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */ + #define configPRIO_BITS __NVIC_PRIO_BITS #else - #define configPRIO_BITS 4 /* 15 priority levels */ + #define configPRIO_BITS 4 /* 15 priority levels */ #endif /* The lowest interrupt priority that can be used in a call to a "set priority" function. */ -#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0xf +#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0xf /* The highest interrupt priority that can be used by any interrupt service routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER PRIORITY THAN THIS! (higher priorities are lower numeric values. */ -#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 +#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 /* Interrupt priorities used by the kernel port layer itself. These are generic to all Cortex-M ports, and do not rely on any particular library functions. */ -#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) +#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << ( 8 - configPRIO_BITS ) ) /* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ -#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) +#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << ( 8 - configPRIO_BITS ) ) +/* Set configUSE_MPU_WRAPPERS_V1 to 0 to use new MPU wrapper. + * See https://freertos.org/a00110.html#configUSE_MPU_WRAPPERS_V1 for details. */ +#define configUSE_MPU_WRAPPERS_V1 ( 0 ) +/* See https://freertos.org/a00110.html#configPROTECTED_KERNEL_OBJECT_POOL_SIZE for details. */ +#define configPROTECTED_KERNEL_OBJECT_POOL_SIZE ( 150 ) +/* See https://freertos.org/a00110.html#configSYSTEM_CALL_STACK_SIZE for details. */ +#define configSYSTEM_CALL_STACK_SIZE ( 128 ) /* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS standard names. */ -#define xPortPendSVHandler PendSV_Handler -#define vPortSVCHandler SVC_Handler -#define xPortSysTickHandler SysTick_Handler +#define xPortPendSVHandler PendSV_Handler +#define vPortSVCHandler SVC_Handler +#define xPortSysTickHandler SysTick_Handler /* Normal assert() semantics without relying on the provision of an assert.h header file. */ @@ -155,24 +162,25 @@ header file. */ /* LED not used at present, so just increment a variable to keep a count of the number of times the LED would otherwise have been toggled. */ -#define configTOGGLE_LED() ulLED++ +#define configTOGGLE_LED() ulLED++ /* Definitions for the messages that can be sent to the check task. */ -#define configREG_TEST_1_STILL_EXECUTING ( 0 ) -#define configREG_TEST_2_STILL_EXECUTING ( 1 ) -#define configTIMER_STILL_EXECUTING ( 2 ) -#define configPRINT_SYSTEM_STATUS ( 3 ) +#define configREG_TEST_1_STILL_EXECUTING ( 0 ) +#define configREG_TEST_2_STILL_EXECUTING ( 1 ) +#define configTIMER_STILL_EXECUTING ( 2 ) +#define configPRINT_SYSTEM_STATUS ( 3 ) /* Parameters that are passed into the third and fourth register check tasks solely for the purpose of ensuring parameters are passed into tasks correctly. */ -#define configREG_TEST_TASK_1_PARAMETER ( ( void * ) 0x11112222 ) -#define configREG_TEST_TASK_3_PARAMETER ( ( void * ) 0x12345678 ) -#define configREG_TEST_TASK_4_PARAMETER ( ( void * ) 0x87654321 ) +#define configREG_TEST_TASK_1_PARAMETER ( ( void * ) 0x11112222 ) +#define configREG_TEST_TASK_3_PARAMETER ( ( void * ) 0x12345678 ) +#define configREG_TEST_TASK_4_PARAMETER ( ( void * ) 0x87654321 ) -/* Ensure that all system calls are coming from the kernel -Additionally allow unprivileged tasks to have critical sections. */ +/* Ensure that all system calls are coming from the kernel. */ #define configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY 1 -#define configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS 1 + +/* Do not allow unprivileged tasks to have critical sections. */ +#define configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS 0 #ifdef __cplusplus } diff --git a/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/GCC_Specific/RTOSDemo.uvoptx b/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/GCC_Specific/RTOSDemo.uvoptx index cdc56121d..38192ad84 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/GCC_Specific/RTOSDemo.uvoptx +++ b/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/GCC_Specific/RTOSDemo.uvoptx @@ -10,7 +10,7 @@ *.obj; *.o *.lib - *.txt; *.h; *.inc + *.txt; *.h; *.inc; *.md *.plm *.cpp 0 @@ -101,12 +101,14 @@ 0 0 1 + 0 + 0 0 - + ..\simulator.ini @@ -211,6 +213,7 @@ 1 + 0 0 2 10000000 @@ -220,7 +223,7 @@ System - 1 + 0 0 0 0 @@ -240,7 +243,7 @@ application_and_config - 1 + 0 0 0 0 @@ -284,7 +287,7 @@ FreeRTOS_Source - 1 + 0 0 0 0 @@ -367,6 +370,18 @@ 0 0 0 + ..\..\..\Source\portable\Common\mpu_wrappers_v2.c + mpu_wrappers_v2.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 ..\..\..\Source\portable\GCC\ARM_CM4_MPU\port.c port.c 0 @@ -374,7 +389,19 @@ 3 - 12 + 13 + 1 + 0 + 0 + 0 + ..\..\..\Source\portable\GCC\ARM_CM4_MPU\mpu_wrappers_v2_asm.c + mpu_wrappers_v2_asm.c + 0 + 0 + + + 3 + 14 1 0 0 diff --git a/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/GCC_Specific/RTOSDemo.uvprojx b/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/GCC_Specific/RTOSDemo.uvprojx index b71d449c6..eec5b1ea0 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/GCC_Specific/RTOSDemo.uvprojx +++ b/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/GCC_Specific/RTOSDemo.uvprojx @@ -16,7 +16,7 @@ ARMCM4_FP ARM - ARM.CMSIS.5.0.1 + ARM.CMSIS.5.9.0 http://www.keil.com/pack/ IROM(0x00000000,0x80000) IRAM(0x20000000,0x20000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ESEL ELITTLE @@ -168,6 +168,9 @@ 0 0 2 + 0 + 0 + 0 0 0 @@ -335,11 +338,21 @@ 1 ..\..\..\Source\portable\Common\mpu_wrappers.c + + mpu_wrappers_v2.c + 1 + ..\..\..\Source\portable\Common\mpu_wrappers_v2.c + port.c 1 ..\..\..\Source\portable\GCC\ARM_CM4_MPU\port.c + + mpu_wrappers_v2_asm.c + 1 + ..\..\..\Source\portable\GCC\ARM_CM4_MPU\mpu_wrappers_v2_asm.c + stream_buffer.c 1 @@ -357,4 +370,13 @@ + + + + RTOSDemo + 1 + + + + diff --git a/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/GCC_Specific/RegTest.c b/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/GCC_Specific/RegTest.c index c054195be..57412954d 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/GCC_Specific/RegTest.c +++ b/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/GCC_Specific/RegTest.c @@ -626,6 +626,7 @@ void HardFault_Handler( void ) " ldr r1, [r0, #24] \n" " ldr r2, handler_address_const \n" " bx r2 \n" + " .align 4 \n" " handler_address_const: .word hard_fault_handler \n" ); } @@ -643,6 +644,7 @@ void MemManage_Handler( void ) " ldr r1, [r0, #24] \n" " ldr r2, handler2_address_const \n" " bx r2 \n" + " .align 4 \n" " handler2_address_const: .word hard_fault_handler \n" ); }/*-----------------------------------------------------------*/ diff --git a/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/GCC_Specific/sections.ld b/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/GCC_Specific/sections.ld index e6c41f9c4..939646a69 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/GCC_Specific/sections.ld +++ b/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/GCC_Specific/sections.ld @@ -6,8 +6,8 @@ MEMORY } /* Variables used by FreeRTOS-MPU. */ -_Privileged_Functions_Region_Size = 32K; -_Privileged_Data_Region_Size = 4096; +_Privileged_Functions_Region_Size = 64K; +_Privileged_Data_Region_Size = 16K; __FLASH_segment_start__ = ORIGIN( ROM ); __FLASH_segment_end__ = __FLASH_segment_start__ + LENGTH( ROM ); diff --git a/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.sct b/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.sct index 6e20179f6..7701da1e9 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.sct +++ b/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.sct @@ -4,18 +4,21 @@ LR_IROM1 0x00000000 { ; load region size_region - ER_IROM1 0x00000000 { ; load address = execution address + ER_IROM_PRIVILEGED 0x00000000 { ; load address = execution address *.o (RESET, +First) *(InRoot$$Sections) *( privileged_functions ) } - ER_IROM2 0x8000 FIXED { + ER_IROM_FREERTOS_SYSTEM_CALLS 0x00010000 FIXED { + *(freertos_system_calls) + } + ER_IROM_UNPRIVILEGED +0 { .ANY (+RO) } - RW_IRAM1 0x20000000 { ; RW data + RW_IRAM_PRIVILEGED 0x20000000 { ; RW data *( privileged_data ) } - RW_IRAM2 0x20001000 { ; RW data + RW_IRAM_UNPRIVILEGED 0x20004000 { ; RW data .ANY (+RW +ZI) } } diff --git a/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.uvoptx b/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.uvoptx index 7d44b9229..8deb72c76 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.uvoptx +++ b/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.uvoptx @@ -10,7 +10,7 @@ *.s*; *.src; *.a* *.obj; *.o *.lib - *.txt; *.h; *.inc + *.txt; *.h; *.inc; *.md *.plm *.cpp 0 @@ -101,12 +101,14 @@ 0 0 1 + 0 + 0 0 - + ..\simulator.ini @@ -209,7 +211,7 @@ System - 1 + 0 0 0 0 @@ -229,7 +231,7 @@ main_and_config - 1 + 0 0 0 0 @@ -273,7 +275,7 @@ FreeRTOS_Source - 1 + 0 0 0 0 @@ -356,6 +358,18 @@ 0 0 0 + ..\..\..\Source\portable\RVDS\ARM_CM4_MPU\mpu_wrappers_v2_asm.c + mpu_wrappers_v2_asm.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 ..\..\..\Source\portable\Common\mpu_wrappers.c mpu_wrappers.c 0 @@ -363,7 +377,19 @@ 3 - 12 + 13 + 1 + 0 + 0 + 0 + ..\..\..\Source\portable\Common\mpu_wrappers_v2.c + mpu_wrappers_v2.c + 0 + 0 + + + 3 + 14 1 0 0 diff --git a/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.uvprojx b/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.uvprojx index 94af17801..7181cca8a 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.uvprojx +++ b/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.uvprojx @@ -10,13 +10,13 @@ RTOSDemo 0x4 ARM-ADS - 5060528::V5.06 update 5 (build 528)::ARMCC + 5060960::V5.06 update 7 (build 960)::..\..\Program Files (x86)\ARM_Compiler_5.06u7 0 ARMCM4_FP ARM - ARM.CMSIS.5.0.1 + ARM.CMSIS.5.9.0 http://www.keil.com/pack/ IROM(0x00000000,0x80000) IRAM(0x20000000,0x20000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ESEL ELITTLE @@ -184,6 +184,9 @@ 0 0 2 + 0 + 0 + 0 0 0 8 @@ -324,6 +327,7 @@ 0 0 0 + 0 0 0 0 @@ -349,7 +353,7 @@ 0 0 0 - 0 + 4 @@ -440,11 +444,21 @@ 1 ..\..\..\Source\portable\RVDS\ARM_CM4_MPU\port.c + + mpu_wrappers_v2_asm.c + 1 + ..\..\..\Source\portable\RVDS\ARM_CM4_MPU\mpu_wrappers_v2_asm.c + mpu_wrappers.c 1 ..\..\..\Source\portable\Common\mpu_wrappers.c + + mpu_wrappers_v2.c + 1 + ..\..\..\Source\portable\Common\mpu_wrappers_v2.c + stream_buffer.c 1 diff --git a/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/main.c b/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/main.c index 08b3bd714..dcc952cd4 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/main.c +++ b/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/main.c @@ -136,16 +136,16 @@ extern void vRegTest4Implementation( void ); static void prvCheckTask( void *pvParameters ); /* - * Prototype for a task created in User mode using vTaskCreateStatic() API - * function. The task demonstrates the characteristics of such a task, - * before simply deleting itself. As the task is created without using any - * dynamic memory allocate the stack and variable in which the task's data - * structure will be stored must also be provided - however the task is - * unprivileged so the stack cannot be in a privileged section. + * Prototype for a task created in User mode using the original vTaskCreate() + * API function. The task demonstrates the characteristics of such a task, + * before simply deleting itself. + * + * It is not possible to use xTaskCreate() to create an unprivileged task since + * heap moved to the privileged data section, so the access tests implemented by + * this function are now called from an unprivileged register check task created + * using the xTaskCreateRestricted() API. */ -static StackType_t xUserModeTaskStack[ configMINIMAL_STACK_SIZE ]; -static PRIVILEGED_DATA StaticTask_t xUserModeTaskBuffer; -static void prvOldStyleUserModeTask( void *pvParameters ); +static void prvOldStyleUserModeTask( void ); /* * Prototype for a task created in Privileged mode using the @@ -248,14 +248,19 @@ static PRIVILEGED_DATA StaticTimer_t xTimerBuffer; extern uint32_t __privileged_functions_actual_end__[]; extern uint32_t __privileged_data_actual_end__[]; #else - const uint32_t * __FLASH_segment_start__ = ( uint32_t * ) 0x00UL; + extern uint32_t Image$$ER_IROM_FREERTOS_SYSTEM_CALLS$$Base; + extern uint32_t Image$$ER_IROM_FREERTOS_SYSTEM_CALLS$$Limit; + + const uint32_t * __FLASH_segment_start__ = ( uint32_t * ) 0x00000000UL; const uint32_t * __FLASH_segment_end__ = ( uint32_t * ) 0x00080000UL; const uint32_t * __SRAM_segment_start__ = ( uint32_t * ) 0x20000000UL; const uint32_t * __SRAM_segment_end__ = ( uint32_t * ) 0x20008000UL; - const uint32_t * __privileged_functions_start__ = ( uint32_t * ) 0x00UL; - const uint32_t * __privileged_functions_end__ = ( uint32_t * ) 0x8000UL; + const uint32_t * __privileged_functions_start__ = ( uint32_t * ) 0x00000000UL; + const uint32_t * __privileged_functions_end__ = ( uint32_t * ) 0x00010000UL; + const uint32_t * __syscalls_flash_start__ = ( uint32_t * ) &( Image$$ER_IROM_FREERTOS_SYSTEM_CALLS$$Base ); + const uint32_t * __syscalls_flash_end__ = ( uint32_t * ) &( Image$$ER_IROM_FREERTOS_SYSTEM_CALLS$$Limit ); const uint32_t * __privileged_data_start__ = ( uint32_t * ) 0x20000000UL; - const uint32_t * __privileged_data_end__ = ( uint32_t * ) 0x20000800UL; + const uint32_t * __privileged_data_end__ = ( uint32_t * ) 0x20004000UL; #endif /*-----------------------------------------------------------*/ /* Data used by the 'check' task. ---------------------------*/ @@ -419,7 +424,7 @@ static TaskParameters_t xTaskToDeleteParameters = mainTASK_TO_DELETE_NAME, /* pcName */ mainDELETE_TASK_STACK_SIZE_WORDS, /* usStackDepth */ ( void * ) NULL, /* pvParameters - this task uses the parameter to pass in a queue handle, but the queue is not created yet. */ - tskIDLE_PRIORITY + 1, /* uxPriority */ + ( tskIDLE_PRIORITY + 1 ) | portPRIVILEGE_BIT, /* uxPriority - this task is privileged because it creates and deletes kernel objects. */ xDeleteTaskStack, /* puxStackBuffer - the array to use as the task stack, as declared above. */ { /* xRegions - this task does not use any non-stack data hence all members are zero. */ /* Base address Length Parameters */ @@ -464,15 +469,6 @@ int main( void ) /* Create the tasks that are created using the original xTaskCreate() API function. */ - xTaskCreateStatic( prvOldStyleUserModeTask, /* The function that implements the task. */ - "Task1", /* Text name for the task. */ - 100, /* Stack depth in words. */ - NULL, /* Task parameters. */ - 3, /* Priority and mode (user in this case). */ - xUserModeTaskStack, /* Used as the task's stack. */ - &xUserModeTaskBuffer /* Used to hold the task's data structure. */ - ); - xTaskCreateStatic( prvOldStylePrivilegedModeTask, /* The function that implements the task. */ "Task2", /* Text name for the task. */ 100, /* Stack depth in words. */ @@ -862,7 +858,7 @@ volatile uint32_t ulReadData; } /*-----------------------------------------------------------*/ -static void prvOldStyleUserModeTask( void *pvParameters ) +static void prvOldStyleUserModeTask( void ) { /*const volatile uint32_t *pulStandardPeripheralRegister = ( volatile uint32_t * ) 0x40000000;*/ volatile const uint32_t *pul; @@ -873,8 +869,6 @@ compiler warnings when the tests that use the variable are also commented out. * /* extern uint32_t __privileged_functions_start__[]; */ /* const volatile uint32_t *pulSystemPeripheralRegister = ( volatile uint32_t * ) 0xe000e014; */ - ( void ) pvParameters; - /* This task is created in User mode using the original xTaskCreate() API function. It should have access to all Flash and RAM except that marked as Privileged access only. Reading from the start and end of the non- @@ -918,11 +912,6 @@ compiler warnings when the tests that use the variable are also commented out. * /*pul = __privileged_data_end__ - 1; ulReadData = *pul;*/ - /* Must not just run off the end of a task function, so delete this task. - Note that because this task was created using xTaskCreate() the stack was - allocated dynamically and I have not included any code to free it again. */ - vTaskDelete( NULL ); - ( void ) ulReadData; } /*-----------------------------------------------------------*/ @@ -1121,6 +1110,12 @@ static void prvRegTest3Task( void *pvParameters ) in correctly. */ if( pvParameters == configREG_TEST_TASK_3_PARAMETER ) { + /* Run the unprivileged mode access tests that used to be executed + form an unprivileged task created using the xTaskCreate() API. + Since the heap moved to the privileged data section xTaskCreate() can + no longer be used to create unprivileged tasks. */ + prvOldStyleUserModeTask(); + /* Start the part of the test that is written in assembler. */ vRegTest3Implementation(); } diff --git a/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/simulator.ini b/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/simulator.ini new file mode 100644 index 000000000..5f6d3238a --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/simulator.ini @@ -0,0 +1,5 @@ +MAP 0x00000000, 0x00FFFFFF CLEAR +MAP 0x20000000, 0x20FFFFFF CLEAR +MAP 0x00000000, 0x0007FFFF READ EXEC +MAP 0x20000000, 0x20007FFF READ WRITE EXEC +