Skip to content

Commit 7b740b5

Browse files
shubhamdpshripad621git
authored andcommitted
[ESP32] Option to configure the pool allocation from heap (#30764)
* [ESP32] Option to configure the system buffer pool allocation from heap * address reviews * minor adjustment to help text * some minor adjustments * Add notes regarding expected failures
1 parent 82748b9 commit 7b740b5

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

config/esp32/components/chip/Kconfig

+20
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,26 @@ menu "CHIP Core"
157157
help
158158
Option to enable/disable CHIP log level filtering APIs.
159159

160+
config CHIP_SYSTEM_CONFIG_POOL_USE_HEAP
161+
bool "Use heap memory to allocate object pools"
162+
default n
163+
help
164+
This option enables the use of heap memory to allocate object pools.
165+
When enabled, object pools are not pre-allocated.
166+
Additionally, the maximum number of entries that can be allocated is
167+
only limited by the available heap memory.
168+
169+
This option can be useful if you encounter static DRAM overflow.
170+
171+
NOTE: Since there is no cap on pool sizes, this may lead to issues
172+
where embedded code assumes the pool size is limited, and no other
173+
mechanisms are in place to restrict the size of allocations.
174+
175+
NOTE: If enabled and the free heap is exhausted, this may result in
176+
undefined behavior, potential non-compliance with specifications,
177+
or failure during certification tests. Even if it passes, it may fail
178+
to function properly with actual controllers.
179+
160180
endmenu # "General Options"
161181

162182
menu "Networking Options"

src/platform/ESP32/CHIPPlatformConfig.h

+6
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,9 @@
133133
#ifndef CHIP_CONFIG_RMP_DEFAULT_MAX_RETRANS
134134
#define CHIP_CONFIG_RMP_DEFAULT_MAX_RETRANS CONFIG_MRP_MAX_RETRANS
135135
#endif // CHIP_CONFIG_RMP_DEFAULT_MAX_RETRANS
136+
137+
#ifdef CONFIG_CHIP_SYSTEM_CONFIG_POOL_USE_HEAP
138+
#define CHIP_SYSTEM_CONFIG_POOL_USE_HEAP 1
139+
#else
140+
#define CHIP_SYSTEM_CONFIG_POOL_USE_HEAP 0
141+
#endif

0 commit comments

Comments
 (0)