Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 2
    The magical command for converting from hex to asm seems to be "avr-objdump -j .sec1 -d -m avr5 myfile.hex". Found this in avrfreaks.net/comment/158180#forum-topic-top Commented Feb 5, 2016 at 13:43
  • But there are decompilers that can convert machine code to C, but I assume those do not work with this kind of assembler? Commented Feb 5, 2016 at 21:34
  • 1
    I don't see why they wouldn't work with this type, however there are limitations to what they can achieve. For one thing, they can't possibly know the variable names (apart from processor registers, I suppose) so your variables would become v1, v2, etc. The C compiler possibly inlines some function calls, so you might see functions turned into inline code. The compiler moves things around (or omits them, even) for efficiency, so that would be hard to get back. Anyway, re-reading the question, it doesn't seem like some very important stuff is there. Commented Feb 5, 2016 at 22:13
  • 1
    For a more complete backup of everything on the ATmega328p chip, avrdude -v -p m328p -c avrisp -U flash:r:m328p_flash.hex:i -U efuse:r:m328p_efuse.hex:h -U hfuse:r:m328p_hfuse.hex:h -U lfuse:r:m328p_lfuse.hex:h -U lock:r:m328p_lock.hex:h -U eeprom:r:m328p_eeprom.hex:i captures EEPROM data and fuse settings, as well as the executable flash object code. Restore backup by replacing all of the :r: with :w:. Commented Feb 6, 2016 at 0:27