deep sleep and start time

ry1234
Posts: 9
Joined: Sun Dec 18, 2016 6:15 pm

deep sleep and start time

Postby ry1234 » Sun Dec 18, 2016 6:21 pm

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

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: deep sleep and start time

Postby ESP_igrr » Sun Dec 18, 2016 8:35 pm

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.

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: deep sleep and start time

Postby ESP_Angus » Mon Dec 19, 2016 3:23 am

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.

Who is online

Users browsing this forum: No registered users and 139 guests