From 1ca25688a868dbf4cda580266397925cfa73ef7a Mon Sep 17 00:00:00 2001 From: michael Date: Fri, 10 Apr 2020 14:39:32 +0800 Subject: [PATCH] freertos: place `xQueueGenericCreateStatic` into flash `xQueueGenericCreateStatic` is placed into flash by the linker script to reduce IRAM usage. This will also cause the `xRingbufferCreate` not not callable when cache is disabled. --- components/esp_ringbuf/test/test_ringbuf.c | 2 +- components/freertos/linker.lf | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/components/esp_ringbuf/test/test_ringbuf.c b/components/esp_ringbuf/test/test_ringbuf.c index 7e6f441af4..020afa2d13 100644 --- a/components/esp_ringbuf/test/test_ringbuf.c +++ b/components/esp_ringbuf/test/test_ringbuf.c @@ -673,9 +673,9 @@ static IRAM_ATTR __attribute__((noinline)) bool iram_ringbuf_test(void) { bool result = true; - spi_flash_guard_get()->start(); // Disables flash cache RingbufHandle_t handle = xRingbufferCreate(CONT_DATA_TEST_BUFF_LEN, RINGBUF_TYPE_NOSPLIT); result = result && (handle != NULL); + spi_flash_guard_get()->start(); // Disables flash cache xRingbufferGetMaxItemSize(handle); vRingbufferDelete(handle); spi_flash_guard_get()->end(); // Re-enables flash cache diff --git a/components/freertos/linker.lf b/components/freertos/linker.lf index a2275ecd62..0917c52171 100644 --- a/components/freertos/linker.lf +++ b/components/freertos/linker.lf @@ -2,4 +2,5 @@ archive: libfreertos.a entries: * (noflash_text) + queue:xQueueGenericCreateStatic (default)