From 93a35f87d2afa8e531b0d75e35431755cb3eb438 Mon Sep 17 00:00:00 2001 From: Soren Ptak Date: Sun, 5 Mar 2023 20:43:35 -0800 Subject: [PATCH] Added two config options to the FreeRTOSConfig file to get the demo running again. Fixed a typo in a file. Added a section to the link file (#940) Co-authored-by: Soren Ptak --- .../CORTEX_MPU_Static_Simulator_Keil_GCC/FreeRTOSConfig.h | 7 ++++++- .../GCC_Specific/sections.ld | 7 +++++++ .../GCC_Specific/startup_ARMCM4.S | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) 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 ec5860f131..46d287735e 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/FreeRTOSConfig.h @@ -148,7 +148,7 @@ standard names. */ /* Normal assert() semantics without relying on the provision of an assert.h header file. */ -#define configASSERT( x ) if( ( x ) == 0UL ) { portDISABLE_INTERRUPTS(); for( ;; ); } +#define configASSERT( x ) if( ! ( x ) ) { portDISABLE_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. */ @@ -166,6 +166,11 @@ solely for the purpose of ensuring parameters are passed into tasks correctly. * #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. */ +#define configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY 1 +#define configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS 1 + #ifdef __cplusplus } #endif 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 723631644e..e6c41f9c4b 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 @@ -156,6 +156,13 @@ SECTIONS PROVIDE_HIDDEN (__fini_array_end = .); . = ALIGN(4); + /* Set start of system calls to here */ + __syscalls_flash_start__ = .; + /* Place all FreeRTOS System calls here */ + *(freertos_system_calls) + __syscalls_flash_end__ = .; + /* Mark the end of the system calls */ + . = ALIGN(4); *(.text*) /* all remaining code */ diff --git a/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/GCC_Specific/startup_ARMCM4.S b/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/GCC_Specific/startup_ARMCM4.S index fb2af495a9..7c853953be 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/GCC_Specific/startup_ARMCM4.S +++ b/FreeRTOS/Demo/CORTEX_MPU_Static_Simulator_Keil_GCC/GCC_Specific/startup_ARMCM4.S @@ -4,7 +4,7 @@ * Version: V2.0 * Date: 16 August 2013 * -/* Copyright (c) 2011 - 2013 ARM LIMITED + * Copyright (c) 2011 - 2013 ARM LIMITED All rights reserved. Redistribution and use in source and binary forms, with or without