]> begriffs open source - freertos/log
freertos
15 months agoRemove error for 16 MPU resgion from IAR ports (#1149)
Gaurav-Aggarwal-AWS [Mon, 23 Sep 2024 05:09:29 +0000 (10:39 +0530)]
Remove error for 16 MPU resgion from IAR ports (#1149)

Support for 16 MPU regions was added to Cortex-M33, M35P, M55 and M85
ports was added but the compile time error check was not removed. This
results in compilation error when 16 MPU regions are used. This PR
removes the not needed compile time error check.

It was reported here - https://forums.freertos.org/t/cortex-m55-and-16-region-mpu-support/21470.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
15 months agomodernize ARM assembler syntax (#1148)
Florian La Roche [Fri, 20 Sep 2024 17:19:09 +0000 (19:19 +0200)]
modernize ARM assembler syntax (#1148)

modernize ARM assembler syntax

Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
15 months agoRefine heap_5 heap protector (#1146)
Saiiijchan [Thu, 19 Sep 2024 05:06:52 +0000 (13:06 +0800)]
Refine heap_5 heap protector (#1146)

Add configVALIDATE_HEAP_BLOCK_POINTER on heap_5

heap_5 is used for multiple separated memory spaces. In the
previous implementation, it only verifies the highest and
lowest addresses. A pointer may not be within heap regions,
but is still located between the highest and lowest addressed.

Add maco configVALIDATE_HEAP_BLOCK_POINTER to provide
customized heap block pointers detection based on the settings
of heap regions.

Signed-off-by: wangfei_chen <wangfei_chen@realsil.com.cn>
15 months agoEvent Groups: snapshot xEventGroupSetBits returning value while in vTaskSuspendAll...
あく [Wed, 11 Sep 2024 17:37:08 +0000 (18:37 +0100)]
Event Groups: snapshot xEventGroupSetBits returning value while in vTaskSuspendAll (#1143)

Event Groups: snapshot xEventGroupSetBits returning value while in
vTaskSuspendAll. Fixes uxEventBits dereference after event group
deleted by higher priority thread.

15 months agoTask: fix compiler warning for architectures that does not define portARMV8M_MINOR_VE...
あく [Wed, 11 Sep 2024 13:56:16 +0000 (14:56 +0100)]
Task: fix compiler warning for architectures that does not define portARMV8M_MINOR_VERSION (#1144)

15 months agoUpdate upload-artifact GH action's version (#1145)
Gaurav-Aggarwal-AWS [Wed, 11 Sep 2024 06:06:58 +0000 (11:36 +0530)]
Update upload-artifact GH action's version (#1145)

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
15 months agoAdd configuration include to secure_heap.c (#1141)
Oliver Mueller [Tue, 10 Sep 2024 05:46:40 +0000 (07:46 +0200)]
Add configuration include to secure_heap.c (#1141)

Add configuration include to secure_heap.c

Enables actually changing the size of the secure heal

15 months agoFix IA32 compilation with common IRQ entry disabled (#1137)
Ryzee119 [Mon, 9 Sep 2024 07:24:38 +0000 (16:54 +0930)]
Fix IA32 compilation with common IRQ entry disabled (#1137)

15 months agoUpdate config macro for xTaskGetCurrentTaskHandle (#1136)
Rahul Kar [Wed, 4 Sep 2024 09:31:42 +0000 (09:31 +0000)]
Update config macro for xTaskGetCurrentTaskHandle (#1136)

15 months agoUpdate comment in the example for declaration of xTimerReset (#1133)
Rahul Kar [Mon, 2 Sep 2024 15:46:23 +0000 (15:46 +0000)]
Update comment in the example for declaration of xTimerReset (#1133)

* Update comment in the example for declaration of xTimerReset

* Fix formatting

16 months agoPend a yield in portPRE_TASK_DELETE_HOOK (#1132)
Gaurav-Aggarwal-AWS [Thu, 29 Aug 2024 15:51:35 +0000 (21:21 +0530)]
Pend a yield in portPRE_TASK_DELETE_HOOK (#1132)

When a task deletes itself, it calls portPRE_TASK_DELETE_HOOK which
translates to vPortCloseRunningThread on the Windows port.
vPortCloseRunningThread never returns and as a result,
taskYIELD_WITHIN_API in vTaskDelete does not get called. As a result,
the next task is not scheduled when configUSE_PREEMPTION is set to 0.

This change records that a yield is pending so that the next tick
interrupt switches out the task that was deleted.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
16 months agoGCC: ARM_CM0: Fix L6286E error on Keil MDK (#1131)
Tomas Galbicka [Thu, 29 Aug 2024 08:36:33 +0000 (10:36 +0200)]
GCC: ARM_CM0: Fix L6286E error on Keil MDK (#1131)

Change the .b instruction to .bx with higher range to solve error
reported by MDK descibed bellow.

Fix:
Error: L6286E: Relocation #REL:0 in portasm.o(.text.SVC_Handler) with respect to vPortSVCHandler_C. Value(0x1a04) out of range(-0x800 - 0x7fe) for (R_ARM_THM_JUMP11)

Compiler: Keil MDK ARMClang 6.22.0

https://developer.arm.com/documentation/ka002847/latest/
https://developer.arm.com/documentation/dui0496/m/Linker-Errors-and-Warnings/List-of-the-armlink-error-and-warning-messages

Signed-off-by: Tomas Galbicka <tomas.galbicka@nxp.com>
16 months agoUpdate CMakeLists.txt to proper name for the ports (#1129)
Rahul Kar [Thu, 22 Aug 2024 04:33:58 +0000 (04:33 +0000)]
Update CMakeLists.txt to proper name for the ports (#1129)

16 months agoRemove access check from ISR function (#1127)
Rahul Kar [Wed, 21 Aug 2024 09:54:46 +0000 (09:54 +0000)]
Remove access check from ISR function (#1127)

16 months agoAdd heap protector to allocted heap blocks (#1125)
Saiiijchan [Tue, 20 Aug 2024 13:04:43 +0000 (21:04 +0800)]
Add heap protector to allocted heap blocks (#1125)

When validate those allocated heap block structure, the canary is not used.
Do xor with canary when allocating a new block.

Signed-off-by: wangfei_chen <wangfei_chen@realsil.com.cn>
Co-authored-by: wangfei_chen <wangfei_chen@realsil.com.cn>
16 months agoYield for task when core affinity of a ready task is changed (#1123)
chinglee-iot [Tue, 20 Aug 2024 04:34:01 +0000 (12:34 +0800)]
Yield for task when core affinity of a ready task is changed (#1123)

* The SMP scheduler should re-select a core to yield when the core
  affinity of a ready task is changed.

16 months agoRemove hardware dependence in portmacros.h (#1112)
mayl [Mon, 19 Aug 2024 06:01:30 +0000 (02:01 -0400)]
Remove hardware dependence in portmacros.h (#1112)

* Remove hardware dependence in portmacros.h

The IAR MSP430X port `#include "msp430.h"` which pulls all the hardware
register definitions into anything which `#include "FreeRTOS.h"`.  This
removes that hardware dependency "leak" by removing the header file
and re-defining the `portDISABLE_INTERRUPTS()` and
`portENABLE_INTERRUPTS()` macros in terms of `__asm`.

* Code review suggestions

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
---------

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>
16 months agoFix compilation issue of IA32_flat port (#1122)
Rahul Kar [Mon, 19 Aug 2024 05:37:24 +0000 (05:37 +0000)]
Fix compilation issue of IA32_flat port (#1122)

* Fix compilation issue of IAR32 port

* Add new line at EOF

* Fix header check

---------

Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
16 months agoOptimize xTaskIncrementTick for configNUMBER_OF_CORES > 1 (#1118)
Chen YM [Mon, 19 Aug 2024 05:04:33 +0000 (13:04 +0800)]
Optimize xTaskIncrementTick for configNUMBER_OF_CORES > 1 (#1118)

The original implementation only initializes the first
variable. After executing xTaskIncrementTick, the schedule
might not behave as expected.

When configUSE_PREEMPTION == 1 & configUSE_TIME_SLICING == 1,
replace setting xYieldRequiredForCore[ xCoreID ] with setting
xYieldPendings[ xCoreID ].

And when configUSE_PREEMPTION == 1, simplify the check
condition to only check xYieldPendings[ xCoreID ].

Signed-off-by: cymzier <cymb103u@cs.ccu.edu.tw>
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
16 months agoModify the name of a private function to reflect what it actually does (#1119)
xuelix [Wed, 14 Aug 2024 18:08:32 +0000 (11:08 -0700)]
Modify the name of a private function to reflect what it actually does (#1119)

16 months agoUpdated the return values for functions in queue.c based on the actua… (#1117)
xuelix [Mon, 12 Aug 2024 22:47:30 +0000 (15:47 -0700)]
Updated the return values for functions in queue.c based on the actua… (#1117)

* Updated the return values for functions in queue.c based on the actual code.

16 months agoAdd portMEMORY_BARRIER defination to fix over-optimization in xTaskResumeAll. (#1116)
superroc [Mon, 12 Aug 2024 11:36:47 +0000 (19:36 +0800)]
Add portMEMORY_BARRIER defination to fix over-optimization in xTaskResumeAll. (#1116)

Co-authored-by: owen <owen@freqchip.com>
16 months agoAdd CC-RH port for Renesas F1Kx devices (#1100)
Trong Nguyen [Fri, 9 Aug 2024 05:51:21 +0000 (12:51 +0700)]
Add CC-RH port for Renesas F1Kx devices (#1100)

Add CC-RH port for Renesas F1Kx devices

16 months agoAdd support for vApplicationFPUSafeIRQHandler (#1113)
Rahul Kar [Thu, 8 Aug 2024 15:37:11 +0000 (21:07 +0530)]
Add support for vApplicationFPUSafeIRQHandler (#1113)

This PR adds support for vApplicationFPUSafeIRQHandler. The application
writer needs to name their IRQ handler as:
1. vApplicationIRQHandler if the IRQ handler does not use FPU registers.
2. vApplicationFPUSafeIRQHandler is the IRQ handler uses FPU registers.

When the application uses vApplicationFPUSafeIRQHandler, a default
implementation of vApplicationIRQHandler is used which stores FPU
registers and then calls vApplicationFPUSafeIRQHandler.

16 months agoReset xNextTaskUnblockTime in task notify FromISR APIs (#1111)
Gaurav-Aggarwal-AWS [Tue, 6 Aug 2024 05:19:48 +0000 (10:49 +0530)]
Reset xNextTaskUnblockTime in task notify FromISR APIs (#1111)

* Reset xNextTaskUnblockTime in task notify FromISR APIs

If a task is blocked waiting for a notification then
xNextTaskUnblockTime might be set to the blocked task's timeout time. If
the task is unblocked for a reason other than a timeout
xNextTaskUnblockTime is normally left unchanged, because it will
automatically get reset to a new value when the tick count equals
xNextTaskUnblockTime. However if tickless idle is used it is important
to enter sleep mode at the earliest possible time - so reset
xNextTaskUnblockTime here to ensure it is updated at the earliest
possible time.

This was reported here -
https://forums.freertos.org/t/the-vtaskgenericnotifygivefromisr-function-need-call-prvresetnexttaskunblocktime/21090

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
16 months agoOnly check for stream buffer dependencies, if configUSE_STREAM_BUFFERS==1. (#1109)
Daniel Otte [Mon, 5 Aug 2024 10:41:33 +0000 (12:41 +0200)]
Only check for stream buffer dependencies, if configUSE_STREAM_BUFFERS==1. (#1109)

Signed-off-by: Daniel Otte <d.otte@wut.de>
16 months agoUpdate broken links in readme and comments (#1110)
Rahul Kar [Mon, 5 Aug 2024 10:30:47 +0000 (16:00 +0530)]
Update broken links in readme and comments (#1110)

Update broken links in readme and comments

17 months agoDefine vApplicationGetTimerTaskMemory only when configUSE_TIMERS is set (#1104)
Björn Schäpers [Fri, 26 Jul 2024 06:48:35 +0000 (08:48 +0200)]
Define vApplicationGetTimerTaskMemory only when configUSE_TIMERS is set (#1104)

Otherwise it is very reasonable that config_TIMER_TASK_STACK_DEPTH is
undefined.

17 months agoFix POSIX port to respect configUSE_TIME_SLICING (#1103)
Gaurav-Aggarwal-AWS [Fri, 26 Jul 2024 05:12:33 +0000 (10:42 +0530)]
Fix POSIX port to respect configUSE_TIME_SLICING (#1103)

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
17 months agoUpdate ARM_CRx_No_GIC port (#1101)
Rahul Kar [Mon, 22 Jul 2024 15:35:17 +0000 (21:05 +0530)]
Update ARM_CRx_No_GIC port (#1101)

This PR makes the following improvements to the ARM_CRx_No_GIC port-

1. Remove inline assembly and move all the assembly code to the portASM.S
    file.

2. Add support for configUSE_TASK_FPU_SUPPORT -
   - When configUSE_TASK_FPU_SUPPORT is defined to 1, tasks are created
      without floating point context. Tasks that want to use floating point, need
      to call portTASK_USES_FLOATING_POINT(). This is the current behavior.
   - When configUSE_TASK_FPU_SUPPORT is defined to 2, each task is created
      with a floating point context.
  If left undefined, configUSE_TASK_FPU_SUPPORT defaults to 1 for backward compatibility.

3. The application writer can now implement vApplicationSVCHandler to handle the
    SVC calls raised within the application. SVC 0 is used for the yield kernel operation
    and the application can use all the SVC calls other than 0.

Signed-off-by: kar-rahul-aws <karahulx@amazon.com>
18 months agoUpdate LTS 202406 information (#1099)
chinglee-iot [Mon, 1 Jul 2024 09:02:00 +0000 (17:02 +0800)]
Update LTS 202406 information (#1099)

18 months agoFix gcc warning in posix port (#1098)
Florian La Roche [Sat, 29 Jun 2024 15:20:45 +0000 (17:20 +0200)]
Fix gcc warning in posix port (#1098)

Fix warning from "gcc -Wsign-compare" in the file
portable/ThirdParty/GCC/Posix/port.c since PTHREAD_STACK_MIN
is used from system headers.

Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com>
18 months agofix typo gab -> gap and adjust indentation level (#1097)
Florian La Roche [Sat, 29 Jun 2024 06:07:15 +0000 (08:07 +0200)]
fix typo gab -> gap and adjust indentation level (#1097)

Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
18 months agoUpdate XMOS xcore.ai port to be compatible with v11.x (#1096)
Angel Cascarino [Thu, 27 Jun 2024 22:49:53 +0000 (23:49 +0100)]
Update XMOS xcore.ai port to be compatible with v11.x (#1096)

* Fix kexcept function

* Create dummy pxCurrentTCBs for xcore.ai port

* Additional commentary

* Add a layer of indirection to cope with singlecore

* Clarify use of _DoException

18 months agoUpdate README.md (#1094)
Eric Dawe [Mon, 24 Jun 2024 11:40:51 +0000 (12:40 +0100)]
Update README.md (#1094)

Fix spelling of the word 'the' ('thw') in line 29

18 months agoFreeRTOS MPU: Add Privileged eXecute Never MPU attribute support (#1092)
Ahmed Ismail [Wed, 19 Jun 2024 15:12:50 +0000 (16:12 +0100)]
FreeRTOS MPU: Add Privileged eXecute Never MPU attribute support (#1092)

FreeRTOS MPU: Add privileged execute never MPU attribute

A new MPU region attribute Privileged eXecute Never (PXN)
is introduced in Armv8.1-M architecture, where if an MPU
region has PXN attribute set and the processor attempts
to execute the code inside with privileged level,
the Memory Management Fault exception would be triggered,
with IACCVIOL bit in MemManage Fault State Register set
to 1. The PXN feature allows privileged software to ensure
specific application tasks (threads) to execute in
unprivileged level only.

Signed-off-by: Ahmed Ismail <Ahmed.Ismail@arm.com>
18 months agoRemove run state assertion in prvCheckForRunStateChange (#1093)
chinglee-iot [Wed, 19 Jun 2024 10:29:04 +0000 (18:29 +0800)]
Remove run state assertion in prvCheckForRunStateChange (#1093)

In `prvCheckForRunStateChange()`, enabling interrupts should cause this core to immediately service the pending interrupt and yield. Upon the next scheduling of the task, the assertion `configASSERT(pxThisTCB->xTaskRunState != taskTASK_SCHEDULED_TO_YIELD);` may not be true, as other cores could have requested a yield for this task before it evaluates its run state within the assertion. To address this, the task re-evaluates its run state in critical section within a loop until it is eligible for execution, which is the current implementation. Consequently, this assertion should be removed to ensure correct behavior.

18 months agoFix traceMALLOC() allocated bytes (#1089)
耀眼的大神 [Thu, 13 Jun 2024 05:25:54 +0000 (13:25 +0800)]
Fix traceMALLOC() allocated bytes (#1089)

* Fix traceMALLOC() memory count is inaccurate. (#1078)

Modify xWantedSize to the size of a free block when not split blocks.

Ensure that the sizes within traceMALLOC() and traceFREE() macros are equal.

* Create a new variable xAllocatedBlockSize for traceMALLOC()

---------

Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
18 months agoUpdate link in third_party_tools.md (#1090)
Gaurav-Aggarwal-AWS [Wed, 12 Jun 2024 08:13:43 +0000 (13:43 +0530)]
Update link in third_party_tools.md (#1090)

Update the link to the getting started guide for Code Sonar.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Co-authored-by: chinglee-iot <61685396+chinglee-iot@users.noreply.github.com>
18 months ago- Changed macro __VFP_FP__ to __ARM_FP for ports GCC/ARM_CM7, GCC/ARM_CM4_MPU, and...
haydenridd [Tue, 11 Jun 2024 05:00:08 +0000 (22:00 -0700)]
- Changed macro __VFP_FP__ to __ARM_FP for ports GCC/ARM_CM7, GCC/ARM_CM4_MPU, and GCC/ARM_CM4F to accurately reflect if floating point hardware support is enabled (#1088)

Co-authored-by: Hayden Riddiford <hayden@terrakaffe.com>
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
18 months agoAdd traceSTARTING_SCHEDULER tracing hook. (#1082)
Philipp Schilk [Mon, 10 Jun 2024 17:44:10 +0000 (19:44 +0200)]
Add traceSTARTING_SCHEDULER tracing hook. (#1082)

* Add traceSTARTING_SCHEDULER tracing hook.

Discussed here: https://forums.freertos.org/t/tracing-improvements/20097

This hook enables tracers to run code on startup after all RTOS
resources are created and to detect that the scheduler is starting without
relying on traceENTER/traceEXIT macros.

It also provides tracers access to the task handle of all IDLE tasks,
allowing them to be identified unambiguously and without relying on
INCLUDE_xTaskGetIdleTaskHandle.

18 months agoFix compilation warning about undelcared pthread_setname_np (#1079)
maxiao [Mon, 10 Jun 2024 10:32:04 +0000 (18:32 +0800)]
Fix compilation warning about undelcared pthread_setname_np (#1079)

Use _GNU_SOURCE macro instead of __USE_GNU and define it before
including portmacro.h. The reason is that portmacro.h includes limits.h
which in-turn includes features.h - this results in __USE_GNU getting
incorrectly undefined.

18 months agoevent_create(): check malloc() return value to be non-NULL (#1084)
Florian La Roche [Fri, 7 Jun 2024 08:17:13 +0000 (10:17 +0200)]
event_create(): check malloc() return value to be non-NULL (#1084)

* event_create(): check malloc() to be non-NULL

Check malloc() to return non-NULL before writing data
in the function event_create().

Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
* Code review suggestion

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
---------

Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>
18 months agoAdd a list of third party tools (#1080)
Gaurav-Aggarwal-AWS [Fri, 7 Jun 2024 06:20:56 +0000 (11:50 +0530)]
Add a list of third party tools (#1080)

* Add a list of third party tools

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
18 months agoGive queue set queues a unique type number. (#1083)
Philipp Schilk [Thu, 6 Jun 2024 15:36:09 +0000 (17:36 +0200)]
Give queue set queues a unique type number. (#1083)

Discussed here: https://forums.freertos.org/t/tracing-improvements/20097

Changes the value of queueQUEUE_TYPE_SET to a unique value (5) to allow
tracers to differentiate between normal queues and queue sets.

Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com>
18 months agoClarify documentation of xTaskNumber in TaskStatus_t. (#1081)
Philipp Schilk [Thu, 6 Jun 2024 04:53:34 +0000 (06:53 +0200)]
Clarify documentation of xTaskNumber in TaskStatus_t. (#1081)

Discussed here: https://forums.freertos.org/t/tracing-improvements/20097

Adds a note to the (confusingly named) xTaskNumber member of TaskStatus_t
explaining that the value is different to the TaskNumber that can be
accessed using the vTaskSetTaskNumber and vTaskGetTaskNumber functions.

The value returned is actually the value of uxTCBNumber in the TCB.

19 months agoAdd missing Extern "C" to MSVC portmacro.h
Ethan Slattery [Mon, 20 May 2024 02:03:30 +0000 (19:03 -0700)]
Add missing Extern "C" to MSVC portmacro.h

19 months agoReadability enhancements in heap_1.c (#1074)
wdfk-prog [Wed, 29 May 2024 18:13:07 +0000 (02:13 +0800)]
Readability enhancements in heap_1.c (#1074)

* Remove  that Heap_1.c unnecessary judgment and code logic

* Remove useless alignment calculations and increase heap usage size

* Revert "Remove useless alignment calculations and increase heap usage size"

This reverts commit 7832a4bc118661676c4aaa377e412c35ec0b728c.

* Readability improvements

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
---------

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Co-authored-by: huangly <huangly@milesight.com>
Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>
19 months agoChange UBaseType_t to BaseType_t for a boolean variable (#1072)
Rahul Kar [Fri, 24 May 2024 07:23:54 +0000 (12:53 +0530)]
Change UBaseType_t to BaseType_t for a boolean variable (#1072)

19 months agotypo: add space to examples/template_configuration/FreeRTOSConfig.h (#1069)
Florian La Roche [Thu, 23 May 2024 09:51:29 +0000 (11:51 +0200)]
typo: add space to examples/template_configuration/FreeRTOSConfig.h (#1069)

Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
19 months agoUpdate documentation of prvGetExpectedIdleTime (#1061)
Gaurav-Aggarwal-AWS [Mon, 20 May 2024 08:54:54 +0000 (14:24 +0530)]
Update documentation of prvGetExpectedIdleTime (#1061)

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
19 months agoAdd Noreturn attribute in template port for static analysis (#1060)
Rahul Kar [Thu, 16 May 2024 15:41:05 +0000 (21:11 +0530)]
Add Noreturn attribute in template port for static analysis (#1060)

* Add _Noreturn attribute in the template function to fix MISRA 17.11 advisory warnings

* Add _Noreturn attribute in function declaration

* Code review suggestions

19 months agoadded configUSE_POSIX_ERRNO to the template FreeRTOSConfig.h (#1052)
Joseph Julicher [Wed, 15 May 2024 03:58:41 +0000 (20:58 -0700)]
added configUSE_POSIX_ERRNO to the template FreeRTOSConfig.h (#1052)

* added a reference to configUSE_POSIX_ERRNO

* fixed formatting

* format changes from PR check

19 months agoRevert the change introduced in PR #1051 (#1056)
Gaurav-Aggarwal-AWS [Tue, 14 May 2024 10:54:49 +0000 (16:24 +0530)]
Revert the change introduced in PR #1051 (#1056)

As pointed out by Jeff Tenney, the comment introduced in the PR is not
accurate.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
19 months agoFix race in prvProcessSimulatedInterrupts (#1055)
Gaurav-Aggarwal-AWS [Tue, 14 May 2024 10:45:54 +0000 (16:15 +0530)]
Fix race in prvProcessSimulatedInterrupts (#1055)

Earlier the code was suspending the current thread after calling
vTaskSwitchContext. This left a gap where the current thread could
access incorrect pxCurrentTCB after it was changed by
vTaskSwitchContext.

This commit addresses the problem by suspending the current thread
before calling vTaskSwitchContext.

It was reported here - https://github.com/FreeRTOS/FreeRTOS-Kernel/issues/1054.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
19 months agolist.c: improve code comments to point to official documentation about problems which...
Gabriel Staples [Mon, 13 May 2024 11:19:50 +0000 (04:19 -0700)]
list.c: improve code comments to point to official documentation about problems which may cause code to get stuck inside of list.c (#1051)

list.c: improve documentation about initializing binary semaphores

19 months agoAdd configUSE_TASK_FPU_SUPPORT to AARCH64 port (#1048)
StefanBalt [Wed, 8 May 2024 11:37:52 +0000 (13:37 +0200)]
Add configUSE_TASK_FPU_SUPPORT to AARCH64 port (#1048)

* Add configUSE_TASK_FPU_SUPPORT to AARCH64 port

NEON SIMD is required by standard AARCH64 and its registers are
frequently utilized by standard functions such as memcpy().
This means that even simple tasks that do not use any floating point
arithmetics may still alter the contents of the FPU registers.

For this reason it makes sense to add support for
configUSE_TASK_FPU_SUPPORT to be able to enforce FPU register saving and
restoring globally.

The implementation was largely adopted from the ARM_CA9 port. However,
the FPU registers must be placed on the stack before the critical
nesting count to match the AARCH64 portASM.S.

19 months agoAdd vPortGenerateSimulatedInterruptFromWindowsThread in MSVC port (#1044)
chinglee-iot [Wed, 8 May 2024 06:33:11 +0000 (14:33 +0800)]
Add vPortGenerateSimulatedInterruptFromWindowsThread in MSVC port (#1044)

Add vPortGenerateSimulatedInterruptFromWindowsThread  in MSVC port
to enable native windows threads to notify FreeRTOS tasks.

19 months agoUpdate xPortRunning before resuming first task (#1049)
Gaurav-Aggarwal-AWS [Tue, 7 May 2024 15:17:14 +0000 (20:47 +0530)]
Update xPortRunning before resuming first task (#1049)

The variable `xPortRunning` is now updated before starting the first
task.

It fixes the following issue -
https://forums.freertos.org/t/possible-bug-in-the-way-prvtimertask-thread-function-is-started-in-win32-port/19959/

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
19 months agoMove header includes before extern c (#1047)
Holden [Tue, 7 May 2024 00:24:05 +0000 (17:24 -0700)]
Move header includes before extern c (#1047)

20 months agoFix wrong source file list in CMake of GCC_ARM_CM0 port. (#1045)
0mhu [Mon, 29 Apr 2024 15:21:35 +0000 (17:21 +0200)]
Fix wrong source file list in CMake of GCC_ARM_CM0 port. (#1045)

Add GCC/ARM_CM0/mpu_wrappers_v2_asm.c and GCC/ARM_CM0/portasm.c as source files to 'freertos_kernel_port' library.
This fixes the FREERTOS_PORT "GCC_ARM_CM0" CMake configuration.

20 months agoUpdate kernel version v11.1.0+ in tasks.h (#1043)
chinglee-iot [Mon, 22 Apr 2024 09:48:45 +0000 (17:48 +0800)]
Update kernel version v11.1.0+ in tasks.h (#1043)

20 months agoUpdate History.txt for V11.1.0 (#1042)
chinglee-iot [Mon, 22 Apr 2024 07:35:18 +0000 (15:35 +0800)]
Update History.txt for V11.1.0 (#1042)

20 months agoUse suffix "U" for unsigned constant (#1041)
chinglee-iot [Fri, 19 Apr 2024 09:11:16 +0000 (17:11 +0800)]
Use suffix "U" for unsigned constant (#1041)

* Fix the constant suffix to U

* Fix more unsigned contant suffix

---------

Co-authored-by: Ubuntu <ubuntu@ip-172-31-34-245.ap-northeast-1.compute.internal>
20 months agoAdding SMP coverity example (#1039)
chinglee-iot [Fri, 19 Apr 2024 04:48:00 +0000 (12:48 +0800)]
Adding SMP coverity example (#1039)

* Adding SMP coverity example

* Add coverity scan flow

* Fix format

* Update README.md

* Code review suggestions

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
---------

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Co-authored-by: Ubuntu <ubuntu@ip-172-31-34-245.ap-northeast-1.compute.internal>
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>
20 months agoUpdate submodule pointer (#1040)
chinglee-iot [Fri, 19 Apr 2024 04:39:36 +0000 (12:39 +0800)]
Update submodule pointer (#1040)

20 months agoarmv8-m: Remove redundant constant pools (#1035)
Devaraj Ranganna [Thu, 18 Apr 2024 18:45:04 +0000 (19:45 +0100)]
armv8-m: Remove redundant constant pools (#1035)

Currently in Armv8-M GCC/ArmClang ports, constant pool is used to
define literals needed for `ldr` instructions. However, those
constant pools are defined with `.align 4` which increases code size.
Instead of defining the constant pool with `.align 4`, let the
compiler hanlde the constant pool and the required alignment.

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
Co-authored-by: chinglee-iot <61685396+chinglee-iot@users.noreply.github.com>
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
20 months agoFix cmake example errors (#1037)
Rahul Kar [Thu, 18 Apr 2024 13:38:51 +0000 (19:08 +0530)]
Fix cmake example errors (#1037)

Add typecasts to prevent compiler warnings. Remove ULL suffix to adhere
to C90.

20 months agotf-m: Update tf-m to TF-Mv2.0.0 release (#1038)
Devaraj Ranganna [Thu, 18 Apr 2024 12:25:14 +0000 (13:25 +0100)]
tf-m: Update tf-m to TF-Mv2.0.0 release (#1038)

The `portable/ThirdParty/GCC/ARM_TFM/README.md` and
`portable/ThirdParty/GCC/ARM_TFM/os_wrapper_freertos.c` are updated to
support `TF-Mv2.0.0` of trusted-firmware-m release.

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
20 months agoFix build with C90 (#1036)
Tony Josi [Thu, 18 Apr 2024 09:12:53 +0000 (14:42 +0530)]
Fix build with C90 (#1036)

* Fix build with C90

* Fix formatting

20 months agoAdd Stream Batching Buffer (#916)
Caleb Perkinson [Wed, 17 Apr 2024 14:54:00 +0000 (10:54 -0400)]
Add Stream Batching Buffer (#916)

The difference between a stream buffer and a stream batching buffer is when
a task performs read on 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.

20 months agoAdd MPU wrapper from xStreamBufferResetFromISR (#1034)
Rahul Kar [Wed, 17 Apr 2024 08:57:58 +0000 (14:27 +0530)]
Add MPU wrapper from xStreamBufferResetFromISR (#1034)

* Add MPU wrapper from xStreamBufferResetFromISR in V10.6.x

* Code review suggestions

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
---------

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Co-authored-by: chinglee-iot <61685396+chinglee-iot@users.noreply.github.com>
Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>
20 months agoAdd IRQ safe API for message buffer reset (#1033)
HagaiMoshe [Tue, 16 Apr 2024 22:41:55 +0000 (01:41 +0300)]
Add IRQ safe API for message buffer reset (#1033)

* Add API xStreamBufferResetFromISR

Allow reseting the stream buffer from ISR context

Signed-off-by: hagai.moshe <hagaimoshe@outlook.com>
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Co-authored-by: hagai.moshe <hagai.moshe@tandemg.com>
Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com>
Co-authored-by: kar-rahul-aws <karahulx@amazon.com>
Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>
20 months agoAdd readme to example directory (#1032)
Aniruddha Kanhere [Tue, 16 Apr 2024 04:41:50 +0000 (21:41 -0700)]
Add readme to example directory (#1032)

* Add readme to example directory

* Add readme to example directory

* Add readme to example directory

* Add readme to example directory

* remove whitespace

* Update wording

* Update examples/README.md

Co-authored-by: chinglee-iot <61685396+chinglee-iot@users.noreply.github.com>
* Add Coverity webpage link

---------

Co-authored-by: chinglee-iot <61685396+chinglee-iot@users.noreply.github.com>
20 months agoFix the pxTopcOfStack typo in the RISC-V ports. (#1030)
Soren Ptak [Mon, 15 Apr 2024 04:40:10 +0000 (00:40 -0400)]
Fix the pxTopcOfStack typo in the RISC-V ports. (#1030)

* Fix the pxTopcOfStack typo in the RISC-V ports.

* Add a missing o to to

20 months agoFix vTaskSuspendAll assert for critical nesting count (#1029)
chinglee-iot [Thu, 11 Apr 2024 07:12:03 +0000 (15:12 +0800)]
Fix vTaskSuspendAll assert for critical nesting count (#1029)

* Accessing the critical nesting count in current task's TCB is performed with interrupt disabled to ensure atomicity.

20 months agoRemove unwanted volatile keyword (#1028)
Rahul Kar [Thu, 11 Apr 2024 06:00:29 +0000 (11:30 +0530)]
Remove unwanted volatile keyword (#1028)

* Remove unwanted volatile keyword

* Declare variable initially

20 months agoReplace volatile with configLIST_VOLATILE (#1027)
Rahul Kar [Wed, 10 Apr 2024 15:28:48 +0000 (20:58 +0530)]
Replace volatile with configLIST_VOLATILE (#1027)

20 months agoAdd event group and stream buffer config option in template (#1026)
Rahul Kar [Tue, 9 Apr 2024 09:56:34 +0000 (15:26 +0530)]
Add event group and stream buffer config option in template (#1026)

* Add config descriptions in template configuration file

---------

Co-authored-by: GitHub Action <action@github.com>
20 months agoUpdate the memory alignment within the Cortex-R5 port asm code (#1023)
Florian La Roche [Tue, 9 Apr 2024 05:21:12 +0000 (07:21 +0200)]
Update the memory alignment within the Cortex-R5 port asm code (#1023)

Update alignment in ARM_CR5 port.

This is the same patch as 553caa18ced4906cf5060823ada7a10e73c7b535
provided by Richard Barry for issue #426 (ARM_CA9).

Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
20 months agoAdd configCHECK_HANDLER_INSTALLATION description in template file (#1025)
Rahul Kar [Tue, 9 Apr 2024 05:01:53 +0000 (10:31 +0530)]
Add configCHECK_HANDLER_INSTALLATION description in template file (#1025)

Add configconfigCHECK_HANDLER_INSTALLATION description in template
configuration file

20 months agoFix spelling in comment (#1024)
Rahul Kar [Tue, 9 Apr 2024 04:30:23 +0000 (10:00 +0530)]
Fix spelling in comment (#1024)

Co-authored-by: ActoryOu <jay2002824@gmail.com>
20 months agofix typos in comments: interace -> interface, swtich -> switch (#1022)
Florian La Roche [Tue, 9 Apr 2024 00:50:55 +0000 (02:50 +0200)]
fix typos in comments: interace -> interface, swtich -> switch (#1022)

Fix typos in comments: interace -> interface, swtich -> switch.

Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
20 months agoFix TFM about link (#1021)
Kody Stribrny [Fri, 5 Apr 2024 05:10:43 +0000 (22:10 -0700)]
Fix TFM about link (#1021)

This page does not look to
exist anymore which is
failing our link verifier
check.

20 months agoUpdate coverity example README (#1020)
chinglee-iot [Thu, 4 Apr 2024 06:29:36 +0000 (14:29 +0800)]
Update coverity example README (#1020)

* Update coverity example README

* Update main.c for comment

---------

Co-authored-by: Ubuntu <ubuntu@ip-172-31-34-245.ap-northeast-1.compute.internal>
21 months agoAdd in CI-CD builds of the Cortex-Rx MPU Demos (#1018)
Soren Ptak [Fri, 29 Mar 2024 05:37:38 +0000 (22:37 -0700)]
Add in CI-CD builds of the Cortex-Rx MPU Demos (#1018)

21 months agoUpdate checkout action used in workflow files (#1017)
Soren Ptak [Thu, 28 Mar 2024 17:47:34 +0000 (10:47 -0700)]
Update checkout action used in workflow files (#1017)

* Use the latest tagged release of the checkout action.
* Cleanup some of the echo group prints in the workflow files

21 months agoAdd config option for event groups and stream buffers (#994)
Rahul Kar [Wed, 27 Mar 2024 09:19:47 +0000 (14:49 +0530)]
Add config option for event groups and stream buffers (#994)

* Add configUSE_EVENT_GROUPS in source files

* Add configUSE_EVENT_GROUPS macro in MPU wrapper files

* Add configUSE_EVENT_GROUPS macro in MPU port files for GCC and RVDS compilers

* Fix Formatting

* Add configUSE_STREAM_BUFFERS in source files

* Add configUSE_STREAM_BUFFERS  macro in MPU wrapper files

* Add configUSE_STREAM_BUFFERS macro in MPU port files for GCC and RVDS compilers

* Update FreeRTOS.h post latest commit

* Update the ARM_CRx_MPU Port to account for the new configuration changes

* Formatting suggestions

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
* Code review suggestions

---------

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Co-authored-by: joshzarr <joshzarr@amazon.com>
Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>
Co-authored-by: Soren Ptak <ptaksoren@gmail.com>
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
21 months agoAllow xPortIsAuthorizedToAccessBuffer() API call only from mpu_wrappers_v2 (#992)
Rahul Kar [Wed, 27 Mar 2024 08:35:20 +0000 (14:05 +0530)]
Allow xPortIsAuthorizedToAccessBuffer() API call only from mpu_wrappers_v2 (#992)

* Add support to call xPortxPortIsAuthorizedToAccessBuffer function only when using latest MPU wrappers

* Fix build issue in ARM CM3 MPU port

* Code review suggestions

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
---------

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Co-authored-by: Soren Ptak <ptaksoren@gmail.com>
Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
21 months agoAdd removed unprivileged access check to ARM_CRx_MPU xPortIsAuthorizedToAccessBuffer...
Soren Ptak [Wed, 27 Mar 2024 05:07:11 +0000 (22:07 -0700)]
Add removed unprivileged access check to ARM_CRx_MPU xPortIsAuthorizedToAccessBuffer() (#1016)

* Add in a removed check for if a task is attempting to read a variable from a location it has write access to in xPortIsAuthorizedToAccessBuffer.

* Add in a portDONT_DISCARD symbol as well.

21 months agoARM CM0+ MPU Port (#1005)
Soren Ptak [Tue, 26 Mar 2024 20:25:07 +0000 (13:25 -0700)]
ARM CM0+ MPU Port (#1005)

* Add MPU Support to the ARM CM0+ GCC Port.
* Co-authored by @aggarg

21 months agoRemove duplicate pop from MPU Wrappers ASM Files (#1008)
Soren Ptak [Mon, 18 Mar 2024 10:51:21 +0000 (03:51 -0700)]
Remove duplicate pop from MPU Wrappers ASM Files (#1008)

* Remove duplicate pop instruction from portable/ARMv8M/non_secure/portable/GCC/ARM_CM23/mpu_wrappers_v2_asm.c

* Remove duplicate pop instruction from portable/ARMv8M/non_secure/portable/GCC/ARM_CM23_NTZ/mpu_wrappers_v2_asm.c

* Remove duplicate pop instruction from portable/ARMv8M/non_secure/portable/GCC/ARM_CM33/mpu_wrappers_v2_asm.c

* Remove duplicate pop instruction from portable/ARMv8M/non_secure/portable/GCC/ARM_CM33_NTZ/mpu_wrappers_v2_asm.c

* Remove duplicate pop instruction from portable/ARMv8M/non_secure/portable/IAR/ARM_CM23/mpu_wrappers_v2_asm.S

* Remove duplicate pop instruction from portable/ARMv8M/non_secure/portable/IAR/ARM_CM23_NTZ/mpu_wrappers_v2_asm.S

* Remove duplicate pop instruction from portable/ARMv8M/non_secure/portable/IAR/ARM_CM33/mpu_wrappers_v2_asm.S

* Remove duplicate pop instruction from portable/ARMv8M/non_secure/portable/IAR/ARM_CM33_NTZ/mpu_wrappers_v2_asm.S

* Run the copy_files.py script to update the ARMv8M ports to remove the duplicate pop instruction in mpu_wrappers_v2_asm

* Remove duplicate pop instruction from portable/GCC/ARM_CM3_MPU/mpu_wrappers_v2_asm.c

* Remove duplicate pop instruction from portable/GCC/ARM_CM4_MPU/mpu_wrappers_v2_asm.c

* Remove duplicate pop instruction from portable/IAR/ARM_CM4F_MPU/mpu_wrappers_v2_asm.S

* Remove duplicate pop instruction from portable/RVDS/ARM_CM4_MPU/mpu_wrappers_v2_asm.c

---------

Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com>
21 months agoImprovement for 64bit Windows port (#1011)
wat [Mon, 18 Mar 2024 06:09:49 +0000 (15:09 +0900)]
Improvement for 64bit Windows port (#1011)

* 64bit TickType_t is supported on Windows port.(MSVC and MinGW)
Especially it is introduced for 64bit compiler.(x64 platform on MSVC and MinGW-w64)

* Unnecessary compiler warning for the cast operation is disabled locally.(MinGW-w64 only)

* Modify the condition for ignoring compiler warning for the cast operation.

Before modification: Compiler warning was ignored only on MinGW64
After modification: Compiler warning is ignored on MinGW32 and MinGW64
Reason of modification: The cast warning here is unavoidable not only on MinGW64 but also on MinGW32.
"__GNUC__" macro is used because MSVC does not recognize this #pragma directive.

21 months agoAdd daemon task startup hook / timer task creation consistency check (#1009)
RichardBarry [Thu, 7 Mar 2024 07:08:15 +0000 (23:08 -0800)]
Add daemon task startup hook / timer task creation consistency check (#1009)

Add a compile time check that emits a helpful error message if the user
attempts to create a daemon task startup hook without also creating the
timer/daemon task.

The timer/daemon task startup hook runs in the context of the timer/daemon
task.  Therefore, it won't run even if configUSE_DAEMON_TASK_STARTUP_HOOK
is set to 1 if the timer task isn't created.  The timer task is only created if
configUSE_TIMERS is not equal to 0.

21 months agoDefine portNOP in RP2040 port (#1003)
chinglee-iot [Wed, 6 Mar 2024 08:24:19 +0000 (16:24 +0800)]
Define portNOP in RP2040 port (#1003)

21 months agoNot using pxIndex to iterate ready list in trace utility (#1000)
chinglee-iot [Wed, 6 Mar 2024 07:34:21 +0000 (15:34 +0800)]
Not using pxIndex to iterate ready list in trace utility (#1000)

* pxIndex should only be used when selecting next task. Altering pxIndex
  of a ready list will cause the scheduler to be unable to select the
  right task to run. Using a for loop if traversing the list for trace
  utility is required.
* Not defining listGET_OWNER_OF_NEXT_ENTRY when using SMP scheduler

---------

Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
21 months agoUpdate comment in template FreeRTOSConfig.h (#1007)
Gaurav-Aggarwal-AWS [Mon, 4 Mar 2024 05:18:05 +0000 (10:48 +0530)]
Update comment in template FreeRTOSConfig.h (#1007)

Update the comment for configKERNEL_INTERRUPT_PRIORITY in the template
FreeRTOSConfig.h.

It was reported here - https://forums.freertos.org/t/migration-from-v10-5-1-to-v11-0-1-fails-with-new-freertosconfig-h-file/19276/

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
22 months agoFix typo in croutine.c (#1004)
Asmeili [Wed, 28 Feb 2024 11:21:29 +0000 (12:21 +0100)]
Fix typo in croutine.c (#1004)

22 months agoAdd ARMv7-R MPU Port (#938)
Soren Ptak [Mon, 26 Feb 2024 19:01:25 +0000 (14:01 -0500)]
Add ARMv7-R MPU Port (#938)

* Apply git review patch created by @aggargr
* Add necessary changes to the CMakeLists.txt file to build the port

22 months agoUse Regex for Copyright Year in Header Check (#1002)
Soren Ptak [Mon, 26 Feb 2024 17:26:42 +0000 (12:26 -0500)]
Use Regex for Copyright Year in Header Check (#1002)