How much is ZI,RW,RO & Code in arduino

  1. I am using Arduino 1.8.1 & made a code in it. Board it Atemga2560 R3.

  2. Final code size is: a) 674 bytes (8%) of dynamic memory, leaving 7518 bytes for local variables. Maximum is 8192 bytes b) 22440 bytes (8%) of program storage space. Maximum is 253952 bytes.

  3. How to get below in arduino: a) Zero Initialize (ZI) or .bss b) Read Write (RW) or .data c) Read only (RO) d) Code or .text

  4. In 3c, what is other name for RO area, like ZI is called .bss.

  5. This is correct right? a) SRAM: .bss + .data + Stack + heap b) Flash: .text + RO

In preferences.txt, change preproc.save_build_files=false build.verbose=false to preproc.save_build_files=true build.verbose=true

Re-start the IDE.

Compile a sketch.

In the verbose output, look for the path to the build directory:

"/Users/john/Library/Arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0  "/var/folders/cs/p6yz0z1m8xj9lf0059b_lzw00000gn/T/arduino_build_165024/simple.ino.elf" "/var/folders/cs/p6yz0z1m8xj9lf0059b_lzw00000gn/T/arduino_build_165024/simple.ino.eep"
"/Users/john/Library/Arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-objcopy" -O ihex -R .eeprom  "/var/folders/cs/p6yz0z1m8xj9lf0059b_lzw00000gn/T/arduino_build_165024/simple.ino.elf" "[color=#ff0000]/var/folders/cs/p6yz0z1m8xj9lf0059b_lzw00000gn/T/arduino_build_165024[/color]/simple.ino.hex"
Using library Adafruit_NeoPixel at version 1.1.2 in folder: /Users/john/Documents/Arduino/libraries/Adafruit_NeoPixel 
Sketch uses 2374 bytes (7%) of program storage space. Maximum is 32256 bytes.
Global variables use 40 bytes (1%) of dynamic memory, leaving 2008 bytes for local variables. Maximum is 2048 bytes.

Go to that folder to find the .ino.elf file. There are tools for extracting memory layout from the .elf file.