From e64d1e06b3d9be7b1e14c169affaa9c9674e801c Mon Sep 17 00:00:00 2001 From: Philipp Schilk Date: Mon, 10 Jun 2024 19:44:10 +0200 Subject: [PATCH 1/2] 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. --- include/FreeRTOS.h | 7 +++++++ tasks.c | 2 ++ 2 files changed, 9 insertions(+) diff --git a/include/FreeRTOS.h b/include/FreeRTOS.h index b972ffd10..4b59512c9 100644 --- a/include/FreeRTOS.h +++ b/include/FreeRTOS.h @@ -621,6 +621,13 @@ #define traceTASK_SWITCHED_IN() #endif +#ifndef traceSTARTING_SCHEDULER + +/* Called after all idle tasks and timer task (if enabled) have been created + * successfully, just before the scheduler is started. */ + #define traceSTARTING_SCHEDULER( xIdleTaskHandles ) +#endif + #ifndef traceINCREASE_TICK_COUNT /* Called before stepping the tick count after waking from tickless idle diff --git a/tasks.c b/tasks.c index a049d64fe..f8740257c 100644 --- a/tasks.c +++ b/tasks.c @@ -3732,6 +3732,8 @@ void vTaskStartScheduler( void ) traceTASK_SWITCHED_IN(); + traceSTARTING_SCHEDULER( xIdleTaskHandles ); + /* Setting up the timer tick is hardware specific and thus in the * portable interface. */ From 28b6a141eab7c352d981b40150e58664394e6c67 Mon Sep 17 00:00:00 2001 From: haydenridd Date: Mon, 10 Jun 2024 22:00:08 -0700 Subject: [PATCH 2/2] - 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 Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com> --- portable/GCC/ARM_CM4F/port.c | 2 +- portable/GCC/ARM_CM4_MPU/port.c | 2 +- portable/GCC/ARM_CM7/r0p1/port.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/portable/GCC/ARM_CM4F/port.c b/portable/GCC/ARM_CM4F/port.c index c836999ec..532bbce88 100644 --- a/portable/GCC/ARM_CM4F/port.c +++ b/portable/GCC/ARM_CM4F/port.c @@ -34,7 +34,7 @@ #include "FreeRTOS.h" #include "task.h" -#ifndef __VFP_FP__ +#ifndef __ARM_FP #error This port can only be used when the project options are configured to enable hardware floating point support. #endif diff --git a/portable/GCC/ARM_CM4_MPU/port.c b/portable/GCC/ARM_CM4_MPU/port.c index 6e6f9de75..68b2ab13f 100644 --- a/portable/GCC/ARM_CM4_MPU/port.c +++ b/portable/GCC/ARM_CM4_MPU/port.c @@ -40,7 +40,7 @@ #include "task.h" #include "mpu_syscall_numbers.h" -#ifndef __VFP_FP__ +#ifndef __ARM_FP #error This port can only be used when the project options are configured to enable hardware floating point support. #endif diff --git a/portable/GCC/ARM_CM7/r0p1/port.c b/portable/GCC/ARM_CM7/r0p1/port.c index aaac2a7cb..ac067274d 100644 --- a/portable/GCC/ARM_CM7/r0p1/port.c +++ b/portable/GCC/ARM_CM7/r0p1/port.c @@ -34,7 +34,7 @@ #include "FreeRTOS.h" #include "task.h" -#ifndef __VFP_FP__ +#ifndef __ARM_FP #error This port can only be used when the project options are configured to enable hardware floating point support. #endif