void esp_startup_start_app(void) { #if CONFIG_ESP_INT_WDT esp_int_wdt_init(); // Initialize the interrupt watch dog for CPU0. esp_int_wdt_cpu_init(); #elif CONFIG_ESP32_ECO3_CACHE_LOCK_FIX // If the INT WDT isn't enabled on ESP32 ECO3, issue an error regarding the cache lock bug assert(!soc_has_cache_lock_bug() && "ESP32 Rev 3 + Dual Core + PSRAM requires INT WDT enabled in project config!"); #endif
// Initialize the cross-core interrupt on CPU0 esp_crosscore_int_init();
/* If a particular FreeRTOS port has port/arch specific OS startup behavior, they can implement a function of type "void port_start_app_hook(void)" in their `port.c` files. This function will be called below, thus allowing each FreeRTOS port to implement port specific app startup behavior. */ void __attribute__((weak)) port_start_app_hook(void); if (port_start_app_hook != NULL) { port_start_app_hook(); }
ESP_EARLY_LOGI(APP_START_TAG, "Starting scheduler on CPU0"); vTaskStartScheduler(); }
// Initialize core components and services. do_core_init();
// Execute constructors. do_global_ctors();
// Execute init functions of other components; blocks // until all cores finish (when !CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE). do_secondary_init();
// Now that the application is about to start, disable boot watchdog #ifndef CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE wdt_hal_context_t rtc_wdt_ctx = RWDT_HAL_CONTEXT_DEFAULT(); wdt_hal_write_protect_disable(&rtc_wdt_ctx); wdt_hal_disable(&rtc_wdt_ctx); wdt_hal_write_protect_enable(&rtc_wdt_ctx); #endif