Moi,
Salaus taitaa mennä näin:
Pistää lukituksen päälle koodia testcode.hex varten:
C:>avrdude -p m328p -c usbtiny -B10 -D -U flash:w:testcode.hex -U lock:w:0x3f:m
avrdude: Setting SCK period to 10 usec
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f
avrdude: reading input file “testcode.hex”
avrdude: input file testcode.hex auto detected as Intel Hex
avrdude: writing flash (3490 bytes):
Writing | ################################################## | 100% 2.05s
avrdude: 3490 bytes of flash written
avrdude: verifying flash memory against testcode.hex:
avrdude: load data flash data from input file testcode.hex:
avrdude: input file testcode.hex auto detected as Intel Hex
avrdude: input file testcode.hex contains 3490 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 1.83s
avrdude: verifying …
avrdude: 3490 bytes of flash verified
avrdude: reading input file “0x3f”
avrdude: writing lock (1 bytes):
Writing | ################################################## | 100% 0.00s
avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x3f:
avrdude: load data lock data from input file 0x3f:
avrdude: input file 0x3f contains 1 bytes
avrdude: reading on-chip lock data:
Reading | ################################################## | 100% 0.00s
avrdude: verifying …
avrdude: 1 bytes of lock verified
avrdude: safemode: Fuses OK
avrdude done. Thank you.
Lukituksen jälkeen yritetään ladata piirille jotain muuta, ei onnistu!
C:>avrdude -p m328p -c usbtiny -B10 -D -U flash:w:OwnBlink.cpp.hex
avrdude: Setting SCK period to 10 usec
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x1e950f
avrdude: reading input file “OwnBlink.cpp.hex”
avrdude: input file OwnBlink.cpp.hex auto detected as Intel Hex
avrdude: writing flash (1018 bytes):
Writing | ################################################## | 100% 0.59s
avrdude: 1018 bytes of flash written
avrdude: verifying flash memory against OwnBlink.cpp.hex:
avrdude: load data flash data from input file OwnBlink.cpp.hex:
avrdude: input file OwnBlink.cpp.hex auto detected as Intel Hex
avrdude: input file OwnBlink.cpp.hex contains 1018 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.53s
avrdude: verifying …
avrdude: verification error, first mismatch at byte 0x0006
0x7e != 0x24
avrdude: verification error; content mismatch
avrdude: safemode: Fuses OK
avrdude done. Thank you.
Onnistuu taas, kun piiri ensin tyhjennetään (e)rase:
C:>avrdude -p m328p -c usbtiny -B10 -e -U flash:w:OwnBlink.cpp.hex
avrdude: Setting SCK period to 10 usec
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f
avrdude: erasing chip
avrdude: Setting SCK period to 10 usec
avrdude: reading input file “OwnBlink.cpp.hex”
avrdude: input file OwnBlink.cpp.hex auto detected as Intel Hex
avrdude: writing flash (1018 bytes):
Writing | ################################################## | 100% 0.59s
avrdude: 1018 bytes of flash written
avrdude: verifying flash memory against OwnBlink.cpp.hex:
avrdude: load data flash data from input file OwnBlink.cpp.hex:
avrdude: input file OwnBlink.cpp.hex auto detected as Intel Hex
avrdude: input file OwnBlink.cpp.hex contains 1018 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.53s
avrdude: verifying …
avrdude: 1018 bytes of flash verified
avrdude: safemode: Fuses OK
avrdude done. Thank you.