Skip to content

Commit 2f37e01

Browse files
shubhamdpshgutte
authored andcommitted
[ESP32] Option to configure the pool allocation from heap (project-chip#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 6cf976d commit 2f37e01

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
@@ -163,6 +163,26 @@ menu "CHIP Core"
163163
help
164164
Option to enable/disable CHIP data model.
165165

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

168188
menu "Networking Options"

src/platform/ESP32/CHIPPlatformConfig.h

+6
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,9 @@
146146
#ifndef CHIP_CONFIG_RMP_DEFAULT_MAX_RETRANS
147147
#define CHIP_CONFIG_RMP_DEFAULT_MAX_RETRANS CONFIG_MRP_MAX_RETRANS
148148
#endif // CHIP_CONFIG_RMP_DEFAULT_MAX_RETRANS
149+
150+
#ifdef CONFIG_CHIP_SYSTEM_CONFIG_POOL_USE_HEAP
151+
#define CHIP_SYSTEM_CONFIG_POOL_USE_HEAP 1
152+
#else
153+
#define CHIP_SYSTEM_CONFIG_POOL_USE_HEAP 0
154+
#endif

0 commit comments

Comments
 (0)