EasyManuals Logo

Espressif ESP32-S2 User Manual

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #862 background imageLoading...
Page #862 background image
Chapter 2. API Reference
For more information about the SMP changes of ESP-IDF FreeRTOS, see ESP-IDF FreeRTOS (SMP)
For more information about the features added to ESP-IDF FreeRTOS, see FreeRTOS Additions.
Configuration
Vanilla FreeRTOS allows ports and applications to configure the kernel by adding various #define config...
macros to FreeRTOSConfig.h. Through these macros, the kernels scheduling behavior and various kernel
features can be enabled or disabled. However, in ESP-IDF FreeRTOS, the ``FreeRTOSConfig.h`` file is con-
sidered a private and must not be modified by users. Any FreeRTOS configuration that is exposed to the user
will be done so via menuconfig.
ESP-IDF FreeRTOS can be configured in the project configuration menu (idf.py menuconfig) under Com-
ponent Config/FreeRTOS. The following section highlights some of the ESP-IDF FreeRTOS configuration
options. For a full list of ESP-IDF FreeRTOS configurations, see Project Configuration
CONFIG_FREERTOS_UNICORE will run ESP-IDF FreeRTOS only on CPU0. Note that this is not equiv-
alent to running Vanilla FreeRTOS. Futhermore, this option may affect behavior of components other
than freertos. For more details regarding the effects of running ESP-IDF FreeRTOS on a single core,
refer to ESP-IDF FreeRTOS Single Core. Alternatively, users can also search for occurrences of CON-
FIG_FREERTOS_UNICORE in the ESP-IDF components.
CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION will trigger a halt in functions in ESP-IDF
FreeRTOS that have not been fully tested in an SMP context.
CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER will enclose all task functions within a wrapper function.
In the case that a task function mistakenly returns (i.e. does not call vTaskDelete()), the call flow will
return to the wrapper function. The wrapper function will then log an error and abort the application, as
illustrated below:
E (25) FreeRTOS: FreeRTOS task should not return. Aborting now!
abort() was called at PC 0x40085c53 on core 0
Note: As ESP32-S2 is a single core SoC, the CONFIG_FREERTOS_UNICORE configuration is always set.
ESP-IDF FreeRTOS Applications
Unlike Vanilla FreeRTOS, users must not call vTaskStartScheduler(). Instead, ESP-IDF FreeRTOS is
started automatically. The entry point is a user defined void app_main(void) function.
Typically, users would spawn the rest of their applications task from app_main.
The app_main function is allowed to return at any point (i.e., before the application terminates).
The app_main function is called from the main task.
The main task is one of multiple tasks that are automatically spawned by ESP-IDF during startup. These tasks are:
Table 13: List of Tasks Created During Startup
Task Name Affinity PriorityDescription
Main Task (main) CPU0 1 Task that simply calls app_main. This task will
self delete when app_main returns
Idle Tasks (IDLEx) CPU0 and CPU1 0 Idle task created for (and pinned to) each CPU
Task API
Header File
components/freertos/include/freertos/task.h
Espressif Systems 851
Submit Document Feedback
Release v4.4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Espressif ESP32-S2 and is the answer not in the manual?

Espressif ESP32-S2 Specifications

General IconGeneral
BrandEspressif
ModelESP32-S2
CategorySingle board computers
LanguageEnglish