How to shorten boot-up time after wake-up from Deep-Sleep ?

dalzan
Posts: 1
Joined: Mon Dec 05, 2022 5:15 pm

How to shorten boot-up time after wake-up from Deep-Sleep ?

Postby dalzan » Mon Dec 05, 2022 6:01 pm

Hi,
I have a custom board with module ESP32-S3-WROOM-1(N16R8).
My application is battery powered and simultaneously will be waken up frequently for short time.
So I need ESP to stay for most time in Deep-Sleep, and shorten the Run-time to minimum.

Currently the booting takes 96ms, I hoped I can reach <10ms.

I have already made following, that helped:
1) app_main() calls
esp_log_level_set("*", ESP_LOG_ERROR); // set all components to ERROR level

// for next wake-ups, no need for the booting debug messages
esp_deep_sleep_disable_rom_logging(); // suppress boot messages

2) in Menuconfig is set:
Bootloader config --->
Bootloader optimization Level: Optimize for performance (-O2)
Bootloader log verbosity: No output
[x] Skip image validation when exiting deep sleep

Component config --->
ESP32S3-Specific --->
[*] Support for external, SPI-connected RAM
SPI RAM config --->
[ ] Run memory test on SPI RAM initialization (i.e. disabled)

3) there follows list of things, that I tried and they had no effect:
- changed CPU freq from 160 to 240 MHz (it made difference maybe 1ms)
- config Boot ROM Behavior --->
Permanently change Boot ROM output: Permanently disable logging,
not possible, it caused it keeps self-resetting:
Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.
- config Serial flasher config --->
'idf.py monitor' baud rate (115200 bps) ---> 921600 bps
+ also changed in platformio.ini :
monitor_speed = 921600
- config Serial flasher config --->
Flash size: 16 MB
[ ] Detect flash size when flashing bootloader (i.e. disabled)
- config SPI RAM config --->
[ ] Initialize SPI RAM during startup (i.e. disabled)

4) what I can't do:
Flash must be (is) configured DIO, because setting Quad-IO causes crashing when ESP-IDF 4.4.2 is used.
Previous 4.4.1 was configured Quad, but I need 4.4.2 as it fixes some Reset when switching to Deep-Sleep.
So, not possible to speed-up Flash this way.

5) whatever I did, it still prints following log-messages on wake-up from Deep-Sleep, it probably wastes some time:
I (32) spi_flash: detected chip: gd
I (33) spi_flash: flash io: dio
I (83) sleep: Configure to isolate all GPIO pins in sleep state
I (84) sleep: Enable automatic switching of GPIO sleep configuration
I (86) cpu_start: Starting scheduler on PRO CPU.

Is there anything else that could shorten the boot-up time ?
Is there anything that could completely deactivate all boot-log messages ?

yehuda
Posts: 7
Joined: Sun Feb 14, 2021 10:31 am

Re: How to shorten boot-up time after wake-up from Deep-Sleep ?

Postby yehuda » Tue Apr 25, 2023 6:12 am

Hi,

Thank you for the list of option to reduce boot time.
I am using ESP32-C3 and SDK5:
- Permanently change Boot ROM output: Permanently disable logging - works fine, no output from ROM.
- setting Quad-IO - works fine, reduce few msec

maybe you can move to SDK5 and you can save few more msec...
how did you measure "Currently the booting takes 96ms"?
I can measure bootloader + app but I don't know when rom is starting after wakeup from deep sleep? (for me it is about 67msec for bootloader and app time from deep sleep (at CPU max speed 160Mhz )

Who is online

Users browsing this forum: No registered users and 51 guests