From 8d767407ff3c6e1dd51689ef14b6597718a08357 Mon Sep 17 00:00:00 2001 From: kyz Date: Wed, 21 Oct 2026 21:13:18 +0800 Subject: [PATCH] modify freertos heap size --- Linker_Scatter_File/SWM34S_NoLink_SPI_Flash.sct | 4 ++-- Middleware/FreeRTOS-Kernel/FreeRTOSConfig.h | 2 +- Middleware/FreeRTOS-Kernel/portable/MemMang/heap_4.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Linker_Scatter_File/SWM34S_NoLink_SPI_Flash.sct b/Linker_Scatter_File/SWM34S_NoLink_SPI_Flash.sct index 4b1e480..8d8a2db 100644 --- a/Linker_Scatter_File/SWM34S_NoLink_SPI_Flash.sct +++ b/Linker_Scatter_File/SWM34S_NoLink_SPI_Flash.sct @@ -18,9 +18,9 @@ LR_IROM1 0x00000000 0x00080000 { ; load region size_region } RW_IRAM1 0x20000000 0x00010000 { ; RW data .ANY (+RW +ZI) - *(.SRAM) + ;*(.SRAM) } - RW_SDRAM1 0x80000000 0x00800000 { ; RW data + RW_SDRAM1 0x80400000 0x00400000 { ; RW data *(.SDRAM1) } ; 0x00200000 diff --git a/Middleware/FreeRTOS-Kernel/FreeRTOSConfig.h b/Middleware/FreeRTOS-Kernel/FreeRTOSConfig.h index 17ba8ff..d668019 100644 --- a/Middleware/FreeRTOS-Kernel/FreeRTOSConfig.h +++ b/Middleware/FreeRTOS-Kernel/FreeRTOSConfig.h @@ -64,7 +64,7 @@ extern uint32_t SystemCoreClock; #define configMINIMAL_STACK_SIZE ( ( uint16_t ) 128 ) #define configMINIMAL_SECURE_STACK_SIZE ( 1024 ) #define configMAX_TASK_NAME_LEN ( 12 ) -#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 16 * 1024 ) ) +#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 2 * 1024 * 1024 ) ) /* Constants that build features in or out. */ #define configUSE_MUTEXES 1 diff --git a/Middleware/FreeRTOS-Kernel/portable/MemMang/heap_4.c b/Middleware/FreeRTOS-Kernel/portable/MemMang/heap_4.c index fb8e035..cf0be4b 100644 --- a/Middleware/FreeRTOS-Kernel/portable/MemMang/heap_4.c +++ b/Middleware/FreeRTOS-Kernel/portable/MemMang/heap_4.c @@ -61,7 +61,7 @@ * heap - probably so it can be placed in a special segment or address. */ extern uint8_t ucHeap[ configTOTAL_HEAP_SIZE ]; #else - PRIVILEGED_DATA static uint8_t ucHeap[ configTOTAL_HEAP_SIZE ]; + PRIVILEGED_DATA static uint8_t ucHeap[ configTOTAL_HEAP_SIZE ] __attribute__((section(".SDRAM1"), aligned(8))) ; #endif /* configAPPLICATION_ALLOCATED_HEAP */ /* Define the linked list structure. This is used to link free blocks in order -- 2.34.1