Flash eines Microcontrollers mit AVRDude auslesen und beschreiben
In meinem Beispiel benutze ich als Microcontroller den ATMega32 und nutzte zum beschreiben und lesen den USBTinyISP
Flash auslesen
$ avrdude -c usbtiny -p m32 -U flash:r:bla.hex:i avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.01s avrdude: Device signature = 0x1e9502 avrdude: reading flash memory: Reading | ################################################## | 100% 17.15s avrdude: writing output file "bla.hex" avrdude: safemode: Fuses OK avrdude done. Thank you.
Der Inhalt des Flash wurde in die Datei main.hex geschrieben.
Flash schreiben
Hier wird der Inhalt aus main.hex in den Flash geschrieben
$ avrdude -c usbtiny -p m32 -B 1 -U flash:w:main.hex avrdude: Setting SCK period to 1 usec avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.01s avrdude: Device signature = 0x1e9502 avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed To disable this feature, specify the -D option. avrdude: erasing chip avrdude: Setting SCK period to 1 usec avrdude: reading input file "main.hex" avrdude: input file main.hex auto detected as Intel Hex avrdude: writing flash (16754 bytes): Writing | ################################################## | 100% 3.67s avrdude: 16754 bytes of flash written avrdude: verifying flash memory against main.hex: avrdude: load data flash data from input file main.hex: avrdude: input file main.hex auto detected as Intel Hex avrdude: input file main.hex contains 16754 bytes avrdude: reading on-chip flash data: Reading | ################################################## | 100% 2.49s avrdude: verifying ... avrdude: 16754 bytes of flash verified avrdude: safemode: Fuses OK avrdude done. Thank you.