]> granicus.if.org Git - esp-idf/commitdiff
1. Change the deep sleep stub code to fix wake bug.
authorxiaxiaotian <xiaxiaotian@espressif.com>
Wed, 28 Sep 2016 03:52:39 +0000 (11:52 +0800)
committerxiaxiaotian <xiaxiaotian@espressif.com>
Wed, 28 Sep 2016 03:52:39 +0000 (11:52 +0800)
components/esp32/cpu_start.c
components/esp32/deepsleep.c
components/esp32/include/rom/rtc.h

index fb97cce47efd455f21e667c6c78c0e058bb70977..7b2ccdc609610a977f21657c0be9c45b110ab8f7 100644 (file)
@@ -42,7 +42,6 @@
 #include "esp_spi_flash.h"
 #include "esp_ipc.h"
 #include "esp_log.h"
-#include "esp_deepsleep.h"
 
 void start_cpu0(void) __attribute__((weak, alias("start_cpu0_default")));
 void start_cpu0_default(void) IRAM_ATTR;
index ee188c25dd6606d59816d7584acfe5d1604f9597..61268bce6bec3cc9f28a9e27973c8c729239ce3c 100644 (file)
@@ -7,6 +7,7 @@
 #include "rom/cache.h"
 #include "rom/rtc.h"
 #include "soc/rtc_cntl_reg.h"
+#include "soc/dport_reg.h"
 #include "esp_attr.h"
 #include "esp_deepsleep.h"
 
@@ -39,7 +40,10 @@ void esp_set_deep_sleep_wake_stub(esp_deep_sleep_wake_stub_fn_t new_stub)
 }
 
 void RTC_IRAM_ATTR esp_default_wake_deep_sleep(void) {
-    mmu_init(0);
+    //
+    //mmu_init(0);
+    REG_SET_BIT(DPORT_PRO_CACHE_CTRL1_REG, DPORT_PRO_CACHE_MMU_IA_CLR);
+    REG_CLR_BIT(DPORT_PRO_CACHE_CTRL1_REG, DPORT_PRO_CACHE_MMU_IA_CLR);
 }
 
 void __attribute__((weak, alias("esp_default_wake_deep_sleep"))) esp_wake_deep_sleep(void);
index 665b97c8ea455e3d7a7b6ddc729b53811d517256..9577119f5cffceb93ada50cf43ff4eee8eeb842b 100644 (file)
@@ -161,7 +161,7 @@ WAKEUP_REASON rtc_get_wakeup_cause(void);
   *
   * @param  uint32_t start_addr : 0 - 0x7ff for Fast RTC Memory.
   *
-  * @param  uint32_t crc_len : 0 - 0x7ff, 0 for 1 byte, 0x7ff for 0x800 byte.
+  * @param  uint32_t crc_len : 0 - 0x7ff, 0 for 4 byte, 0x7ff for 0x2000 byte.
   *
   * @return uint32_t : CRC32 result
   */