diff --git a/components/ulp/lp_core/lp_core.c b/components/ulp/lp_core/lp_core.c index 918585e6341..bd63e715793 100644 --- a/components/ulp/lp_core/lp_core.c +++ b/components/ulp/lp_core/lp_core.c @@ -165,16 +165,9 @@ esp_err_t ulp_lp_core_run(ulp_lp_core_cfg_t* cfg) lp_core_ll_rst_at_sleep_enable(true); #endif - /* Set wake-up sources */ - lp_core_ll_set_wakeup_source(lp_core_get_wakeup_source_hw_flags(cfg->wakeup_source)); - /* Enable JTAG debugging */ lp_core_ll_debug_module_enable(true); - if (cfg->wakeup_source & ULP_LP_CORE_WAKEUP_SOURCE_HP_CPU) { - lp_core_ll_hp_wake_lp(); - } - #if SOC_ULP_LP_UART_SUPPORTED if (cfg->wakeup_source & ULP_LP_CORE_WAKEUP_SOURCE_LP_UART) { lp_core_ll_enable_lp_uart_wakeup(true); @@ -196,6 +189,13 @@ esp_err_t ulp_lp_core_run(ulp_lp_core_cfg_t* cfg) } #endif + /* Set wake-up sources */ + lp_core_ll_set_wakeup_source(lp_core_get_wakeup_source_hw_flags(cfg->wakeup_source)); + + if (cfg->wakeup_source & ULP_LP_CORE_WAKEUP_SOURCE_HP_CPU) { + lp_core_ll_hp_wake_lp(); + } + return ESP_OK; }