Question

How can I find the size of Flash (ROM) and RAM used by the Firmware? The firmware is implemented using C++. Also I have Keil microvision4; will it be helpful to find the ROM and RAM size?

Or do I need to look at the MAP(.M51) file of the firmware to find the memory sizes?

Or just telling the size of hex files(.hex) file is enough for locating the size of ROM?

Was it helpful?

Solution

A few comments:

  1. The size of the hex file doesn't provide a great deal of information. For example: it won't provide any RAM usage. It may not even tell you the size of the image as it resides on the device (are you writing to NOR and NAND flash? What are the flash block sizes, etc.)
  2. The map file is a good tool for understanding the memory layout and sizes. It should provide all of the segment allocations information. The Keil project manager is pretty good, so check your build options to ensure you are generating a verbose map file.
  3. Take a look at your linker directive file to ensure you understand how those segments (bss, data, etc) are allocated and laid out in memory.
  4. Note that the map file won't contain much information relating to dynamic (heap) memory allocation.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top