From 275743ab1c478e735c47cf739d1e79302b0cb36d Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Fri, 12 Mar 2021 11:55:05 +1100 Subject: [PATCH] doc: Add notes that vTaskStartScheduler() is called during startup Closes https://github.com/espressif/esp-idf/issues/1457 --- components/freertos/include/freertos/task.h | 4 ++++ docs/en/api-guides/freertos-smp.rst | 7 ++++++- docs/en/api-guides/memory-types.rst | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/components/freertos/include/freertos/task.h b/components/freertos/include/freertos/task.h index 78cdc8ff69..f6a2908a5d 100644 --- a/components/freertos/include/freertos/task.h +++ b/components/freertos/include/freertos/task.h @@ -1203,6 +1203,10 @@ BaseType_t xTaskResumeFromISR( TaskHandle_t xTaskToResume ) PRIVILEGED_FUNCTION; /** * Starts the real time kernel tick processing. * + * NOTE: In ESP-IDF the scheduler is started automatically during + * application startup, vTaskStartScheduler() should not be called from + * ESP-IDF applications. + * * After calling the kernel has control over which tasks are executed and when. * * See the demo application file main.c for an example of creating diff --git a/docs/en/api-guides/freertos-smp.rst b/docs/en/api-guides/freertos-smp.rst index 661f5c1be2..388cdde9f5 100644 --- a/docs/en/api-guides/freertos-smp.rst +++ b/docs/en/api-guides/freertos-smp.rst @@ -21,7 +21,7 @@ found via https://www.freertos.org/a00106.html For information regarding features that are exclusive to ESP-IDF FreeRTOS, see :doc:`ESP-IDF FreeRTOS Additions<../api-reference/system/freertos_additions>`. -.. only:: esp32 +.. only:: not CONFIG_FREERTOS_UNICORE :ref:`tasks-and-task-creation`: Use :cpp:func:`xTaskCreatePinnedToCore` or :cpp:func:`xTaskCreateStaticPinnedToCore` to create tasks in ESP-IDF FreeRTOS. The @@ -53,6 +53,8 @@ see :doc:`ESP-IDF FreeRTOS Additions<../api-reference/system/freertos_additions> unaffected. If the other core attemps to take same mutex, it will spin until the calling core has released the mutex by exiting the critical section. +.. only:: esp32 + :ref:`floating-points`: The ESP32 supports hardware acceleration of single precision floating point arithmetic (``float``). However the use of hardware acceleration leads to some behavioral restrictions in ESP-IDF FreeRTOS. @@ -70,6 +72,9 @@ set in the project configuration (``idf.py menuconfig``) such as running ESP-IDF Unicore (single core) Mode, or configuring the number of Thread Local Storage Pointers each task will have. +It is not necessary to manually start the FreeRTOS scheduler by calling :cpp:func:`vTaskStartScheduler`. In ESP-IDF the +scheduler is started by the :doc:`startup` and is already running when the ``app_main`` function is called (see :ref:`app-main-task` for details). + .. _tasks-and-task-creation: Tasks and Task Creation diff --git a/docs/en/api-guides/memory-types.rst b/docs/en/api-guides/memory-types.rst index eaabe7d290..32e2298108 100644 --- a/docs/en/api-guides/memory-types.rst +++ b/docs/en/api-guides/memory-types.rst @@ -94,6 +94,7 @@ There are some possible issues with placement in IRAM, that may cause problems w Note that knowing which data should be marked with ``DRAM_ATTR`` can be hard, the compiler will sometimes recognize that a variable or expression is constant (even if it is not marked ``const``) and optimize it into flash, unless it is marked with ``DRAM_ATTR``. * GCC optimizations that automatically generate jump tables or switch/case lookup tables place these tables in flash. There are two possible ways to resolve this issue: + - Use a :doc:`linker script fragment ` to mark the entire source file as ``noflash`` - Pass specific flags to the compiler to disable these optimizations in the relevant source files. For CMake, place the following in the component CMakeLists.txt file: