Closed chegewara closed 6 years ago
Do you also have the BT stack enabled? What we need to consider is the overhead of:
I believe that each of these will "eat some heap" even before we get anywhere near our application logic. In the ESP32 Explorer Git master, we haven't enabled BT yet. If you wish, I can look at your driver and see if we can spot where heap usage can be relieved.
Yes, bt stack enabled with about 13kB stack setup in menuconfig.
It would be nice if you can look at it, cause i have no idea where to free some heap.
Here's something that might help .. I just finished adding this and will be committing in a few minutes:
This shows the FreeRTOS tasks running in the system and how much RAM is allocated to each for stack space.
This is the difference in free heap with and without BLEUtils measured in this line https://github.com/chegewara/ESP32_Explorer/blob/master/main/ESP32Explorer.cpp#L433:
D (3297) ESP32Explorer: 28204
D (3299) ESP32Explorer: 3952
Without BLEUtils i can scan for BLE devices. Its possible that some other tweaks in menuconfig also helps.
Just added sorting of the tasks in the table so that they are in alphabetic order.
Let's leave this issue open while we still have opportunities to free up memory. New fix coming now.
This one will give us north of 25K more. It is a fix in BLEUtils in ESP32-SNIPPETS. I'll log an issue there with details.
Still is small issue with ram/heap. When you try BLE functionality and then try to read GPIO then app crash. This issue cant be resolved until espressif devs resolve this https://github.com/espressif/esp-idf/issues/1162
I think i have resolved it in last PR, at least till we add more libraries/features.
Commentig those lines gives another 24kB+ https://github.com/nkolban/ESP32_Explorer/blob/master/main/ESP32Explorer.cpp#L526-L527
I think we have definitely ended with this issue.
Hi, there is too low heap to start webserver. Before web server starts heap is about 40kB, giving him stack about 20kB system crashes even before all path handlers are added, i have had to comment out 3 of them to run program.