Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
esp32c3_supermini: Fix: Switch from SRAM0 to SRAM1 to correct heap ca…
…lculations This resolves incorrect heap calculations in malloc_prepare() caused by using sram0. The calculation of ``` HEAP_SIZE = KB(CONFIG_SRAM_SIZE) - (HEAP_BASE - CONFIG_SRAM_BASE_ADDRESS) => 16kb - (0x3fc8d230 - 0x4037c000) => 7115kb ``` produces an invalid heap size. SRAM0 only supports IBUS addresses, whereas HEAP_BASE is derived from SRAM1's DBUS addresses, which are incompatible. Switching to SRAM1 corrects the calculation and ensures alignment with other ESP32C3 SoCs: ``` HEAP_SIZE = 384kb - (0x3fc8d1f0 - 0x3fc80000) => 331kb ``` Compiling basic/minimal with CONFIG_ASSERT=y would previously trigger the following assertion: ``` ASSERTION FAIL [bytes / 8U <= 0x7fffU] @ WEST_TOPDIR/zephyr/lib/heap/heap.c:491 heap size is too big ``` This change prevents that error. Signed-off-by: Raphael Zimmerer <[email protected]>
- Loading branch information