Hi Sir
Would you share the s32k3 RTOS sample code for refer?
I try to cut in FreeRTOS with s32k312, and arrange the heap size to 24K will build error. (16K build pass)To check the .map file, the standby SRAM just main 3KB.
1. Since the Standby SRAM region is 32Kbytes, since our application is to mount FreeRTOS, does this mean that the heap size occupied by FreeRTOS cannot be too large?
2. At present, in our application, the MCU needs about 90Kbytes of RAM to store DATA. It is mentioned in AN13388.pdf that the TCM region can be 96KBytes in total (I-TCM: 32Kbyte,
D-TCM: 64Kbytes) space is used as system memory. Is there an example project for this function that can be used for our reference? Whether it is I-TCM or D-TCM
Can they be used as system memory?
3. If the TCM is used as system memory, when the MCU wakes up from sleep mode, does the TCM need to be re-initialized? Or it will be like the Standby SRAM region, Will the content be retained?
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