forked from espressif/esp-idf
Merge branch 'bugfix/main_task_on_cpu1_startup_failure_v4.3' into 'release/v4.3'
freertos: Fix issue with bootup failure in ESP_MAIN_TASK_AFFINITY_CPU1 config (v4.3) See merge request espressif/esp-idf!18936
This commit is contained in:
@@ -87,10 +87,10 @@ void esp_startup_start_app_common(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if !CONFIG_FREERTOS_UNICORE
|
#if !CONFIG_FREERTOS_UNICORE
|
||||||
static volatile bool s_app_cpu_startup_done = false;
|
static volatile bool s_other_cpu_startup_done = false;
|
||||||
static bool s_app_cpu_startup_idle_hook_cb(void)
|
static bool other_cpu_startup_idle_hook_cb(void)
|
||||||
{
|
{
|
||||||
s_app_cpu_startup_done = true;
|
s_other_cpu_startup_done = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -98,12 +98,12 @@ static bool s_app_cpu_startup_idle_hook_cb(void)
|
|||||||
static void main_task(void* args)
|
static void main_task(void* args)
|
||||||
{
|
{
|
||||||
#if !CONFIG_FREERTOS_UNICORE
|
#if !CONFIG_FREERTOS_UNICORE
|
||||||
// Wait for FreeRTOS initialization to finish on APP CPU, before replacing its startup stack
|
// Wait for FreeRTOS initialization to finish on other core, before replacing its startup stack
|
||||||
esp_register_freertos_idle_hook_for_cpu(s_app_cpu_startup_idle_hook_cb, 1);
|
esp_register_freertos_idle_hook_for_cpu(other_cpu_startup_idle_hook_cb, !xPortGetCoreID());
|
||||||
while (!s_app_cpu_startup_done) {
|
while (!s_other_cpu_startup_done) {
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
esp_deregister_freertos_idle_hook_for_cpu(s_app_cpu_startup_idle_hook_cb, 1);
|
esp_deregister_freertos_idle_hook_for_cpu(other_cpu_startup_idle_hook_cb, !xPortGetCoreID());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// [refactor-todo] check if there is a way to move the following block to esp_system startup
|
// [refactor-todo] check if there is a way to move the following block to esp_system startup
|
||||||
|
Reference in New Issue
Block a user