Page 1 of 1

deep sleep and start time

Posted: Sun Dec 18, 2016 6:21 pm
by ry1234
Hi,

A few questions about the time it should take to go back to running code after ESP32 is in deep sleep -

- Is it correct that every time ESP32 recovers from deep sleep, the image has to be copied from flash to RAM (meaning, code is not executed directly from flash)?

- If so, how long does it take to copy an image of a certain size from flash to RAM?

- Are there any measurements available for this time (deep sleep to active mode)?


Thanks

Re: deep sleep and start time

Posted: Sun Dec 18, 2016 8:35 pm
by ESP_igrr
1) part of the code which is executed from RAM is copied from flash to RAM, along with .data segment (non-zero-initialized data).

2, 3) i don't think we have these measurements (this time would depend on the application being loaded), but if i will be doing something related to deep sleep I will measure this with one of the examples.

Re: deep sleep and start time

Posted: Mon Dec 19, 2016 3:23 am
by ESP_Angus
To add to Ivan's answer, if you have code that you want to run ASAP after wake from deep sleep, this can be accomplished using the deep sleep wake stub:
http://esp-idf.readthedocs.io/en/latest ... -stub.html

There are lot of limitations on code run in this way, but it will run much faster after wake than the full esp-idf system - so it can be used to take immediate readings, decide if the full system should be resumed, etc.