Skip to content
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

[ESP32] Backport Option to configure the pool allocation from heap on v1.3-branch. #35571

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions config/esp32/components/chip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,26 @@ menu "CHIP Core"
help
Option to enable/disable CHIP log level filtering APIs.

config CHIP_SYSTEM_CONFIG_POOL_USE_HEAP
bool "Use heap memory to allocate object pools"
default n
help
This option enables the use of heap memory to allocate object pools.
When enabled, object pools are not pre-allocated.
Additionally, the maximum number of entries that can be allocated is
only limited by the available heap memory.

This option can be useful if you encounter static DRAM overflow.

NOTE: Since there is no cap on pool sizes, this may lead to issues
where embedded code assumes the pool size is limited, and no other
mechanisms are in place to restrict the size of allocations.

NOTE: If enabled and the free heap is exhausted, this may result in
undefined behavior, potential non-compliance with specifications,
or failure during certification tests. Even if it passes, it may fail
to function properly with actual controllers.

endmenu # "General Options"

menu "Networking Options"
Expand Down
6 changes: 6 additions & 0 deletions src/platform/ESP32/CHIPPlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,9 @@
#ifndef CHIP_CONFIG_RMP_DEFAULT_MAX_RETRANS
#define CHIP_CONFIG_RMP_DEFAULT_MAX_RETRANS CONFIG_MRP_MAX_RETRANS
#endif // CHIP_CONFIG_RMP_DEFAULT_MAX_RETRANS

#ifdef CONFIG_CHIP_SYSTEM_CONFIG_POOL_USE_HEAP
#define CHIP_SYSTEM_CONFIG_POOL_USE_HEAP 1
#else
#define CHIP_SYSTEM_CONFIG_POOL_USE_HEAP 0
#endif
Loading