Merge branch 'fix/lp_wakeup_cause_bits_accumulation' into 'master'

fix(ulp): Fix accumulation of wakeup cause bits in ULP

Closes IDFGH-15115

See merge request espressif/esp-idf!38438
This commit is contained in:
Konstantin Kondrashov
2025-04-18 20:05:40 +08:00
2 changed files with 3 additions and 0 deletions

View File

@@ -18,6 +18,8 @@ extern "C" {
/** /**
* @brief Traverse all possible wake-up sources and update the wake-up cause so that * @brief Traverse all possible wake-up sources and update the wake-up cause so that
* ulp_lp_core_get_wakeup_cause can obtain the bitmap of the wake-up reasons. * ulp_lp_core_get_wakeup_cause can obtain the bitmap of the wake-up reasons.
* @note Do not call it from user ULP programs because it will clear the wake-up cause bits
* which were set at ULP startup in lp_core_startup().
*/ */
void ulp_lp_core_update_wakeup_cause(void); void ulp_lp_core_update_wakeup_cause(void);

View File

@@ -42,6 +42,7 @@ static uint32_t lp_wakeup_cause = 0;
void ulp_lp_core_update_wakeup_cause(void) void ulp_lp_core_update_wakeup_cause(void)
{ {
lp_wakeup_cause = 0;
if ((lp_core_ll_get_wakeup_source() & LP_CORE_LL_WAKEUP_SOURCE_HP_CPU) \ if ((lp_core_ll_get_wakeup_source() & LP_CORE_LL_WAKEUP_SOURCE_HP_CPU) \
&& (pmu_ll_lp_get_interrupt_raw(&PMU) & PMU_HP_SW_TRIGGER_INT_RAW)) { && (pmu_ll_lp_get_interrupt_raw(&PMU) & PMU_HP_SW_TRIGGER_INT_RAW)) {
lp_wakeup_cause |= LP_CORE_LL_WAKEUP_SOURCE_HP_CPU; lp_wakeup_cause |= LP_CORE_LL_WAKEUP_SOURCE_HP_CPU;