Closed
Description
Hardware:
Board: ESP32 Generic ?ESP32 Dev Module?
Core Installation/update date: 25/03/2018
IDE name: ?Arduino IDE?
Flash Frequency: ?80Mhz?
Upload Speed: ?115200?
Description:
I am calling rtc_clk_cpu_freq_set(RTC_CPU_FREQ_80M); in setup() just one time to adjust the cpu freq to 80Mhz . after deep sleep the frequency is back to 240? I thought the freq change will survive the deep sleep?
if I call the function each time the ESP wake up it hangs after several sleep periods, I think due to WDT reset as rtc_clk_cpu_freq_set consume a huge amount of time.
I have tried to yield() and put at delay(300) after the function call, it hang less but however it still hang sometimes.
Sketch:
//Change the code below by your sketch
#include <Arduino.h>
RTC_DATA_ATTR bool freqIsChanged= false;
void setup() {
if(! freqIsChanged){
rtc_clk_cpu_freq_set(RTC_CPU_FREQ_80M);
yield();
RTCdata.freqIsChanged = true;
}
Serial.begin(115200);
Serial.println();
Serial.println("Booted");
Serial.flush();
Serial.println(String(rtc_clk_cpu_freq_get()));
Serial.flush();
// do stuff
// Go to deep sleep
}
void loop() {
}
Debug Messages:
Enable Core debug level: Debug on tools menu of Arduino IDE, then put the serial output here