kopia lustrzana https://github.com/espressif/esp-idf
Merge branch 'bugfix/psram_startup_crash_v4.4' into 'release/v4.4'
psram: Fix startup crash when `CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0` (v4.4) See merge request espressif/esp-idf!18500pull/9239/head
commit
b38ba40d4b
|
@ -19,6 +19,7 @@
|
|||
#include "soc/soc_memory_types.h"
|
||||
#include "soc/dport_access.h"
|
||||
#include "sdkconfig.h"
|
||||
#include "esp_freertos_hooks.h"
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
#include "esp32/spiram.h"
|
||||
|
@ -81,13 +82,24 @@ void esp_startup_start_app_common(void)
|
|||
(void)res;
|
||||
}
|
||||
|
||||
#if !CONFIG_FREERTOS_UNICORE
|
||||
static volatile bool s_app_cpu_startup_done = false;
|
||||
static bool s_app_cpu_startup_idle_hook_cb(void)
|
||||
{
|
||||
s_app_cpu_startup_done = true;
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void main_task(void* args)
|
||||
{
|
||||
#if !CONFIG_FREERTOS_UNICORE
|
||||
// Wait for FreeRTOS initialization to finish on APP CPU, before replacing its startup stack
|
||||
while (port_xSchedulerRunning[1] == 0) {
|
||||
esp_register_freertos_idle_hook_for_cpu(s_app_cpu_startup_idle_hook_cb, 1);
|
||||
while (!s_app_cpu_startup_done) {
|
||||
;
|
||||
}
|
||||
esp_deregister_freertos_idle_hook_for_cpu(s_app_cpu_startup_idle_hook_cb, 1);
|
||||
#endif
|
||||
|
||||
// [refactor-todo] check if there is a way to move the following block to esp_system startup
|
||||
|
|
Ładowanie…
Reference in New Issue