Hi All,
I am using Keil uV5.15 version IDE for Cortex M0 controller. In order to calculate the total flash usage I am finding conflicts by seeing: 1. Size in IDE after build "data + RO" in KB 2. Size mention in map file - Total ROM size "data + RO + RW"
Can you please tell which data I should consider and why it is different at different places? As per my understanding, RW is data belongs to RAM. So why it is consider in map file for ROM size calculation?
Thanks in advance!
Initialized RW variables needs to get their initial values from somewhere. So they can consume space in both flash and RAM.
Uninitialized RW variables on the other hand can be just zero-filled by the startup code, and so do not consume any additional flash space.
So it means for the below condition say: Condition 1: char a; ROM usage 0 byte RAM usage 1 byte
Condition 2: char a = 10; ROM usage 1 byte RAM usage 1 byte
Is it correct?
Also please tell for my other query - How can we calculate the total Flash size by seeing the build in IDE? say after build in keil IDE: Program Size: Code=37300 RO-data=1476 RW-data=516 ZI-data=1748
Static initialization data will be in ROM. You should add everything except ZI (Zero Initialize)
Need more information or confirmation, then look at what is decribed in .HEX output, or size of sections in .AXF file.with FromELF.
Review also the concept of a Load Region, like unpacking a box with all the pieces need for.running your code.