I'm doing a project that use all resources and options available in stm32f746 using its discovery board to create a smart controller I did not reach half distance of my road and now the zi data is around 390 kb which is greater than actual device RAM My question is does zi mean real places booked in RAM or just virtual according to program and when program run it will be deleted and over written like what happens in stack and heap ? If yes real location then how is program still run and it show zi greater than device RAM Note1 there is external RAM used for LCD buffering How I can use that external RAM to increase total RAM for zi Note2 I'm new in C and arm
Thanks
zi is real and permanently consumed RAM. zi just informs that it is zero-initialized global variables.
Global variables is intended to be variables that should exist from program start until the program somehow ends.
You'd need to define the memory space you want the linker to use, and also initialize the SDRAM so it is usable. The topic of directing data to SDRAM has been covered here in recent days, and relatively frequently. Review the product documentation if you want to understand how to use the tools.
Consider why you are burning up all this space, do they need to be global static allocations, or could you use dynamic memory which you allocation/deallocate as needed.
Embedded is not like PC programming, you can't assume infinite amounts of space. The SDRAM is also likely to be slower than internal RAM, so use the appropriate memory for the task at hand.
Depending on lifetime, stack allocations may also be a viable option. No fragmentation danger, unlike heap allocation.
Thanks for fast reply What is that mean after compile zi is around 390 KB and device RAM only 320 KB and program is working till now ? How I can control zi data to be reduced much I use rtos and fatfs and my own build gui is that consume all this space 390 KB ? Sorry I' m confused and I want to know from which place in program it consume much memory I try to not use dynamic memory as I still in startup and do not want more troubles with pointers interaction
Review the .MAP file
THANKS I got the problem from original LCD driver it define lcd buffer as static array with size round 260 kb in external ram once i make as pointer it reduced that amount