Otherwise it seems to work great.
This code is working fine for rtc external crystal selection, without building esp-idf library for arduino. Could you please confirm that it is working with your hardware setup, Or any mistake in this.
Something to be aware of: [...] My newer boards built with ESP32 r3 *require* a parallel R (2-10M) and won't start without it; they work best (closest to nominal freq) with 6pF or slightly lower load caps.
@xerom32, @dovov97815, @dalbert, could You please share also your IDE config with Arduino Core version used?
I've a esp32-wroom-32e with 32.768k 12.5pF crystal, two 22pF caps and parallel 10M resistor and can't get it running.
I'm using the 3.0.4 Arduino core so I need to slightly modify dovov97815 code by changing the include from #include "esp_deep_sleep.h" to #include "esp_sleep.h" and also the function esp_deep_sleep_pd_config to esp_sleep_pd_config but it should not influence the clock running.
I get the following logs:
Code: Select all
ets Jul 29 2019 12:21:46
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:1448
load:0x40078000,len:14828
ho 0 tail 12 room 4
load:0x40080400,len:4
load:0x40080404,len:3356
entry 0x4008059c
Boot number: 1
Wakeup was not caused by deep sleep: 0
Slow clk source: Internal 150kHz
First boot, bootstrap and enable 32k XTAL
Fast Clk: 40MHz
RTC_CAL_32K_XTAL:
calibrate (0): inf kHz
calibrate (1): inf kHz
calibrate (2): inf kHz
calibrate (3): inf kHz
calibrate (4): inf kHz
Waiting for 32kHz clock to be stable: inf kHz
[..........................]
[several time as above and finally...]
OSC Not Enabled, using Internal 150KHz RC
Slow clk source: Internal 150kHz
Setup ESP32 to sleep for every 5 Seconds
Configured peripheral power
Going to sleep now, rtc ticks: 2633970
ets Jul 29 2019 12:21:46
rst:0x5 (DEEPSLEEP_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:1448
load:0x40078000,len:14828
ho 0 tail 12 room 4
load:0x40080400,len:4
load:0x40080404,len:3356
entry 0x4008059c
Boot number: 2
Wakeup caused by timer
Slow clk source: Internal 150kHz
Wake from deepsleep, not jumping XTAL.
rtc sleep reg0: 3422140
rtc sleep reg1: 0
Setup ESP32 to sleep for every 5 Seconds
Configured peripheral power
Going to sleep now, rtc ticks: 3519912
E (687) rtc_time: 32kHz xtal has been stopped
ets Jul 29 2019 12:21:46
rst:0x8 (TG1WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:1448
load:0x40078000,len:14828
ho 0 tail 12 room 4
load:0x40080400,len:4
load:0x40080404,len:3356
entry 0x4008059c
ets Jul 29 2019 12:21:46
Can anyone give me some tips what's going on? Thanks in advance!