Wed 18 Sep 2013 05:50:04 PM UTC, original submission:
I wanted to preserve the original content of a borrowed ATmega328p Arduino before overwriting it for non-Arduino use. I used both the Atmel Studio utility and avrdude to obtain an image of the flash content.
Atmel Studio saved 32768 flash bytes to an Intel hex file.
"avrdude -p ATmega328p -c avrispmkII -P usb -U flash:r:flashSave.hex:i" saved 32750 flash bytes into an Intel hex file, 18 fewer bytes than Atmel Studio saved.
The actual text file sizes were very different because the two programs use different line lengths. I used avr-objcopy to convert them to the same line length, then compared them using diff.
Comparison of the files showed that avrdude failed to save the highest 18 bytes of flash, all of which were FF.
Both files contained identical information up to that point.
I next tried "avrdude -p ATmega328p -c avrispmkII -P usb -t", and at the prompt entered "read flash 0 32768", and the upper 18 bytes were shown correctly.
So avrdude "read" is able to read the full flash content. Then why does "-U" fail to save the last 18 "FF" bytes to the output hex file?
|