Deep Sleep or other power saving functions?
Re: Deep Sleep or other power saving functions?
I'm using the Rocket 32-Rev1 (silicon rev. 0)
It's strange You need some mods on the sparkfun board.
They claim 2.5µA current in deep sleep for this board.
It's strange You need some mods on the sparkfun board.
They claim 2.5µA current in deep sleep for this board.
- Attachments
-
- Rocket_32_X.jpg (147.4 KiB) Viewed 15455 times
Re: Deep Sleep or other power saving functions?
For ESP-WROOM32 this pullup is not needed because the flash chip is powered from ESP32's VDD_SDIO regulator. When ESP32 goes into deep sleep mode, this regulator is powered down.kostyan5 wrote:Just a heads up, many boards (including ESP32 WROOM, at least from the schematics available) do not have a pull-up on flash /CS line. This means that when the ESP32 goes to sleep and GPIO is turned off, the /CS line is floating. This prevents the flash from going to standby mode. For my custom board, the deep sleep power consumption dropped from 900uA to 65uA after adding a 100kOhm pullup on the /CS line.
If you power the flash chip from the same supply rail as the ESP32, you do need this pullup, and the software also has to send powerdown command to the flash chip before entering deep sleep.
Re: Deep Sleep or other power saving functions?
It seems to be working without the powerdown command? How necessary is that command and is there an API to do that?ESP_igrr wrote: you do need this pullup, and the software also has to send powerdown command to the flash chip before entering deep sleep.
Re: Deep Sleep or other power saving functions?
Depending on the flash chip specs, with powerdown you can get even lower current consumption.kostyan5 wrote:It seems to be working without the powerdown command? How necessary is that command and is there an API to do that?
There's no API for this since this hasn't been a very common requirement/feature. It's fairly trivial however. Here's a diff i have laying around, it may not apply directly to the latest code though:
Code: Select all
diff --git a/components/esp32/deep_sleep.c b/components/esp32/deep_sleep.c
index cedf482..d96b508 100644
--- a/components/esp32/deep_sleep.c
+++ b/components/esp32/deep_sleep.c
@@ -25,6 +25,7 @@
#include "soc/rtc_cntl_reg.h"
#include "soc/rtc_io_reg.h"
#include "soc/sens_reg.h"
+#include "soc/spi_reg.h"
#include "soc/dport_reg.h"
#include "driver/rtc_io.h"
#include "freertos/FreeRTOS.h"
@@ -110,6 +111,10 @@ void esp_deep_sleep(uint64_t time_in_us)
void IRAM_ATTR esp_deep_sleep_start()
{
+ if (esp_get_deep_sleep_wake_stub() == NULL) {
+ esp_set_deep_sleep_wake_stub(esp_wake_deep_sleep);
+ }
+
// Decide which power domains can be powered down
uint32_t pd_flags = get_power_down_flags();
@@ -133,15 +138,14 @@ void IRAM_ATTR esp_deep_sleep_start()
// TODO: move timer wakeup configuration into a similar function
// once rtc_sleep is opensourced.
+ WRITE_PERI_REG(SPI_CMD_REG(1), SPI_FLASH_DP_M);
+ while(READ_PERI_REG(SPI_CMD_REG(1))!=0);
+
// Flush UARTs so that output is not lost due to APB frequency change
uart_tx_wait_idle(0);
uart_tx_wait_idle(1);
uart_tx_wait_idle(2);
- if (esp_get_deep_sleep_wake_stub() == NULL) {
- esp_set_deep_sleep_wake_stub(esp_wake_deep_sleep);
- }
-
rtc_set_cpu_freq(RTC_CPU_FREQ_XTAL);
uint32_t cycle_h = 0;
uint32_t cycle_l = 0;
Re: Deep Sleep or other power saving functions?
I tried the deepsleep example on esp_wroom_32 module.The current consumption in deep sleep was about 280uA@3.3V.And I tried to pulled up the /CS and modifid the code according to the above code, the current consumption reduced to 210uA@3.3A, which is much higher than the 20uA in the offical document.I want to know how to modify the code(or hardware?) to get the similar results in offical document.Thanx!ESP_igrr wrote:Depending on the flash chip specs, with powerdown you can get even lower current consumption.kostyan5 wrote:It seems to be working without the powerdown command? How necessary is that command and is there an API to do that?
There's no API for this since this hasn't been a very common requirement/feature. It's fairly trivial however. Here's a diff i have laying around, it may not apply directly to the latest code though:
Code: Select all
diff --git a/components/esp32/deep_sleep.c b/components/esp32/deep_sleep.c index cedf482..d96b508 100644 --- a/components/esp32/deep_sleep.c +++ b/components/esp32/deep_sleep.c @@ -25,6 +25,7 @@ #include "soc/rtc_cntl_reg.h" #include "soc/rtc_io_reg.h" #include "soc/sens_reg.h" +#include "soc/spi_reg.h" #include "soc/dport_reg.h" #include "driver/rtc_io.h" #include "freertos/FreeRTOS.h" @@ -110,6 +111,10 @@ void esp_deep_sleep(uint64_t time_in_us) void IRAM_ATTR esp_deep_sleep_start() { + if (esp_get_deep_sleep_wake_stub() == NULL) { + esp_set_deep_sleep_wake_stub(esp_wake_deep_sleep); + } + // Decide which power domains can be powered down uint32_t pd_flags = get_power_down_flags(); @@ -133,15 +138,14 @@ void IRAM_ATTR esp_deep_sleep_start() // TODO: move timer wakeup configuration into a similar function // once rtc_sleep is opensourced. + WRITE_PERI_REG(SPI_CMD_REG(1), SPI_FLASH_DP_M); + while(READ_PERI_REG(SPI_CMD_REG(1))!=0); + // Flush UARTs so that output is not lost due to APB frequency change uart_tx_wait_idle(0); uart_tx_wait_idle(1); uart_tx_wait_idle(2); - if (esp_get_deep_sleep_wake_stub() == NULL) { - esp_set_deep_sleep_wake_stub(esp_wake_deep_sleep); - } - rtc_set_cpu_freq(RTC_CPU_FREQ_XTAL); uint32_t cycle_h = 0; uint32_t cycle_l = 0;
Re: Deep Sleep or other power saving functions?
Could you please describe the connections you have to the module and measurement method? WROOM32 should not need any software mods to achieve 5uA deep sleep current.
Re: Deep Sleep or other power saving functions?
@ESP_igrr Does the changes according to the Hardware Design Guidelines on CHIP EN
with the R10k and C100n apply to the WROOM32 too or I have to implement this separatelly
ie outside of the wroom32 module?
Regards,
Rick
with the R10k and C100n apply to the WROOM32 too or I have to implement this separatelly
ie outside of the wroom32 module?
Regards,
Rick
Re: Deep Sleep or other power saving functions?
Hi ESP_igrr,here is the the connections of the module and measurement method,now the current reduced to about 140uA@3.3V.Thanx!ESP_igrr wrote:Could you please describe the connections you have to the module and measurement method? WROOM32 should not need any software mods to achieve 5uA deep sleep current.
Re: Deep Sleep or other power saving functions?
@temp4eb Which silicon revision boards is this?
@all Anybody can confirm the power consumption of silicon revision 1?
Regards,
Rick
@all Anybody can confirm the power consumption of silicon revision 1?
Regards,
Rick
Re: Deep Sleep or other power saving functions?
It's the same as rev0: 5uA with the default configuration (RTC_FAST_MEM powered on). I have posted measurement results some time ago: https://esp32.com/viewtopic.php?f=2&t=1 ... t=10#p5473
temp4eb: Thanks for the photo... Could you please make a current measurement with CHIP_EN input pulled low?
temp4eb: Thanks for the photo... Could you please make a current measurement with CHIP_EN input pulled low?
Who is online
Users browsing this forum: No registered users and 56 guests