Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update kernel #104

Merged
merged 5 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
25 changes: 23 additions & 2 deletions ARM.CMSIS-FreeRTOS.pdsc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
<name>CMSIS-FreeRTOS</name>
<description>Bundle of FreeRTOS for Cortex-M and Cortex-A</description>
<license>LICENSE</license>
<licenseSets>
<licenseSet id="all" default="true" gating="true">
<license title="Apache 2.0 for CMSIS extensions" name="./LICENSE" spdx="Apache-2.0"/>
<license title="MIT License for FreeRTOS kernel" name="./Source/LICENSE.md" spdx="MIT"/>
</licenseSet>
</licenseSets>
<url>https://www.keil.com/pack/</url>

<releases>
Expand Down Expand Up @@ -503,6 +509,11 @@
<accept condition="CM0_GCC"/>
<accept condition="CM0_IAR"/>
</condition>
<condition id="FreeRTOS Port Cortex-M0 MPU">
<description>Requirements for FreeRTOS port for Cortex-M0+ using MPU</description>
<accept condition="CM0_ARMCC6"/>
<accept condition="CM0_GCC"/>
</condition>
<condition id="FreeRTOS Port Cortex-M3">
<description>Requirements for FreeRTOS port for Cortex-M3</description>
<accept condition="CM3_ARMCC6"/>
Expand Down Expand Up @@ -640,6 +651,7 @@
</condition>
<condition id="FreeRTOS Port Cortex-M v6_v7 MPU">
<description>Requirements for FreeRTOS port for Cortex-M v6 and v7 using MPU</description>
<accept condition="FreeRTOS Port Cortex-M0 MPU"/>
<accept condition="FreeRTOS Port Cortex-M3 MPU"/>
<accept condition="FreeRTOS Port Cortex-M4 MPU"/>
<accept condition="FreeRTOS Port Cortex-M4 FPU MPU"/>
Expand Down Expand Up @@ -891,8 +903,8 @@
<file category="source" name="Source/queue.c"/>
<file category="source" name="Source/tasks.c"/>

<file category="include" condition="CM0_ARMCC6" name="Source/portable/GCC/ARM_CM0/"/>
<file category="source" condition="CM0_ARMCC6" name="Source/portable/GCC/ARM_CM0/port.c"/>
<file category="include" condition="CM0_ARMCC6" name="Source/portable/GCC/ARM_CM0_AC6/"/>
<file category="source" condition="CM0_ARMCC6" name="Source/portable/GCC/ARM_CM0_AC6/port.c"/>
<file category="include" condition="CM3_ARMCC6" name="Source/portable/GCC/ARM_CM3/"/>
<file category="source" condition="CM3_ARMCC6" name="Source/portable/GCC/ARM_CM3/port.c"/>
<file category="include" condition="CM4_ARMCC6" name="Source/portable/GCC/ARM_CM3/"/>
Expand Down Expand Up @@ -923,6 +935,7 @@

<file category="include" condition="CM0_GCC" name="Source/portable/GCC/ARM_CM0/"/>
<file category="source" condition="CM0_GCC" name="Source/portable/GCC/ARM_CM0/port.c"/>
<file category="source" condition="CM0_GCC" name="Source/portable/GCC/ARM_CM0/portasm.c"/>
<file category="include" condition="CM3_GCC" name="Source/portable/GCC/ARM_CM3/"/>
<file category="source" condition="CM3_GCC" name="Source/portable/GCC/ARM_CM3/port.c"/>
<file category="include" condition="CM4_GCC" name="Source/portable/GCC/ARM_CM3/"/>
Expand Down Expand Up @@ -1014,6 +1027,10 @@
<file category="source" name="Source/portable/Common/mpu_wrappers.c"/>
<file category="source" name="Source/portable/Common/mpu_wrappers_v2.c"/>

<file category="include" condition="CM0_ARMCC6" name="Source/portable/GCC/ARM_CM0/"/>
<file category="source" condition="CM0_ARMCC6" name="Source/portable/GCC/ARM_CM0/port.c"/>
<file category="source" condition="CM0_ARMCC6" name="Source/portable/GCC/ARM_CM0/portasm.c"/>
<file category="source" condition="CM0_ARMCC6" name="Source/portable/GCC/ARM_CM0/mpu_wrappers_v2_asm.c"/>
<file category="include" condition="CM3_ARMCC6" name="Source/portable/GCC/ARM_CM3_MPU/"/>
<file category="source" condition="CM3_ARMCC6" name="Source/portable/GCC/ARM_CM3_MPU/port.c"/>
<file category="source" condition="CM3_ARMCC6" name="Source/portable/GCC/ARM_CM3_MPU/mpu_wrappers_v2_asm.c"/>
Expand All @@ -1024,6 +1041,10 @@
<file category="source" condition="CM4_FP_ARMCC6" name="Source/portable/GCC/ARM_CM4_MPU/port.c"/>
<file category="source" condition="CM4_FP_ARMCC6" name="Source/portable/GCC/ARM_CM4_MPU/mpu_wrappers_v2_asm.c"/>

<file category="include" condition="CM0_GCC" name="Source/portable/GCC/ARM_CM0/"/>
<file category="source" condition="CM0_GCC" name="Source/portable/GCC/ARM_CM0/port.c"/>
<file category="source" condition="CM0_GCC" name="Source/portable/GCC/ARM_CM0/portasm.c"/>
<file category="source" condition="CM0_GCC" name="Source/portable/GCC/ARM_CM0/mpu_wrappers_v2_asm.c"/>
<file category="include" condition="CM3_GCC" name="Source/portable/GCC/ARM_CM3_MPU/"/>
<file category="source" condition="CM3_GCC" name="Source/portable/GCC/ARM_CM3_MPU/port.c"/>
<file category="source" condition="CM3_GCC" name="Source/portable/GCC/ARM_CM3_MPU/mpu_wrappers_v2_asm.c"/>
Expand Down
13 changes: 9 additions & 4 deletions Source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ if(NOT FREERTOS_PORT)
" GCC_ARM_CM85_NTZ_NONSECURE - Compiler: GCC Target: ARM Cortex-M85 non-trustzone non-secure\n"
" GCC_ARM_CM85_TFM - Compiler: GCC Target: ARM Cortex-M85 non-secure for TF-M\n"
" GCC_ARM_CR5 - Compiler: GCC Target: ARM Cortex-R5\n"
" GCC_ARM_CRX_MPU - Compiler: GCC Target: ARM Cortex-Rx with MPU\n"
" GCC_ARM_CRX_NOGIC - Compiler: GCC Target: ARM Cortex-Rx no GIC\n"
" GCC_ARM7_AT91FR40008 - Compiler: GCC Target: ARM7 Atmel AT91R40008\n"
" GCC_ARM7_AT91SAM7S - Compiler: GCC Target: ARM7 Atmel AT91SAM7S\n"
Expand Down Expand Up @@ -217,16 +218,17 @@ elseif((FREERTOS_PORT STREQUAL "A_CUSTOM_PORT") AND (NOT TARGET freertos_kernel_
" port.c\n"
" portmacro.h\n"
" Where FreeRTOSCustomPort/CMakeLists.txt is a modified version of:\n"
" add_library(freertos_kernel_port STATIC)\n"
" add_library(freertos_kernel_port OBJECT)\n"
" target_sources(freertos_kernel_port\n"
" PRIVATE\n"
" port.c\n"
" portmacro.h)\n"
" target_include_directories(freertos_kernel_port\n"
" PUBLIC\n"
" add_library(freertos_kernel_port_headers INTERFACE)\n"
" target_include_directories(freertos_kernel_port_headers INTERFACE \n"
" .)\n"
" target_link_libraries(freertos_kernel_port\n"
" PRIVATE\n"
" freertos_kernel_port_headers\n"
" freertos_kernel_include)")
endif()

Expand Down Expand Up @@ -257,8 +259,11 @@ endif()

target_link_libraries(freertos_kernel
PUBLIC
freertos_kernel_port
freertos_kernel_include
freertos_kernel_port_headers
PRIVATE
freertos_kernel_port

)

########################################################################
77 changes: 77 additions & 0 deletions Source/History.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,82 @@
Documentation and download available at https://www.FreeRTOS.org/

Changes between FreeRTOS V11.0.1 and FreeRTOS V11.1.0 released April 22, 2024

+ Add ARMv7-R port with Memory Protection Unit (MPU) support.
+ Add Memory Protection Unit (MPU) support to the Cortex-M0 port.
+ Add stream batching buffer. A stream batching buffer differs from a stream
buffer when a task reads from a non-empty buffer:
- The task reading from a non-empty stream buffer returns immediately
regardless of the amount of data in the buffer.
- The task reading from a non-empty steam batching buffer blocks until the
amount of data in the buffer exceeds the trigger level or the block time
expires.
We thank @cperkulator for their contribution.
+ Add the ability to change task notification index for stream buffers. We
thank @glemco for their contribution.
+ Add xStreamBufferResetFromISR and xMessageBufferResetFromISR APIs to reset
stream buffer and message buffer from an Interrupt Service Routine (ISR).
We thank @HagaiMoshe for their contribution.
+ Update all the FreeRTOS APIs to use configSTACK_DEPTH_TYPE for stack type.
We thank @feilipu for their contribution.
+ Update vTaskEndScheduler to delete the timer and idle tasks,
once the scheduler is stopped.
+ Make xTaskGetCurrentTaskHandleForCore() available to the single core
scheduler. We thank @Dazza0 for their contribution.
+ Update uxTaskGetSystemState to not use the pxIndex member of the List_t
structure while iterating ready tasks list. The reason is that pxIndex
member must only used to select next ready task to run. We thank
@gemarcano for their inputs.
+ Add a config option to the FreeRTOS SMP Kernel to set the default core
affinity mask for tasks created without an affinity mask. We thank @go2sh
for their contribution.
+ Add configUSE_EVENT_GROUPS and configUSE_STREAM_BUFFERS configuration
constants to control the inclusion of event group and stream buffer
functionalities.
+ Code changes to comply with MISRA C 2012.
+ Add 64-bit support to the FreeRTOS Windows Simulator port. We thank @watsk
and @josesimoes for their contributions.
+ Add support for 64-bit Microblaze processor to the MicroblazeV9 port. We
thank @mubinsyed for their contribution.
+ Add support for MSP430 Embedded Application Binary Interface (EABI) to
the MSP430F449 port to make it work with both MSP430 GCC and MSPGCC
compilers. We thank @Forty-Bot for their contribution.
+ Update xPortIsAuthorizedToAccessBuffer() on FreeRTOS ports with MPU
support to grant an unprivileged task access to all the memory before the
scheduler is started.
+ Update the POSIX port to pass the FreeRTOS task name to pthread for
readable output in debuggers. We thank @Mixaill for their contribution.
+ Update the POSIX port to ignore the user specified stack memory and only
pass the stack size to the pthread API to avoid errors caused when stack size
is smaller than the minimum. We thank @cmorgnaBE for their
contribution.
+ Update the POSIX port to use a timer thread for tick interrupts instead of
POSIX timers to address issues with signal handling in non-FreeRTOS
pthreads. We thank @cmorgnaBE for their contribution.
+ Update ARM_TFM port to support TF-Mv2.0.0 release of trusted-firmware-m.
We thanks @urutva for their contribution.
+ Remove redundant constant pools in ARMv8 ports. We thank @urutva for their
contribution.
+ Add APIs to reset the internal state of kernel modules. These APIs are
primarily intended to be used in the testing frameworks that restart the
scheduler.
+ Use kernel provided implementations of vApplicationGetIdleTaskMemory() and
vApplicationGetTimerTaskMemory() in the RP2040 port. We thank @dpslwk for
their contribution.
+ Fix atomic enter/exit critical section macro definitions in atomic.h for
ports that support nested interrupts. We thank @sebunger for their
contribution.
+ Fix compiler warnings in the MSP430F449 port when compiled with the
MSP430 GCC compiler. We thank @Forty-Bot for their contribution.
+ Update the scheduler suspension usage in ulTaskGenericNotifyTake and
xTaskGenericNotifyWait() to enhance code readability. We thank @Dazza0 for
their contribution.
+ Add support for latest version of MPU wrappers( mpu_wrappers_v2) in CMake.
We thank @IsaacDynamo for their contribution.
+ Update CMake support to create only one static library containing both the
kernel common code and the kernel port code. We thank @barnatahmed for
their contribution.

Changes between FreeRTOS V11.0.0 and FreeRTOS V11.0.1 released December 21, 2023

+ Updated the SBOM file.
Expand Down
18 changes: 13 additions & 5 deletions Source/MISRA.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

FreeRTOS-Kernel conforms to [MISRA C:2012](https://www.misra.org.uk/misra-c)
guidelines, with the deviations listed below. Compliance is checked with
Coverity static analysis. Since the FreeRTOS kernel is designed for
small-embedded devices, it needs to have a very small memory footprint and
has to be efficient. To achieve that and to increase the performance, it
deviates from some MISRA rules. The specific deviations, suppressed inline,
are listed below.
Coverity static analysis version 2023.6.1. Since the FreeRTOS kernel is
designed for small-embedded devices, it needs to have a very small memory
footprint and has to be efficient. To achieve that and to increase the
performance, it deviates from some MISRA rules. The specific deviations,
suppressed inline, are listed below.

Additionally, [MISRA configuration file](examples/coverity/coverity_misra.config)
contains project wide deviations.
Expand All @@ -18,6 +18,14 @@ with ( Assuming rule 8.4 violation; with justification in point 1 ):
grep 'MISRA Ref 8.4.1' . -rI
```

#### Dir 4.7
MISRA C:2012 Dir 4.7: If a function returns error information, then that error
information shall be tested.

_Ref 4.7.1_
- `taskENTER_CRITICAL_FROM_ISR` returns the interrupt mask and not any error
information. Therefore, there is no need test the return value.

#### Rule 8.4

MISRA C:2012 Rule 8.4: A compatible declaration shall be visible when an
Expand Down
33 changes: 28 additions & 5 deletions Source/croutine.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* FreeRTOS Kernel V11.0.1
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* FreeRTOS Kernel V11.1.0
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
Expand Down Expand Up @@ -30,7 +30,7 @@
#include "task.h"
#include "croutine.h"

/* Remove the whole file is co-routines are not being used. */
/* Remove the whole file if co-routines are not being used. */
#if ( configUSE_CO_ROUTINES != 0 )

/*
Expand All @@ -52,8 +52,10 @@

/* Other file private variables. --------------------------------*/
CRCB_t * pxCurrentCoRoutine = NULL;
static UBaseType_t uxTopCoRoutineReadyPriority = 0;
static TickType_t xCoRoutineTickCount = 0, xLastTickCount = 0, xPassedTicks = 0;
static UBaseType_t uxTopCoRoutineReadyPriority = ( UBaseType_t ) 0U;
static TickType_t xCoRoutineTickCount = ( TickType_t ) 0U;
static TickType_t xLastTickCount = ( TickType_t ) 0U;
static TickType_t xPassedTicks = ( TickType_t ) 0U;

/* The initial state of the co-routine when it is created. */
#define corINITIAL_STATE ( 0 )
Expand Down Expand Up @@ -378,5 +380,26 @@

return xReturn;
}
/*-----------------------------------------------------------*/

/*
* Reset state in this file. This state is normally initialized at start up.
* This function must be called by the application before restarting the
* scheduler.
*/
void vCoRoutineResetState( void )
{
/* Lists for ready and blocked co-routines. */
pxDelayedCoRoutineList = NULL;
pxOverflowDelayedCoRoutineList = NULL;

/* Other file private variables. */
pxCurrentCoRoutine = NULL;
uxTopCoRoutineReadyPriority = ( UBaseType_t ) 0U;
xCoRoutineTickCount = ( TickType_t ) 0U;
xLastTickCount = ( TickType_t ) 0U;
xPassedTicks = ( TickType_t ) 0U;
}
/*-----------------------------------------------------------*/

#endif /* configUSE_CO_ROUTINES == 0 */
Loading
Loading