-
Notifications
You must be signed in to change notification settings - Fork 7.4k
soc:esp32: Add config allow MbedTLS heap and LVGL Frambuffer use SPI RAM #86049
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
2ff3af8
to
bb383f7
Compare
@phb98: |
Hi @sylvioalves, Do you know how can i change the author, i've edited my commit message but looklike it doesn't fix it. |
|
bb383f7
to
aa1ac98
Compare
soc/espressif/common/Kconfig.spiram
Outdated
@@ -140,6 +140,24 @@ config SPIRAM_ECC_ENABLE | |||
Enable MSPI Error-Correcting Code function when accessing SPIRAM. | |||
If enabled, 1/16 of the SPI RAM total size will be reserved for error-correcting code. | |||
|
|||
config ESP_SPIRAM_ALLOC_MBED_HEAP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep in mind the naming here. Another configuration about SPIRAM allocation uses different naming conventions: CONFIG_ESP32_WIFI_NET_ALLOC_SPIRAM
.
Maybe using CONFIG_ESP_MBED_HEAP_ALLOC_SPIRAM
and CONFIG_ESP_LVGL_FRAMEBUFFER_ALLOC_SPIRAM
would be closer to the current configuration. The other option is to change the current one. The worst is having different naming conventions for the same thing in the same company devices (Espressif).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. In fact, please use MBEDTLS
complete name: CONFIG_ESP_MBEDTLS_HEAP_ALLOC_SPIRAM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay i've renamed 2 Kconfig symbols.
1ef1801
to
02da51b
Compare
- Add KConfig ESP_MBEDTLS_HEAP_ALLOC_SPIRAM to allow MbedTLS heap use SPI RAM Signed-off-by: bac phan <phanhaibac98@gmail.com>
- Add KConfig ESP_LVGL_FRAMEBUFFER_ALLOC_SPIRAM to allow LVGL framebuffer use SPI RAM Signed-off-by: bac phan <phanhaibac98@gmail.com>
02da51b
to
b1b0985
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be backwards: not sure hardcoding things at ESP32 level really scales when new memory hungry subsystems appear, nor that it benefits other platforms facing the exact same issue.
Please look at shared multiheap and how video subsystem can be configured to use a preferred "type" of memory (e.g. SMH_REG_ATTR_EXTERNAL). You'll probably want to look at doing something similar to extend the available LV_Z_MEMORY_POOL options, same for mbedtls
I will let @LucasTambor confirm I'm not suggesting something that's too stupid though :) |
Hi @kartben 1: We have config 2: Currently on espressif platform, we are very close to running out of ram (At least that's what I see from Discord). Enable some basic stuff like Mbedtls and wifi, with reasonable heap and stack config, already use around 80%-85% the internal ram, making using LVGL or other subsystem like Bluetooth is quite impossible. Imo relieving the internal ram is quite needed right now. 3: At this moment this does not scale well on other subsytem. But I saw that share multi heap is treating every external ram on different platforms similarly (only 1 enum |
Hi @kartben , do you find anything else need to be addressed ? |
@phb98 Were you able to test this change properly? At first look I see no problem in placing the MbedTLS and LVGL framebuffer into |
depends on ESP_SPIRAM | ||
depends on MBEDTLS_ENABLE_HEAP | ||
select MBEDTLS_HEAP_CUSTOM_SECTION | ||
default n |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for default n
. N is already the default value ;)
depends on ESP_SPIRAM | ||
depends on LV_Z_BUFFER_ALLOC_STATIC | ||
select LV_Z_VDB_CUSTOM_SECTION | ||
default n |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
hey @phb98, MbedTLS and LVGL are good examples of subsystems with extensive memory usage, but there could be more such subsystems. With that said, wouldn't be using |
Add 2 follow Config Symbol: ESP_MBEDTLS_HEAP_ALLOC_SPIRAM and ESP_LVGL_FRAMEBUFFER_ALLOC_SPIRAM to allow user place heavy-ram usage mbedtls heap and lvgl frame buffer to SPI ram.
Tested with HTTP_get sample, with TLS enable.
Have not tested with LVGL yet, i have no LCD for now. Only sure it can compile with config enable
This is a replacement PR of #85979 because somehow i messed up my git repo :(