I want to use all 96K of SRAM available, the main 64K SRAM is at addresses 0x1000 0000 - 0x1000 FFFF, the additional 32K of "peripheral" SRAM is at addresses 0x2000 000 - 0x2000 7FFF. My questions is, do I have to explicitly locate variables in the peripheral SRAM (which I understand how to do), or can I just blindly keep defining variables in my code and the linker will magically locate them across those two memory/address blocks? Can variables span the address divide?
Generally you need to drive the placement, via attributes, or at an object/section level within the scatter file.
Arrays/Pointers cannot span the gap automagically.
The Heap can be forced to understand two memory arenas/pools.
Often there are speed or bus matrix differences in the memory regions, if 0x10000000 is CCM/TCM, this might not be usable for DMA. Check the MCU's Reference Manual.
Thank you, that's what I needed to know. I will continue to locate variables in the peripheral SRAM via attributes.
View all questions in Keil forum