mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Allow selection of different core for main task
Closes https://github.com/espressif/esp-idf/pull/6627
This commit is contained in:
parent
ffe5e45c77
commit
6928db7670
@ -15,11 +15,13 @@ if(NOT IDF_TARGET)
|
|||||||
"in by the parent build process.")
|
"in by the parent build process.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# A number of these components are implemented as config-only when built in the bootloader
|
||||||
set(COMPONENTS
|
set(COMPONENTS
|
||||||
bootloader
|
bootloader
|
||||||
esptool_py
|
esptool_py
|
||||||
esp_hw_support
|
esp_hw_support
|
||||||
esp_system
|
esp_system
|
||||||
|
freertos
|
||||||
hal
|
hal
|
||||||
partition_table
|
partition_table
|
||||||
soc
|
soc
|
||||||
|
@ -143,6 +143,29 @@ menu "ESP System Settings"
|
|||||||
which calls app_main(). If app_main() returns then this task is deleted
|
which calls app_main(). If app_main() returns then this task is deleted
|
||||||
and its stack memory is freed.
|
and its stack memory is freed.
|
||||||
|
|
||||||
|
choice ESP_MAIN_TASK_AFFINITY
|
||||||
|
prompt "Main task core affinity"
|
||||||
|
default ESP_MAIN_TASK_AFFINITY_CPU0
|
||||||
|
help
|
||||||
|
Configure the "main task" core affinity. This is the used core of the task
|
||||||
|
which calls app_main(). If app_main() returns then this task is deleted.
|
||||||
|
|
||||||
|
config ESP_MAIN_TASK_AFFINITY_CPU0
|
||||||
|
bool "CPU0"
|
||||||
|
config ESP_MAIN_TASK_AFFINITY_CPU1
|
||||||
|
bool "CPU1"
|
||||||
|
depends on !FREERTOS_UNICORE
|
||||||
|
config ESP_MAIN_TASK_AFFINITY_NO_AFFINITY
|
||||||
|
bool "No affinity"
|
||||||
|
|
||||||
|
endchoice
|
||||||
|
|
||||||
|
config ESP_MAIN_TASK_AFFINITY
|
||||||
|
hex
|
||||||
|
default 0x0 if ESP_MAIN_TASK_AFFINITY_CPU0
|
||||||
|
default 0x1 if ESP_MAIN_TASK_AFFINITY_CPU1
|
||||||
|
default FREERTOS_NO_AFFINITY if ESP_MAIN_TASK_AFFINITY_NO_AFFINITY
|
||||||
|
|
||||||
config ESP_MINIMAL_SHARED_STACK_SIZE
|
config ESP_MINIMAL_SHARED_STACK_SIZE
|
||||||
int "Minimal allowed size for shared stack"
|
int "Minimal allowed size for shared stack"
|
||||||
default 2048
|
default 2048
|
||||||
|
@ -55,5 +55,6 @@
|
|||||||
#define ESP_TASK_TCPIP_STACK (CONFIG_LWIP_TCPIP_TASK_STACK_SIZE + TASK_EXTRA_STACK_SIZE)
|
#define ESP_TASK_TCPIP_STACK (CONFIG_LWIP_TCPIP_TASK_STACK_SIZE + TASK_EXTRA_STACK_SIZE)
|
||||||
#define ESP_TASK_MAIN_PRIO (ESP_TASK_PRIO_MIN + 1)
|
#define ESP_TASK_MAIN_PRIO (ESP_TASK_PRIO_MIN + 1)
|
||||||
#define ESP_TASK_MAIN_STACK (CONFIG_ESP_MAIN_TASK_STACK_SIZE + TASK_EXTRA_STACK_SIZE)
|
#define ESP_TASK_MAIN_STACK (CONFIG_ESP_MAIN_TASK_STACK_SIZE + TASK_EXTRA_STACK_SIZE)
|
||||||
|
#define ESP_TASK_MAIN_CORE CONFIG_ESP_MAIN_TASK_AFFINITY
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -81,7 +81,7 @@ void esp_startup_start_app_common(void)
|
|||||||
|
|
||||||
portBASE_TYPE res = xTaskCreatePinnedToCore(&main_task, "main",
|
portBASE_TYPE res = xTaskCreatePinnedToCore(&main_task, "main",
|
||||||
ESP_TASK_MAIN_STACK, NULL,
|
ESP_TASK_MAIN_STACK, NULL,
|
||||||
ESP_TASK_MAIN_PRIO, NULL, 0);
|
ESP_TASK_MAIN_PRIO, NULL, ESP_TASK_MAIN_CORE);
|
||||||
assert(res == pdTRUE);
|
assert(res == pdTRUE);
|
||||||
(void)res;
|
(void)res;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user