Hello,
I use STM32F413ZG that has 1.5M Bytes flash and 320K bytes RAM. When I use Keil uvsion5 to finish Compile, I get the below information
Program Size: Code=902,730 RO-data=594,458 RW-data=4,380 ZI-data=323,084
According to document said:
ROM(Flash)=Code + RO-data= 902,730 + 594,458 =1, 497,188, is very close to 1.5M flash?
RAM=ZI + RW = 323,084 + 4,380 =327,464 , is larger than 320K RAM ?
I confused why the RAM larger than 320k, my program still can run correctly?
And the flash close to 1.5M , that means I cannot add ne function in the future?
Is there any way I can reduce the RAM and ROM usage?
Thank you so much !
June Zhou said:327,464 , is larger than 320K RAM
It is, but that's not a problem, because the size of your RAM is surely not actually 320 kB, it's 320 KiB, i.e. 320 times 1024 Bytes. But yes, those numbers would mean you're pretty much done filling up that controller.
June Zhou said:Is there any way I can reduce the RAM and ROM usage?
How is anybody supposed to be able to answer that with any confidence without knowing how you managed to fill up all those kibibytes?
1.5MB is 1572864 bytes
320KB is 327680 bytes
>>Is there any way I can reduce the RAM and ROM usage?
Use subroutines, use optimization, stop allocating large static arrays, perhaps use variable widths appropriate to the range of content expected to be stored?
Review how you're using it now, and decide who the biggest consumers are, and perhaps if there is overlap where two separate allocations can be folded into one?
Broeker,
Thank you so much for your explain, I got it.
Westonsupermare Pier,
Thanks a lot ! You answer is very clear and big help. For our application, GUI should use lots of memory. I will research your suggestions and improve my codes. Really appreciate it.