From 975a53aee1f0cb81db86bc7899e4b448253d26bd Mon Sep 17 00:00:00 2001 From: wuzhenghui Date: Tue, 28 Feb 2023 20:04:30 +0800 Subject: [PATCH] bugfix: workaround for CPU stuck due to DBUS request blocking when fetching unaligned instructions in LP_RAM --- components/esp_hw_support/sleep_wake_stub.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/esp_hw_support/sleep_wake_stub.c b/components/esp_hw_support/sleep_wake_stub.c index 7c49241ba9..ec8153fe8c 100644 --- a/components/esp_hw_support/sleep_wake_stub.c +++ b/components/esp_hw_support/sleep_wake_stub.c @@ -11,6 +11,7 @@ #include "esp_attr.h" #include "esp_sleep.h" +#include "esp_cpu.h" #include "soc/soc.h" #include "soc/rtc.h" @@ -77,7 +78,11 @@ void RTC_IRAM_ATTR esp_wake_stub_sleep(esp_deep_sleep_wake_stub_fn_t new_stub) #endif // A few CPU cycles may be necessary for the sleep to start... - while (true) {}; +#if __XTENSA__ + xt_utils_wait_for_intr(); +#else + rv_utils_wait_for_intr(); +#endif // __XTENSA__ // never reaches here. }