Does putting the ESP32 into deep sleep "reset" the heap allocations? I basically scan for BLE devices every 5s or so, then if there's nothing to do I put it into deep sleep for X seconds.
I was either going to use vectors for performing work, or statically allocated buffers depending on if I should be concerned about heap fragmentation. I'm fairly new to MCU programming. Thanks!
Heap Fragmentation and Deep Sleep
Re: Heap Fragmentation and Deep Sleep
Coming out of deep sleep is basically like a cold boot with a few exceptions like rtc ram and wake stub. But if you want your app to resume you have to use light sleep.
-
- Posts: 9727
- Joined: Thu Nov 26, 2015 4:08 am
Re: Heap Fragmentation and Deep Sleep
That, or manually save whatever you need to save to RTC RAM.
Re: Heap Fragmentation and Deep Sleep
Does setting the option ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_OFF reset the RTC/ULP RAM when the ESP32 is put to sleep? That way I can put a vector into RTC RAM, and when there's nothing in RTC RAM I can occasionally use the above option to re-claim the heap on the RTC as well (I'll be adding/removing items on there every so often).
Re: Heap Fragmentation and Deep Sleep
No, the power domain of RTC data memory is ESP_PD_DOMAIN_RTC_SLOW_MEM.
Re: Heap Fragmentation and Deep Sleep
Thank you!
Who is online
Users browsing this forum: Bing [Bot] and 104 guests