Merge branch 'feature/heap-in-flash' into 'master'

heap: Add a configuration that places all the heap component in flash

Closes IDF-7143 and IDF-2853

See merge request espressif/esp-idf!23050
This commit is contained in:
Guillaume Souchere
2023-04-13 14:38:15 +08:00
13 changed files with 134 additions and 100 deletions

View File

@@ -174,7 +174,7 @@ TEST_CASE("heap_caps metadata test", "[heap]")
/* Small function runs from IRAM to check that malloc/free/realloc
all work OK when cache is disabled...
*/
#ifndef CONFIG_ESP_SYSTEM_MEMPROT_FEATURE
#if !CONFIG_ESP_SYSTEM_MEMPROT_FEATURE && !CONFIG_HEAP_PLACE_FUNCTION_INTO_FLASH
static IRAM_ATTR __attribute__((noinline)) bool iram_malloc_test(void)
{
spi_flash_guard_get()->start(); // Disables flash cache

View File

@@ -19,6 +19,19 @@ def test_heap_poisoning(dut: Dut) -> None:
dut.run_all_single_board_cases()
@pytest.mark.generic
@pytest.mark.esp32
@pytest.mark.esp32c6
@pytest.mark.parametrize(
'config',
[
'in_flash'
]
)
def test_heap_in_flash(dut: Dut) -> None:
dut.run_all_single_board_cases()
@pytest.mark.generic
@pytest.mark.esp32
@pytest.mark.esp32s2

View File

@@ -0,0 +1,2 @@
CONFIG_HEAP_TLSF_USE_ROM_IMPL=n
CONFIG_HEAP_PLACE_FUNCTION_INTO_FLASH=y