Steps:
- Extract binary file from Atmega328 chip or obtain .hex file from buildfolder
- If .hex file convert to bin with online tool
- IDA doesn't know the memory map of ATMEGA328, overwrite avr.cfg to the cfg folder of IDA (ATMEGA328 is appended to the file)
- Load the binary in IDA, choose AVR processor. Select ATMEGA328.
- File -> Script File -> diaphora.py, compare against a build of with symbols intact (.elf) file.
- Extract initialised RAM from BINfile. Use > ram_extractor.py
- Add RAM segment to IDA.
Credits to (they explain things in more detail):