I downloaded the FreeRTOS demo based on K3 series chips from the official website of NXP, and made two modifications on the demo. The first modification is to add the initialization of Usart port, and there are three lighted tasks, the size of each task is 10244 bytes. If configTOTAL_HEAP_SIZE is larger than 301024, the code will compile but will not run and the main function is not enter. If configtotal_heap_size is smaller than 301024, the code will run ok. The second change is that there are six tasks with a total size of 16KB, but configTOTAL_HEAP_SIZE is normal when it is larger than 601024. If it is smaller than 60*1024, the code will compile, but not run. The memory allocation of the chip is shown in the following figure. Attached is the map file compiled and generated in case of an exception.
MEMORY
{
int_flash : ORIGIN = 0x00400000, LENGTH = 0x001D4000 /* 2048K - 176K (sBAF + HSE)/
int_itcm : ORIGIN = 0x00000000, LENGTH = 0x00008000 / 32K /
int_dtcm : ORIGIN = 0x20000000, LENGTH = 0x00010000 / 64K */
int_sram : ORIGIN = 0x20400000, LENGTH = 0x00014F00 /* 83 KB */
int_sram_fls_rsv : ORIGIN = 0x20414F00, LENGTH = 0x00000100
int_sram_stack_c0 : ORIGIN = 0x20415000, LENGTH = 0x00001000
int_sram_no_cacheable : ORIGIN = 0x20416000, LENGTH = 0x00000F00 /* 5kb , needs to include int_results */
int_sram_results : ORIGIN = 0x20416F00, LENGTH = 0x00000100
int_sram_shareable : ORIGIN = 0x20417000, LENGTH = 0x00001000 /* 4KB */
ram_rsvd2 : ORIGIN = 0x20418000, LENGTH = 0 /* End of SRAM */
}
.bss 0x20400080 0x0 ./FreeRTOS/Source/croutine.o
.bss 0x20400080 0x0 ./FreeRTOS/Source/event_groups.o
.bss 0x20400080 0x0 ./FreeRTOS/Source/list.o
.bss 0x20400080 0x40 ./FreeRTOS/Source/queue.o
0x20400080 xQueueRegistry
.bss 0x204000c0 0x0 ./FreeRTOS/Source/stream_buffer.o
.bss 0x204000c0 0x104 ./FreeRTOS/Source/tasks.o
0x204000c4 pxCurrentTCB
.bss 0x204001c4 0x3c ./FreeRTOS/Source/timers.o
.bss 0x20400200 0x8 ./FreeRTOS/Source/portable/GCC/ARM_CM7/r0p1/port.o
.bss 0x20400208 0x8420 ./FreeRTOS/Source/portable/MemMang/heap_4.o
.bss 0x20408628 0x0 ./Project_Settings/Startup_Code/Vector_Table.o
.bss 0x20408628 0x0 ./Project_Settings/Startup_Code/exceptions.o
.bss 0x20408628 0x0 ./Project_Settings/Startup_Code/nvic.o
.bss 0x20408628 0x0 ./Project_Settings/Startup_Code/startup.o
.bss 0x20408628 0x0 ./Project_Settings/Startup_Code/startup_cm7.o
.bss 0x20408628 0x78 ./Project_Settings/Startup_Code/system.o