mirror of
https://github.com/espressif/esp-idf.git
synced 2024-09-20 00:36:01 -04:00
feat(freertos): Add beta support for FreeRTOS v10.5.1 kernel
This commit adds beta support for the FreeRTOS v10.5.1 kernel which can be enabled by enabling the CONFIG_FREERTOS_USE_KERNEL_10_5_1 option. The following changes have been made: - Updated freertos/CMakeLists.txt to build v10.5.1 kernel with v10.4.3. ports - Updated existing Xtensa and RISC-V ports to work with V10.5.1 - Modifications to other ESP-IDF components to work with v10.5.1 - Added some ESP-IDF specific tracing changes to v10.5.1 kernel - Make CONFIG_FREERTOS_USE_KERNEL_10_5_1 a public option Note: The beta release is missing some minor fixes, performance improvements, and features. Using this beta release for production is not recommended. Closes https://github.com/espressif/esp-idf/issues/7137
This commit is contained in:
parent
49af70506a
commit
b09462eae8
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@ -85,8 +85,15 @@ void esp_gdbstub_int(__attribute__((unused)) void *frame)
|
|||||||
/* Pointer to saved frame is in pxCurrentTCB
|
/* Pointer to saved frame is in pxCurrentTCB
|
||||||
* See rtos_int_enter function
|
* See rtos_int_enter function
|
||||||
*/
|
*/
|
||||||
extern void *pxCurrentTCB;
|
/* Todo: Provide IDF interface for getting pxCurrentTCB (IDF-8182) */
|
||||||
dummy_tcb_t *tcb = pxCurrentTCB;
|
int core_id = esp_cpu_get_core_id();
|
||||||
|
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
||||||
|
extern void **pxCurrentTCBs;
|
||||||
|
dummy_tcb_t *tcb = pxCurrentTCBs[core_id];
|
||||||
|
#else
|
||||||
|
extern void **pxCurrentTCB;
|
||||||
|
dummy_tcb_t *tcb = pxCurrentTCB[core_id];
|
||||||
|
#endif /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
||||||
gdbstub_handle_uart_int((esp_gdbstub_frame_t *)tcb->top_of_stack);
|
gdbstub_handle_uart_int((esp_gdbstub_frame_t *)tcb->top_of_stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ if(CONFIG_FREERTOS_SMP)
|
|||||||
set(kernel_impl "FreeRTOS-Kernel-SMP")
|
set(kernel_impl "FreeRTOS-Kernel-SMP")
|
||||||
else()
|
else()
|
||||||
if(CONFIG_FREERTOS_USE_KERNEL_10_5_1)
|
if(CONFIG_FREERTOS_USE_KERNEL_10_5_1)
|
||||||
message(FATAL_ERROR "FreeRTOS v10.5.1 is not buildable yet. Still under development")
|
set(kernel_impl "FreeRTOS-Kernel-V10.5.1")
|
||||||
else()
|
else()
|
||||||
set(kernel_impl "FreeRTOS-Kernel")
|
set(kernel_impl "FreeRTOS-Kernel")
|
||||||
endif()
|
endif()
|
||||||
@ -71,30 +71,54 @@ list(APPEND srcs
|
|||||||
"${kernel_impl}/queue.c"
|
"${kernel_impl}/queue.c"
|
||||||
"${kernel_impl}/tasks.c"
|
"${kernel_impl}/tasks.c"
|
||||||
"${kernel_impl}/timers.c"
|
"${kernel_impl}/timers.c"
|
||||||
"${kernel_impl}/croutine.c"
|
|
||||||
"${kernel_impl}/event_groups.c"
|
"${kernel_impl}/event_groups.c"
|
||||||
"${kernel_impl}/stream_buffer.c")
|
"${kernel_impl}/stream_buffer.c")
|
||||||
|
if(NOT CONFIG_FREERTOS_USE_KERNEL_10_5_1)
|
||||||
|
list(APPEND srcs "${kernel_impl}/croutine.c")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Add port source files
|
# Add port source files
|
||||||
list(APPEND srcs
|
if(CONFIG_FREERTOS_USE_KERNEL_10_5_1)
|
||||||
|
list(APPEND srcs
|
||||||
|
"FreeRTOS-Kernel/portable/${arch}/port.c")
|
||||||
|
else()
|
||||||
|
list(APPEND srcs
|
||||||
"${kernel_impl}/portable/${arch}/port.c")
|
"${kernel_impl}/portable/${arch}/port.c")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(arch STREQUAL "linux")
|
if(arch STREQUAL "linux")
|
||||||
|
if(CONFIG_FREERTOS_USE_KERNEL_10_5_1)
|
||||||
|
list(APPEND srcs
|
||||||
|
"FreeRTOS-Kernel/portable/${arch}/utils/wait_for_event.c"
|
||||||
|
"FreeRTOS-Kernel/portable/${arch}/port_idf.c")
|
||||||
|
else()
|
||||||
list(APPEND srcs
|
list(APPEND srcs
|
||||||
"${kernel_impl}/portable/${arch}/utils/wait_for_event.c")
|
"${kernel_impl}/portable/${arch}/utils/wait_for_event.c")
|
||||||
if(kernel_impl STREQUAL "FreeRTOS-Kernel")
|
if(kernel_impl STREQUAL "FreeRTOS-Kernel")
|
||||||
list(APPEND srcs
|
list(APPEND srcs
|
||||||
"${kernel_impl}/portable/${arch}/port_idf.c")
|
"${kernel_impl}/portable/${arch}/port_idf.c")
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
|
if(CONFIG_FREERTOS_USE_KERNEL_10_5_1)
|
||||||
|
list(APPEND srcs
|
||||||
|
"FreeRTOS-Kernel/portable/${arch}/portasm.S")
|
||||||
|
else()
|
||||||
list(APPEND srcs
|
list(APPEND srcs
|
||||||
"${kernel_impl}/portable/${arch}/portasm.S")
|
"${kernel_impl}/portable/${arch}/portasm.S")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(arch STREQUAL "xtensa")
|
if(arch STREQUAL "xtensa")
|
||||||
|
if(CONFIG_FREERTOS_USE_KERNEL_10_5_1)
|
||||||
|
list(APPEND srcs
|
||||||
|
"FreeRTOS-Kernel/portable/${arch}/xtensa_init.c"
|
||||||
|
"FreeRTOS-Kernel/portable/${arch}/xtensa_overlay_os_hook.c")
|
||||||
|
else()
|
||||||
list(APPEND srcs
|
list(APPEND srcs
|
||||||
"${kernel_impl}/portable/${arch}/xtensa_init.c"
|
"${kernel_impl}/portable/${arch}/xtensa_init.c"
|
||||||
"${kernel_impl}/portable/${arch}/xtensa_overlay_os_hook.c")
|
"${kernel_impl}/portable/${arch}/xtensa_overlay_os_hook.c")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Add ESP-additions source files
|
# Add ESP-additions source files
|
||||||
@ -127,9 +151,15 @@ list(APPEND include_dirs
|
|||||||
"${kernel_impl}/include") # FreeRTOS headers via `#include "freertos/xxx.h"`
|
"${kernel_impl}/include") # FreeRTOS headers via `#include "freertos/xxx.h"`
|
||||||
|
|
||||||
# Add port public include directories
|
# Add port public include directories
|
||||||
list(APPEND include_dirs
|
if(CONFIG_FREERTOS_USE_KERNEL_10_5_1)
|
||||||
|
list(APPEND include_dirs
|
||||||
|
"FreeRTOS-Kernel/portable/${arch}/include" # For port headers via `#include "freertos/...h"`
|
||||||
|
"FreeRTOS-Kernel/portable/${arch}/include/freertos") # For port headers via `#include "...h"`
|
||||||
|
else()
|
||||||
|
list(APPEND include_dirs
|
||||||
"${kernel_impl}/portable/${arch}/include" # For port headers via `#include "freertos/...h"`
|
"${kernel_impl}/portable/${arch}/include" # For port headers via `#include "freertos/...h"`
|
||||||
"${kernel_impl}/portable/${arch}/include/freertos") # For port headers via `#include "...h"`
|
"${kernel_impl}/portable/${arch}/include/freertos") # For port headers via `#include "...h"`
|
||||||
|
endif()
|
||||||
|
|
||||||
# Add ESP-additions public include directories
|
# Add ESP-additions public include directories
|
||||||
list(APPEND include_dirs
|
list(APPEND include_dirs
|
||||||
@ -151,8 +181,13 @@ list(APPEND private_include_dirs
|
|||||||
|
|
||||||
# Add port private include directories
|
# Add port private include directories
|
||||||
if(arch STREQUAL "linux")
|
if(arch STREQUAL "linux")
|
||||||
|
if(CONFIG_FREERTOS_USE_KERNEL_10_5_1)
|
||||||
|
list(APPEND private_include_dirs
|
||||||
|
"FreeRTOS-Kernel/portable/${arch}/") # Linux port `#include "utils/wait_for_event.h"`
|
||||||
|
else()
|
||||||
list(APPEND private_include_dirs
|
list(APPEND private_include_dirs
|
||||||
"${kernel_impl}/portable/${arch}/") # Linux port `#include "utils/wait_for_event.h"`
|
"${kernel_impl}/portable/${arch}/") # Linux port `#include "utils/wait_for_event.h"`
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Add ESP-additions private include directories
|
# Add ESP-additions private include directories
|
||||||
|
@ -1474,6 +1474,46 @@ typedef StaticStreamBuffer_t StaticMessageBuffer_t;
|
|||||||
|
|
||||||
#ifdef ESP_PLATFORM
|
#ifdef ESP_PLATFORM
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Default values for trace macros added by ESP-IDF and are not part of Vanilla FreeRTOS
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef traceISR_EXIT_TO_SCHEDULER
|
||||||
|
#define traceISR_EXIT_TO_SCHEDULER()
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef traceISR_EXIT
|
||||||
|
#define traceISR_EXIT()
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef traceISR_ENTER
|
||||||
|
#define traceISR_ENTER( _n_ )
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef traceQUEUE_SEMAPHORE_RECEIVE
|
||||||
|
#define traceQUEUE_SEMAPHORE_RECEIVE( pxQueue )
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef traceQUEUE_GIVE_FROM_ISR
|
||||||
|
#define traceQUEUE_GIVE_FROM_ISR( pxQueue )
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef traceQUEUE_GIVE_FROM_ISR_FAILED
|
||||||
|
#define traceQUEUE_GIVE_FROM_ISR_FAILED( pxQueue )
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Include ESP-IDF API additions implicitly for compatibility reasons.
|
* Include ESP-IDF API additions implicitly for compatibility reasons.
|
||||||
*
|
*
|
||||||
|
@ -46,6 +46,15 @@ typedef void (* TaskFunction_t)( void * );
|
|||||||
#define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) ( ( ( TickType_t ) ( xTimeInMs ) * ( TickType_t ) configTICK_RATE_HZ ) / ( TickType_t ) 1000U ) )
|
#define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) ( ( ( TickType_t ) ( xTimeInMs ) * ( TickType_t ) configTICK_RATE_HZ ) / ( TickType_t ) 1000U ) )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Converts a time in ticks to milliseconds. This macro can be
|
||||||
|
* overridden by a macro of the same name defined in FreeRTOSConfig.h in case the
|
||||||
|
* definition here is not suitable for your application.
|
||||||
|
*
|
||||||
|
* Todo: Upstream this macro (IDF-8181) */
|
||||||
|
#ifndef pdTICKS_TO_MS
|
||||||
|
#define pdTICKS_TO_MS( xTicks ) ( ( TickType_t ) ( ( uint64_t ) ( xTicks ) * 1000 / configTICK_RATE_HZ ) )
|
||||||
|
#endif
|
||||||
|
|
||||||
#define pdFALSE ( ( BaseType_t ) 0 )
|
#define pdFALSE ( ( BaseType_t ) 0 )
|
||||||
#define pdTRUE ( ( BaseType_t ) 1 )
|
#define pdTRUE ( ( BaseType_t ) 1 )
|
||||||
|
|
||||||
|
@ -1448,7 +1448,8 @@ BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue,
|
|||||||
const int8_t cTxLock = queueUNLOCKED;
|
const int8_t cTxLock = queueUNLOCKED;
|
||||||
#endif /* queueUSE_LOCKS == 1 */
|
#endif /* queueUSE_LOCKS == 1 */
|
||||||
|
|
||||||
traceQUEUE_SEND_FROM_ISR( pxQueue );
|
/* Todo: Reconcile tracing differences (IDF-8183) */
|
||||||
|
traceQUEUE_GIVE_FROM_ISR( pxQueue );
|
||||||
|
|
||||||
/* A task can only have an inherited priority if it is a mutex
|
/* A task can only have an inherited priority if it is a mutex
|
||||||
* holder - and if there is a mutex holder then the mutex cannot be
|
* holder - and if there is a mutex holder then the mutex cannot be
|
||||||
@ -1557,7 +1558,8 @@ BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
traceQUEUE_SEND_FROM_ISR_FAILED( pxQueue );
|
/* Todo: Reconcile tracing differences (IDF-8183) */
|
||||||
|
traceQUEUE_GIVE_FROM_ISR_FAILED( pxQueue );
|
||||||
xReturn = errQUEUE_FULL;
|
xReturn = errQUEUE_FULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1782,7 +1784,8 @@ BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue,
|
|||||||
* must be the highest priority task wanting to access the queue. */
|
* must be the highest priority task wanting to access the queue. */
|
||||||
if( uxSemaphoreCount > ( UBaseType_t ) 0 )
|
if( uxSemaphoreCount > ( UBaseType_t ) 0 )
|
||||||
{
|
{
|
||||||
traceQUEUE_RECEIVE( pxQueue );
|
/* Todo: Reconcile tracing differences (IDF-8183) */
|
||||||
|
traceQUEUE_SEMAPHORE_RECEIVE( pxQueue );
|
||||||
|
|
||||||
/* Semaphores are queues with a data size of zero and where the
|
/* Semaphores are queues with a data size of zero and where the
|
||||||
* messages waiting is the semaphore's count. Reduce the count. */
|
* messages waiting is the semaphore's count. Reduce the count. */
|
||||||
|
@ -4197,6 +4197,10 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
|
|||||||
}
|
}
|
||||||
#endif /* configUSE_IDLE_HOOK */
|
#endif /* configUSE_IDLE_HOOK */
|
||||||
|
|
||||||
|
/* Call the esp-idf idle hook system. Todo IDF-8180 */
|
||||||
|
extern void esp_vApplicationIdleHook( void );
|
||||||
|
esp_vApplicationIdleHook();
|
||||||
|
|
||||||
/* This conditional compilation should use inequality to 0, not equality
|
/* This conditional compilation should use inequality to 0, not equality
|
||||||
* to 1. This is to ensure portSUPPRESS_TICKS_AND_SLEEP() is called when
|
* to 1. This is to ensure portSUPPRESS_TICKS_AND_SLEEP() is called when
|
||||||
* user defined low power mode implementations require
|
* user defined low power mode implementations require
|
||||||
|
@ -444,6 +444,11 @@ void vPortTCBPreDeleteHook( void *pxTCB );
|
|||||||
* - Maps to forward declared functions
|
* - Maps to forward declared functions
|
||||||
* ------------------------------------------------------------------------------------------------------------------ */
|
* ------------------------------------------------------------------------------------------------------------------ */
|
||||||
|
|
||||||
|
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
||||||
|
#define portGET_CORE_ID() xPortGetCoreID()
|
||||||
|
#define portYIELD_CORE( x ) vPortYieldOtherCore( x )
|
||||||
|
#endif
|
||||||
|
|
||||||
// --------------------- Interrupts ------------------------
|
// --------------------- Interrupts ------------------------
|
||||||
|
|
||||||
#define portDISABLE_INTERRUPTS() portSET_INTERRUPT_MASK_FROM_ISR()
|
#define portDISABLE_INTERRUPTS() portSET_INTERRUPT_MASK_FROM_ISR()
|
||||||
|
@ -8,6 +8,13 @@
|
|||||||
#include "freertos/FreeRTOSConfig.h"
|
#include "freertos/FreeRTOSConfig.h"
|
||||||
#include "soc/soc_caps.h"
|
#include "soc/soc_caps.h"
|
||||||
|
|
||||||
|
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
||||||
|
#define pxCurrentTCB pxCurrentTCBs
|
||||||
|
.extern pxCurrentTCBs
|
||||||
|
#else
|
||||||
|
.extern pxCurrentTCB
|
||||||
|
#endif
|
||||||
|
|
||||||
#if CONFIG_ESP_SYSTEM_HW_STACK_GUARD
|
#if CONFIG_ESP_SYSTEM_HW_STACK_GUARD
|
||||||
#include "esp_private/hw_stack_guard.h"
|
#include "esp_private/hw_stack_guard.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -427,6 +427,11 @@ void vPortTCBPreDeleteHook( void *pxTCB );
|
|||||||
* - Maps to forward declared functions
|
* - Maps to forward declared functions
|
||||||
* ------------------------------------------------------------------------------------------------------------------ */
|
* ------------------------------------------------------------------------------------------------------------------ */
|
||||||
|
|
||||||
|
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
||||||
|
#define portGET_CORE_ID() xPortGetCoreID()
|
||||||
|
#define portYIELD_CORE( x ) vPortYieldOtherCore( x )
|
||||||
|
#endif
|
||||||
|
|
||||||
// --------------------- Interrupts ------------------------
|
// --------------------- Interrupts ------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
* SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileContributor: 2016-2023 Espressif Systems (Shanghai) CO LTD
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2015-2019 Cadence Design Systems, Inc.
|
* Copyright (c) 2015-2019 Cadence Design Systems, Inc.
|
||||||
@ -33,7 +33,13 @@
|
|||||||
|
|
||||||
#define TOPOFSTACK_OFFS 0x00 /* StackType_t *pxTopOfStack */
|
#define TOPOFSTACK_OFFS 0x00 /* StackType_t *pxTopOfStack */
|
||||||
|
|
||||||
|
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
||||||
|
#define pxCurrentTCB pxCurrentTCBs
|
||||||
|
.extern pxCurrentTCBs
|
||||||
|
#else
|
||||||
.extern pxCurrentTCB
|
.extern pxCurrentTCB
|
||||||
|
#endif
|
||||||
|
|
||||||
#if XCHAL_CP_NUM > 0
|
#if XCHAL_CP_NUM > 0
|
||||||
/* Offsets used to get a task's coprocessor save area (CPSA) from its TCB */
|
/* Offsets used to get a task's coprocessor save area (CPSA) from its TCB */
|
||||||
.extern offset_pxEndOfStack
|
.extern offset_pxEndOfStack
|
||||||
|
@ -4,11 +4,12 @@ menu "FreeRTOS"
|
|||||||
# Upstream FreeRTOS configurations go here
|
# Upstream FreeRTOS configurations go here
|
||||||
|
|
||||||
config FREERTOS_USE_KERNEL_10_5_1
|
config FREERTOS_USE_KERNEL_10_5_1
|
||||||
bool "Use v10.5.1 Kernel (EXPERIMENTAL)"
|
bool "Use v10.5.1 Kernel (BETA)"
|
||||||
depends on IDF_EXPERIMENTAL_FEATURES
|
|
||||||
default n
|
default n
|
||||||
help
|
help
|
||||||
Hidden option for development/testing purposes to enable building with the v10.5.1 kernel
|
This option enables building for FreeRTOS v10.5.1 kernel.
|
||||||
|
|
||||||
|
Note: The v10.5.1 kernel is still in BETA, thus is not production ready.
|
||||||
|
|
||||||
config FREERTOS_SMP
|
config FREERTOS_SMP
|
||||||
bool "Run the Amazon SMP FreeRTOS kernel instead (FEATURE UNDER DEVELOPMENT)"
|
bool "Run the Amazon SMP FreeRTOS kernel instead (FEATURE UNDER DEVELOPMENT)"
|
||||||
|
@ -199,6 +199,7 @@
|
|||||||
#define INCLUDE_xTaskResumeFromISR 1
|
#define INCLUDE_xTaskResumeFromISR 1
|
||||||
#define INCLUDE_xTimerPendFunctionCall 1
|
#define INCLUDE_xTimerPendFunctionCall 1
|
||||||
#define INCLUDE_xTaskGetSchedulerState 1
|
#define INCLUDE_xTaskGetSchedulerState 1
|
||||||
|
#define INCLUDE_xTaskGetCurrentTaskHandle 1
|
||||||
|
|
||||||
/* -------------------- Trace Macros ----------------------- */
|
/* -------------------- Trace Macros ----------------------- */
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
|
|
||||||
/* -------------------- API Includes ----------------------- */
|
/* -------------------- API Includes ----------------------- */
|
||||||
|
|
||||||
#define INCLUDE_xTaskGetCurrentTaskHandle 0 /* not defined in POSIX simulator */
|
/* Todo: Reconcile INCLUDE_option differences (IDF-8186) */
|
||||||
#define INCLUDE_vTaskDelayUntil 1
|
#define INCLUDE_vTaskDelayUntil 1
|
||||||
#define INCLUDE_uxTaskGetStackHighWaterMark2 0
|
#define INCLUDE_uxTaskGetStackHighWaterMark2 0
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
* if users enable CONFIG_FREERTOS_USE_MINIMAL_IDLE_HOOK. */
|
* if users enable CONFIG_FREERTOS_USE_MINIMAL_IDLE_HOOK. */
|
||||||
#define configUSE_MINIMAL_IDLE_HOOK 1
|
#define configUSE_MINIMAL_IDLE_HOOK 1
|
||||||
|
|
||||||
/* IDF Newlib supports dynamic reentrancy. We provide our own __getreent()
|
/* IDF Newlib supports dynamic reentrancy. We provide our own __getreent()
|
||||||
* function. */
|
* function. */
|
||||||
#define configNEWLIB_REENTRANT_IS_DYNAMIC 1
|
#define configNEWLIB_REENTRANT_IS_DYNAMIC 1
|
||||||
#endif
|
#endif
|
||||||
@ -42,6 +42,17 @@
|
|||||||
/* ----------------------- System -------------------------- */
|
/* ----------------------- System -------------------------- */
|
||||||
|
|
||||||
#define configUSE_NEWLIB_REENTRANT 1
|
#define configUSE_NEWLIB_REENTRANT 1
|
||||||
|
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
||||||
|
|
||||||
|
/* - FreeRTOS provides default for configTLS_BLOCK_TYPE.
|
||||||
|
* - We simply provide our own INIT and DEINIT functions
|
||||||
|
* - We set "SET" to a blank macro since there is no need to set the reentrancy
|
||||||
|
* pointer. All newlib functions calls __getreent. */
|
||||||
|
#define configINIT_TLS_BLOCK( xTLSBlock ) esp_reent_init( &( xTLSBlock ) )
|
||||||
|
#define configSET_TLS_BLOCK( xTLSBlock )
|
||||||
|
#define configDEINIT_TLS_BLOCK( xTLSBlock ) _reclaim_reent( &( xTLSBlock ) )
|
||||||
|
|
||||||
|
#endif /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
||||||
|
|
||||||
#define configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H 1
|
#define configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H 1
|
||||||
|
|
||||||
@ -61,8 +72,8 @@
|
|||||||
|
|
||||||
/* -------------------- API Includes ----------------------- */
|
/* -------------------- API Includes ----------------------- */
|
||||||
|
|
||||||
|
/* Todo: Reconcile INCLUDE_option differences (IDF-8186) */
|
||||||
#define INCLUDE_xTaskDelayUntil 1
|
#define INCLUDE_xTaskDelayUntil 1
|
||||||
#define INCLUDE_xTaskGetCurrentTaskHandle 1
|
|
||||||
#define INCLUDE_uxTaskGetStackHighWaterMark2 1
|
#define INCLUDE_uxTaskGetStackHighWaterMark2 1
|
||||||
|
|
||||||
/* ------------------------------------------------ ESP-IDF Additions --------------------------------------------------
|
/* ------------------------------------------------ ESP-IDF Additions --------------------------------------------------
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
* if users enable CONFIG_FREERTOS_USE_MINIMAL_IDLE_HOOK. */
|
* if users enable CONFIG_FREERTOS_USE_MINIMAL_IDLE_HOOK. */
|
||||||
#define configUSE_MINIMAL_IDLE_HOOK 1
|
#define configUSE_MINIMAL_IDLE_HOOK 1
|
||||||
|
|
||||||
/* IDF Newlib supports dynamic reentrancy. We provide our own __getreent()
|
/* IDF Newlib supports dynamic reentrancy. We provide our own __getreent()
|
||||||
* function. */
|
* function. */
|
||||||
#define configNEWLIB_REENTRANT_IS_DYNAMIC 1
|
#define configNEWLIB_REENTRANT_IS_DYNAMIC 1
|
||||||
#endif
|
#endif
|
||||||
@ -69,6 +69,17 @@
|
|||||||
/* ----------------------- System -------------------------- */
|
/* ----------------------- System -------------------------- */
|
||||||
|
|
||||||
#define configUSE_NEWLIB_REENTRANT 1
|
#define configUSE_NEWLIB_REENTRANT 1
|
||||||
|
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
||||||
|
|
||||||
|
/* - FreeRTOS provides default for configTLS_BLOCK_TYPE.
|
||||||
|
* - We simply provide our own INIT and DEINIT functions
|
||||||
|
* - We set "SET" to a blank macro since there is no need to set the reentrancy
|
||||||
|
* pointer. All newlib functions calls __getreent. */
|
||||||
|
#define configINIT_TLS_BLOCK( xTLSBlock ) esp_reent_init( &( xTLSBlock ) )
|
||||||
|
#define configSET_TLS_BLOCK( xTLSBlock )
|
||||||
|
#define configDEINIT_TLS_BLOCK( xTLSBlock ) _reclaim_reent( &( xTLSBlock ) )
|
||||||
|
|
||||||
|
#endif /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
||||||
|
|
||||||
#define configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H 1
|
#define configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H 1
|
||||||
|
|
||||||
@ -88,8 +99,8 @@
|
|||||||
|
|
||||||
/* -------------------- API Includes ----------------------- */
|
/* -------------------- API Includes ----------------------- */
|
||||||
|
|
||||||
|
/* Todo: Reconcile INCLUDE_option differences (IDF-8186) */
|
||||||
#define INCLUDE_xTaskDelayUntil 1
|
#define INCLUDE_xTaskDelayUntil 1
|
||||||
#define INCLUDE_xTaskGetCurrentTaskHandle 1
|
|
||||||
#define INCLUDE_uxTaskGetStackHighWaterMark2 1
|
#define INCLUDE_uxTaskGetStackHighWaterMark2 1
|
||||||
|
|
||||||
/* ------------------------------------------------ ESP-IDF Additions --------------------------------------------------
|
/* ------------------------------------------------ ESP-IDF Additions --------------------------------------------------
|
||||||
|
@ -20,6 +20,11 @@
|
|||||||
* additional API.
|
* additional API.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
||||||
|
#define pxCurrentTCB pxCurrentTCBs
|
||||||
|
#else
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ------------------------------------------------- Static Asserts ------------------------------------------------- */
|
/* ------------------------------------------------- Static Asserts ------------------------------------------------- */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -221,11 +226,24 @@ _Static_assert( offsetof( StaticTask_t, pxDummy8 ) == offsetof( TCB_t, pxEndOfSt
|
|||||||
pxNewTCB = ( TCB_t * ) pvPortMalloc( sizeof( TCB_t ) );
|
pxNewTCB = ( TCB_t * ) pvPortMalloc( sizeof( TCB_t ) );
|
||||||
|
|
||||||
if( pxNewTCB != NULL )
|
if( pxNewTCB != NULL )
|
||||||
|
{
|
||||||
|
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
||||||
|
{
|
||||||
|
memset( ( void * ) pxNewTCB, 0x00, sizeof( TCB_t ) );
|
||||||
|
|
||||||
|
/* Allocate space for the stack used by the task being created.
|
||||||
|
* The base of the stack memory stored in the TCB so the task can
|
||||||
|
* be deleted later if required. */
|
||||||
|
pxNewTCB->pxStack = ( StackType_t * ) pvPortMallocStack( ( ( ( size_t ) usStackDepth ) * sizeof( StackType_t ) ) ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
|
||||||
|
}
|
||||||
|
#else /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
||||||
{
|
{
|
||||||
/* Allocate space for the stack used by the task being created.
|
/* Allocate space for the stack used by the task being created.
|
||||||
* The base of the stack memory stored in the TCB so the task can
|
* The base of the stack memory stored in the TCB so the task can
|
||||||
* be deleted later if required. */
|
* be deleted later if required. */
|
||||||
pxNewTCB->pxStack = ( StackType_t * ) pvPortMalloc( ( ( ( size_t ) usStackDepth ) * sizeof( StackType_t ) ) ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
|
pxNewTCB->pxStack = ( StackType_t * ) pvPortMalloc( ( ( ( size_t ) usStackDepth ) * sizeof( StackType_t ) ) ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
|
||||||
|
}
|
||||||
|
#endif /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
||||||
|
|
||||||
if( pxNewTCB->pxStack == NULL )
|
if( pxNewTCB->pxStack == NULL )
|
||||||
{
|
{
|
||||||
@ -239,8 +257,17 @@ _Static_assert( offsetof( StaticTask_t, pxDummy8 ) == offsetof( TCB_t, pxEndOfSt
|
|||||||
{
|
{
|
||||||
StackType_t * pxStack;
|
StackType_t * pxStack;
|
||||||
|
|
||||||
|
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
||||||
|
{
|
||||||
|
/* Allocate space for the stack used by the task being created. */
|
||||||
|
pxStack = pvPortMallocStack( ( ( ( size_t ) usStackDepth ) * sizeof( StackType_t ) ) ); /*lint !e9079 All values returned by pvPortMalloc() have at least the alignment required by the MCU's stack and this allocation is the stack. */
|
||||||
|
}
|
||||||
|
#else /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
||||||
|
{
|
||||||
/* Allocate space for the stack used by the task being created. */
|
/* Allocate space for the stack used by the task being created. */
|
||||||
pxStack = pvPortMalloc( ( ( ( size_t ) usStackDepth ) * sizeof( StackType_t ) ) ); /*lint !e9079 All values returned by pvPortMalloc() have at least the alignment required by the MCU's stack and this allocation is the stack. */
|
pxStack = pvPortMalloc( ( ( ( size_t ) usStackDepth ) * sizeof( StackType_t ) ) ); /*lint !e9079 All values returned by pvPortMalloc() have at least the alignment required by the MCU's stack and this allocation is the stack. */
|
||||||
|
}
|
||||||
|
#endif /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
||||||
|
|
||||||
if( pxStack != NULL )
|
if( pxStack != NULL )
|
||||||
{
|
{
|
||||||
@ -249,6 +276,12 @@ _Static_assert( offsetof( StaticTask_t, pxDummy8 ) == offsetof( TCB_t, pxEndOfSt
|
|||||||
|
|
||||||
if( pxNewTCB != NULL )
|
if( pxNewTCB != NULL )
|
||||||
{
|
{
|
||||||
|
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
||||||
|
{
|
||||||
|
memset( ( void * ) pxNewTCB, 0x00, sizeof( TCB_t ) );
|
||||||
|
}
|
||||||
|
#endif /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
||||||
|
|
||||||
/* Store the stack location in the TCB. */
|
/* Store the stack location in the TCB. */
|
||||||
pxNewTCB->pxStack = pxStack;
|
pxNewTCB->pxStack = pxStack;
|
||||||
}
|
}
|
||||||
@ -256,8 +289,16 @@ _Static_assert( offsetof( StaticTask_t, pxDummy8 ) == offsetof( TCB_t, pxEndOfSt
|
|||||||
{
|
{
|
||||||
/* The stack cannot be used as the TCB was not created. Free
|
/* The stack cannot be used as the TCB was not created. Free
|
||||||
* it again. */
|
* it again. */
|
||||||
|
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
||||||
|
{
|
||||||
|
vPortFreeStack( pxStack );
|
||||||
|
}
|
||||||
|
#else /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
||||||
|
{
|
||||||
vPortFree( pxStack );
|
vPortFree( pxStack );
|
||||||
}
|
}
|
||||||
|
#endif /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -356,6 +397,13 @@ _Static_assert( offsetof( StaticTask_t, pxDummy8 ) == offsetof( TCB_t, pxEndOfSt
|
|||||||
/* The memory used for the task's TCB and stack are passed into this
|
/* The memory used for the task's TCB and stack are passed into this
|
||||||
* function - use them. */
|
* function - use them. */
|
||||||
pxNewTCB = ( TCB_t * ) pxTaskBuffer; /*lint !e740 !e9087 Unusual cast is ok as the structures are designed to have the same alignment, and the size is checked by an assert. */
|
pxNewTCB = ( TCB_t * ) pxTaskBuffer; /*lint !e740 !e9087 Unusual cast is ok as the structures are designed to have the same alignment, and the size is checked by an assert. */
|
||||||
|
|
||||||
|
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
||||||
|
{
|
||||||
|
memset( ( void * ) pxNewTCB, 0x00, sizeof( TCB_t ) );
|
||||||
|
}
|
||||||
|
#endif /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
||||||
|
|
||||||
pxNewTCB->pxStack = ( StackType_t * ) puxStackBuffer;
|
pxNewTCB->pxStack = ( StackType_t * ) puxStackBuffer;
|
||||||
|
|
||||||
#if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) /*lint !e731 !e9029 Macro has been consolidated for readability reasons. */
|
#if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) /*lint !e731 !e9029 Macro has been consolidated for readability reasons. */
|
||||||
@ -892,8 +940,16 @@ uint8_t * pxTaskGetStackStart( TaskHandle_t xTask )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* We have a task; return its reentrant struct. */
|
/* We have a task; return its reentrant struct. */
|
||||||
|
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
||||||
|
{
|
||||||
|
ret = &pxCurTask->xTLSBlock;
|
||||||
|
}
|
||||||
|
#else /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
||||||
|
{
|
||||||
ret = &pxCurTask->xNewLib_reent;
|
ret = &pxCurTask->xNewLib_reent;
|
||||||
}
|
}
|
||||||
|
#endif /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -208,6 +208,17 @@ TaskHandle_t xTaskGetCurrentTaskHandleForCPU( BaseType_t xCoreID )
|
|||||||
*/
|
*/
|
||||||
configRUN_TIME_COUNTER_TYPE ulTaskGetIdleRunTimePercentForCore( BaseType_t xCoreID );
|
configRUN_TIME_COUNTER_TYPE ulTaskGetIdleRunTimePercentForCore( BaseType_t xCoreID );
|
||||||
|
|
||||||
|
#else /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
||||||
|
|
||||||
|
/* CMock Workaround: CMock currently doesn't preprocess files, thus functions
|
||||||
|
* guarded by ifdef still get mocked. We provide a dummy define here so that
|
||||||
|
* functions using configRUN_TIME_COUNTER_TYPE can still be mocked.
|
||||||
|
*
|
||||||
|
* Todo: Will be removed when V10.5.1 becomes the default kernel. */
|
||||||
|
#ifndef configRUN_TIME_COUNTER_TYPE
|
||||||
|
#define configRUN_TIME_COUNTER_TYPE unsigned int
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
#endif /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -12,6 +12,7 @@ components/freertos/FreeRTOS-Kernel/include/freertos/
|
|||||||
components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/
|
components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/
|
||||||
components/freertos/FreeRTOS-Kernel-SMP/include/freertos/
|
components/freertos/FreeRTOS-Kernel-SMP/include/freertos/
|
||||||
components/freertos/FreeRTOS-Kernel-SMP/portable/xtensa/include/freertos/
|
components/freertos/FreeRTOS-Kernel-SMP/portable/xtensa/include/freertos/
|
||||||
|
components/freertos/FreeRTOS-Kernel-V10.5.1/include/freertos/
|
||||||
|
|
||||||
|
|
||||||
components/log/include/esp_log_internal.h
|
components/log/include/esp_log_internal.h
|
||||||
|
Loading…
Reference in New Issue
Block a user