Wake up after deep sleep
-
- Posts: 5
- Joined: Wed Feb 19, 2020 7:33 am
Wake up after deep sleep
Hi, I am new to esp32.
In the last two days I have tried to run different types of code and I have focused on how deep-sleep works that I can't understand. Is it normal that when the device wakes up it goes into the bootloader? Is it possible to avoid the bootloader and on wake up to resume the code from where it went in deep-sleep? I ask this because I notice that it takes about 300ms for the bootloader each time it wakes up and this is not good for the kind of purpose for which I am using esp32.
I await your news regarding the precise functioning of deep-sleep and wake up. Also because I could not find any information about this behavior.
Aleks.
In the last two days I have tried to run different types of code and I have focused on how deep-sleep works that I can't understand. Is it normal that when the device wakes up it goes into the bootloader? Is it possible to avoid the bootloader and on wake up to resume the code from where it went in deep-sleep? I ask this because I notice that it takes about 300ms for the bootloader each time it wakes up and this is not good for the kind of purpose for which I am using esp32.
I await your news regarding the precise functioning of deep-sleep and wake up. Also because I could not find any information about this behavior.
Aleks.
Re: Wake up after deep sleep
Only light sleep can resume
-
- Posts: 5
- Joined: Wed Feb 19, 2020 7:33 am
Re: Wake up after deep sleep
After I tried light sleep I realized that it resumes the code from the point where the device goes to sleep.
Thx.
Thx.
Re: Wake up after deep sleep
If you're using IDF v4 you can try CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP for significantly faster wakeup.
-
- Posts: 5
- Joined: Wed Feb 19, 2020 7:33 am
Re: Wake up after deep sleep
I can't understand then what the deep-sleep mode is for if every time the device wakes up it has to bootloader.
Re: Wake up after deep sleep
To use the least current, you have to shut everything down. If you can sleep for long periods then you will happily trade the wakeup time for the power savings.aleksboshnakov wrote: ↑Thu Feb 20, 2020 7:49 amI can't understand then what the deep-sleep mode is for if every time the device wakes up it has to bootloader.
-
- Posts: 211
- Joined: Fri Feb 01, 2019 4:02 pm
- Contact:
Re: Wake up after deep sleep
Hello @aleksboshnakov,
I just found your message but later. Want to add something to this discussion. When the chip starts the boot loader take place but you can start your code that can check some conditions and then continue to sleep or wake up after timeout or pin state change and load software normally on specific condition. This would significantly decrease power consumption and allows to use your logic after power up. This user code is called wake stub, please refer:
https://docs.espressif.com/projects/esp ... -stub.html
Let me know if you need more information.
I just found your message but later. Want to add something to this discussion. When the chip starts the boot loader take place but you can start your code that can check some conditions and then continue to sleep or wake up after timeout or pin state change and load software normally on specific condition. This would significantly decrease power consumption and allows to use your logic after power up. This user code is called wake stub, please refer:
https://docs.espressif.com/projects/esp ... -stub.html
Let me know if you need more information.
-
- Posts: 5
- Joined: Wed Feb 19, 2020 7:33 am
Re: Wake up after deep sleep
Hello,ESP_alisitsyn wrote: ↑Thu Feb 11, 2021 8:01 amHello @aleksboshnakov,
I just found your message but later. Want to add something to this discussion. When the chip starts the boot loader take place but you can start your code that can check some conditions and then continue to sleep or wake up after timeout or pin state change and load software normally on specific condition. This would significantly decrease power consumption and allows to use your logic after power up. This user code is called wake stub, please refer:
https://docs.espressif.com/projects/esp ... -stub.html
Let me know if you need more information.
It's an interesting feature, but it's not for me. My problem is that as soon as possible I should wake up from deep sleep. By changing some configuration within "sdkconfig" I managed to decrease it to about 150ms but that's still a lot for what I should be doing.
Re: Wake up after deep sleep
Did you try the option I mentioned above? Is GPIO low on power on (or esp_rom_disable_logging)? Bootloader logging as minimal as acceptable?aleksboshnakov wrote: I managed to decrease it to about 150ms but that's still a lot for what I should be doing.
I think a typical application with all optimisations should be able to do sleep->app_main in about 20-25ms; the lowest I've seen is 15ms.
-
- Posts: 5
- Joined: Wed Feb 19, 2020 7:33 am
Re: Wake up after deep sleep
Which GPIO are you referring to?boarchuz wrote: ↑Wed Mar 10, 2021 9:13 amDid you try the option I mentioned above? Is GPIO low on power on (or esp_rom_disable_logging)? Bootloader logging as minimal as acceptable?aleksboshnakov wrote: I managed to decrease it to about 150ms but that's still a lot for what I should be doing.
I think a typical application with all optimisations should be able to do sleep->app_main in about 20-25ms; the lowest I've seen is 15ms.
For now I have disabled image verification using
Code: Select all
bootloader_load_image_no_verify()
Code: Select all
memset(start, FREE_FILL_PATTERN, size)
Who is online
Users browsing this forum: kaxx1975 and 92 guests