Hi Stephen,
These are default memory segments in mentioned FreeRTOS sample project:
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 = 0x00006F00 /* 27 KB */
int_sram_fls_rsv : ORIGIN = 0x20406F00, LENGTH = 0x00000100
int_sram_stack_c0 : ORIGIN = 0x20407000, LENGTH = 0x00001000
int_sram_no_cacheable : ORIGIN = 0x20408000, LENGTH = 0x00007F00 /* 32kb , needs to include int_results */
int_sram_results : ORIGIN = 0x2040FF00, LENGTH = 0x00000100
int_sram_shareable : ORIGIN = 0x20410000, LENGTH = 0x00008000 /* 32KB */
ram_rsvd2 : ORIGIN = 0x20418000, LENGTH = 0 /* End of SRAM */
}
The RAM memory is divided into several segments.
As you can see, heap is forced to int_sram segment:
.heap (NOLOAD):
{
. += ALIGN(4);
_end = .;
end = .;
_heap_start = .;
. += HEAP_SIZE;
_heap_end = .;
} > int_sram
The size of int_sram segment is 27KB, so obviously the heap cannot be 32KB. To be able to enlarge the heap, the linker file needs to be modified based on your needs or it’s necessary to select derivative with bigger RAM.
I have an example for DTCM – it shows how to put initialized variables to this space. See please attachment.
Yes, TCM can be used as a system memory. See please following sections in the RM:
https://www.nxp.com/webapp/Download?colCode=S32K3XXRM
3.3 Access-related details of the memory types used in this chip
3.4 TCM as system memory
3.5 Considerations related to TCM's implementation
The core is not in standby power domain, so TCM will be reset after wake up. The content will not be retained.
TCM is accessible also by other bus masters, so I can’t see a function which would not work when TCM is used as system RAM.
Regards,
Lukas