This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Question about RAM of microcolntroller

I have some questions regarding RAM, ROM and Flash area of microcontroller.
A. How is it to know the maximum size of stack possible to assign when developing a program for a microcontroller?
B. Size of SRAM is written in datasheet. How should we be careful not to exceed this value while developing program?
for example STM32F407VGT6 has 192KByte SRAM and upto 1MByte Flash memory.
after compiling program compile report is:
Code=143384 RO-data=14320 RW-data=1016 ZI-data=74232

if there is no need for heap memory what should be the best size of stack according to compile information?

  • The size of RAM passed to the linker via address/size of IRAM1 should constrain how much it can use, and it will report if the solution doesn't fit in memory.

    You can set the desired stack and heap sizes in startup.s

    How large the stack needs to be depends on your usage, how you use local/auto variables in functions, and deep your call tree is, and how many interrupts may preempt each other and how large their stack footprint is. You'd perhaps want to do some static analysis, or look at the call-tree .HTML file generated by the linker.

    Don't you have good teachers, or the ability to review micro-controller programming texts going back decades. The concepts here are not specific to Cortex-Mx processors, or STM32 parts.