AnsweredAssumed Answered

Kinetis K22FN512VLH12 - Only using half of the SRAM?

Question asked by Donald Bosley on Jul 12, 2015
Latest reply on Aug 27, 2015 by Erich Styger

I am using KDS 3.0, KSDK 1.2, and a Freedom K22F board.

This may be a KDS question, but I'm seeing that .bss is only allowing the use of up to 64k of my SRAM on compile, when I know there are 128k of RAM?

Per the Family Manual : SRAM sizes This device contains SRAM accessed by bus masters through the cross-bar switch. The on-chip SRAM is split into SRAM_L and SRAM_U regions where the SRAM_L and SRAM_U ranges form a contiguous block in the memory map anchored at address 0x2000_0000. As such: • SRAM_L is anchored to 0x1FFF_FFFF and occupies the space before this ending address. • SRAM_U is anchored to 0x2000_0000 and occupies the space after this beginning address.


Given that "NOTE Misaligned accesses across the 0x2000_0000 boundary are not supported in the ARM Cortex-M4 architecture", I have broken my large multi-dimensional array in two so that I can place on half in SRAM_L, and the other half in SRAM_U, even if I leave a hole of wasted memory at the boundary.  Using the methods from Erich Styger's tutorial : Defining Variables at Absolute Addresses with gcc | MCU on Eclipse , I break my large array into 2, and place them in sections of the memory :

Now it's leveraging the available space of SRAM_U to place the stack and heap, however, it's still limited to 64k total for everything else, and looking at the address values vs the linked file, doesn't appear to be actually putting .m_data_2 at 1FFF7524 instead of the starting address of m_data_2 which is 0x2000_0000?