2023-05-04 8:08 AM
Hello,
I am using the STM32F756ZGT6 for an upcoming project. I am using a 480x272 resolution display (RGB565) with a single layer. I also have additional features that will be on this board that use more RAM (2 tasks, multiple variables, etc.) that add up in the RAM. In total, I have 310 kBytes of RAM usage, according to the Memory Regions tab. The MCU has 320 kBytes of internal RAM and I have tested it with the display and my code works as intended.
My question is, long term, will I experience problems when the RAM usage is that high? My RAM usage percentage is about 96%, which is quite high. I cannot think of any issues (aside from limitations on software additions later), but I wanted to ask in case I'm not thinking of something.
Solved! Go to Solution.
2023-05-04 10:34 AM
You should not compare an STM32 with a CPU that has to process a highly complex operating system with a constantly changing RAM load due to constantly changing programs.
The RAM load results mainly from the allocation of variables, arrays, stacks, etc. specified by your programme. Only the stack is an unknown, which you can control by taking appropriate measures and defining it large enough; everything else is fixed and non-expanding, so to speak. When the stack "overflows", it overlaps RAM defined for variables and arrays, which usually leads to an immediate crash of the system.
If you have defined the stack large enough, your programme can run for decades with this RAM load.
Does this answer your question?
Did you enable the optimizer of your compiler and switch it to "optimization for size"?
Regards
/Peter
2023-05-04 10:34 AM
You should not compare an STM32 with a CPU that has to process a highly complex operating system with a constantly changing RAM load due to constantly changing programs.
The RAM load results mainly from the allocation of variables, arrays, stacks, etc. specified by your programme. Only the stack is an unknown, which you can control by taking appropriate measures and defining it large enough; everything else is fixed and non-expanding, so to speak. When the stack "overflows", it overlaps RAM defined for variables and arrays, which usually leads to an immediate crash of the system.
If you have defined the stack large enough, your programme can run for decades with this RAM load.
Does this answer your question?
Did you enable the optimizer of your compiler and switch it to "optimization for size"?
Regards
/Peter
2023-05-04 10:39 AM
Hello Peter,
Thank you for the answer! Yes, this answers my question.
So as long as my stack size is well defined, this "high load" will not be a problem?
Also, I do not have the compiler optimizer switched to "optimization for size." Where do I do this?
2023-05-04 11:34 AM
Correct.
Since you have not mentioned which tools you are working with, no recommendation can be given so far. If you have developed the graphical interface with TouchGFX and use STM32CubeIDE as compiler, it is quite easy:
Does it work and reduce the required RAM?