>>> Using avrdude 6.0.1 from Debian $ avrdude -v avrdude: Version 6.0.1, compiled on Sep 20 2013 at 18:33:32 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2009 Joerg Wunsch System wide configuration file is "/etc/avrdude.conf" User configuration file is "/home/matthijs/.avrduderc" User configuration file does not exist or is not a regular file, skipping avrdude: no programmer has been specified on the command line or the config file Specify a programmer using the -c option and try again >>> First, erase the chip $ avrdude -P /dev/serial/stk500 -patmega256rfr2 -cstk500v2 -e avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.01s avrdude: Device signature = 0x1ea802 avrdude: erasing chip avrdude: safemode: Fuses OK (H:FE, E:10, L:DE) avrdude done. Thank you. >>> Confirm that the bits are 0xff/0x3f (note that upper two bits are unused >>> and read as 0 by stk500, but read as 1 for jtag3, see >>> https://savannah.nongnu.org/bugs/?21954) $ avrdude -P /dev/serial/stk500 -patmega256rfr2 -cstk500v2 -Ulock:r:-:h avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.01s avrdude: Device signature = 0x1ea802 avrdude: reading lock memory: Reading | ################################################## | 100% 0.00s avrdude: writing output file "" 0x3f avrdude: safemode: Fuses OK (H:FE, E:10, L:DE) avrdude done. Thank you. >>> Write 0 to some of the lock bits with jtag3isp. Note that reading the lock >>> byte after writing still returns 0xff. Also note the -V -u options, to >>> disable verifying the lock byte after writing (instead we explicitely read it) >>> and to disable checking the fuses in safe mode (since those also return 0xff >>> after writing). $ avrdude -patmega256rfr2 -cjtag3isp -V -u -Ulock:r:-:h -Ulock:w:0xcf:m -Ulock:r:-:h avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.19s avrdude: Device signature = 0x1ea802 avrdude: reading lock memory: Reading | ################################################## | 100% 0.00s avrdude: writing output file "" 0xff avrdude: reading input file "0xcf" avrdude: writing lock (1 bytes): Writing | ################################################## | 100% 0.00s avrdude: 1 bytes of lock written avrdude: reading lock memory: Reading | ################################################## | 100% 0.00s avrdude: writing output file "" 0xff avrdude done. Thank you. >>> Reading with stk500 confirms that writing did work (again, upper bits are >>> masked out, so 0xcf == 0xf) $ avrdude -P /dev/serial/stk500 -patmega256rfr2 -cstk500v2 -Ulock:r:-:h avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.01s avrdude: Device signature = 0x1ea802 avrdude: reading lock memory: Reading | ################################################## | 100% 0.00s avrdude: writing output file "" 0xf avrdude: safemode: Fuses OK (H:FE, E:10, L:DE) avrdude done. Thank you. >>> Write a second time using jtag3isp. Now you see the bits are read correctly >>> before writing, but still read as 0xff after writing. $ avrdude -patmega256rfr2 -cjtag3isp -V -u -Ulock:r:-:h -Ulock:w:0xcf:m -Ulock:r:-:h avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.19s avrdude: Device signature = 0x1ea802 avrdude: reading lock memory: Reading | ################################################## | 100% 0.00s avrdude: writing output file "" 0xcf avrdude: reading input file "0xcf" avrdude: writing lock (1 bytes): Writing | ################################################## | 100% 0.00s avrdude: 1 bytes of lock written avrdude: reading lock memory: Reading | ################################################## | 100% 0.00s avrdude: writing output file "" 0xff avrdude done. Thank you. >>> Just reading the lock byte returns the correct value as well. $ avrdude -patmega256rfr2 -cjtag3isp -V -u -Ulock:r:-:h avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.20s avrdude: Device signature = 0x1ea802 avrdude: reading lock memory: Reading | ################################################## | 100% 0.00s avrdude: writing output file "" 0xcf avrdude done. Thank you. >>> And once again with more verbosity. Looking at the actual bytes sent and >>> received, it seems the JTAGICE3 actually returns 0xff. $ avrdude -patmega256rfr2 -cjtag3isp -V -u -Ulock:r:-:h -Ulock:w:0xcf:m -Ulock:r:-:h -v -v -v -v avrdude: Version 6.0.1, compiled on Sep 20 2013 at 18:33:32 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2009 Joerg Wunsch System wide configuration file is "/etc/avrdude.conf" User configuration file is "/home/matthijs/.avrduderc" User configuration file does not exist or is not a regular file, skipping Using Port : usb Using Programmer : jtag3isp avrdude: stk500v2_jtag3_open() avrdude: usbdev_open(): Found JTAGICE3, serno: J30200031779 avrdude: jtag3_getsync() avrdude: Sending sign-on command: avrdude: jtag3_send(): sending 3 bytes avrdude: Sent: . [0e] . [00] . [00] . [00] . [01] . [10] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [00] . [00] . [01] . [80] . [00] avrdude: jtag3_recv(): Got message seqno 0 (command_sequence == 0) Raw message: 01 80 00 [general] OK AVR Part : ATmega256RFR2 Chip Erase delay : 55000 us PAGEL : PD7 BS2 : PE2 RESET disposition : dedicated RETRY pulse : SCK serial program mode : yes parallel program mode : yes Timeout : 200 StabDelay : 100 CmdexeDelay : 25 SyncLoops : 32 ByteDelay : 0 PollIndex : 3 PollValue : 0x53 Memory Detail : Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- eeprom 65 10 8 0 no 4096 8 0 9000 9000 0x00 0x00 Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- flash 65 10 256 0 yes 262144 256 1024 4500 4500 0x00 0x00 Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00 Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00 Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00 Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00 Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00 Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00 Programmer Type : JTAG3_ISP Description : Atmel AVR JTAGICE3 in ISP mode avrdude: jtag3_getparm() avrdude: Sending get parameter (scope 0x01, section 1, parm 0) command: avrdude: jtag3_send(): sending 6 bytes avrdude: Sent: . [0e] . [00] . [01] . [00] . [01] . [02] . [00] . [01] . [00] . [02] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [01] . [00] . [01] . [84] . [01] . [89] . [0c] . [00] avrdude: jtag3_recv(): Got message seqno 1 (command_sequence == 1) Raw message: 01 84 01 89 0c 00 [general] Data returned: 0x01 0x89 0x0c 0x00 Vtarget : 3.2 V avrdude: jtag3_send(): sending 2 bytes avrdude: Sent: . [0e] . [00] . [02] . [00] . [11] . [1e] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [02] . [00] . [11] . [1e] . [08] . [00] . [00] avrdude: jtag3_recv(): Got message seqno 2 (command_sequence == 2) SCK period : 125.00 us avrdude: jtag3_setparm() avrdude: Sending set parameter (scope 0x12, section 0, parm 0) command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [03] . [00] . [12] . [01] . [00] . [00] . [00] . [01] . [02] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [03] . [00] . [12] . [80] . [00] avrdude: jtag3_recv(): Got message seqno 3 (command_sequence == 3) Raw message: 12 80 00 [AVR] OK avrdude: jtag3_setparm() avrdude: Sending set parameter (scope 0x12, section 0, parm 1) command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [04] . [00] . [12] . [01] . [00] . [00] . [01] . [01] . [01] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [04] . [00] . [12] . [80] . [00] avrdude: jtag3_recv(): Got message seqno 4 (command_sequence == 4) Raw message: 12 80 00 [AVR] OK avrdude: jtag3_setparm() avrdude: Sending set parameter (scope 0x12, section 1, parm 0) command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [05] . [00] . [12] . [01] . [00] . [01] . [00] . [01] . [01] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [05] . [00] . [12] . [80] . [00] avrdude: jtag3_recv(): Got message seqno 5 (command_sequence == 5) Raw message: 12 80 00 [AVR] OK avrdude: jtag3_send(): sending 2 bytes avrdude: Sent: . [0e] . [00] . [06] . [00] . [11] . [1e] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [06] . [00] . [11] . [1e] . [08] . [00] . [00] avrdude: jtag3_recv(): Got message seqno 6 (command_sequence == 6) avrdude: jtag3_send(): sending 13 bytes avrdude: Sent: . [0e] . [00] . [07] . [00] . [11] . [10] . [c8] d [64] . [19] [20] . [00] S [53] . [03] . [ac] S [53] . [00] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [07] . [00] . [11] . [10] . [00] avrdude: jtag3_recv(): Got message seqno 7 (command_sequence == 7) avrdude: AVR device initialized and ready to accept instructions Reading | | 0% 0.00savrdude: stk500isp_read_byte(.., signature, 0x0, ...) avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [08] . [00] . [11] . [1b] . [04] 0 [30] . [00] . [00] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [08] . [00] . [11] . [1b] . [00] . [1e] . [00] avrdude: jtag3_recv(): Got message seqno 8 (command_sequence == 8) avrdude: stk500isp_read_byte(.., signature, 0x1, ...) avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [09] . [00] . [11] . [1b] . [04] 0 [30] . [00] . [01] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [09] . [00] . [11] . [1b] . [00] . [a8] . [00] avrdude: jtag3_recv(): Got message seqno 9 (command_sequence == 9) Reading | ################# | 33% 0.19savrdude: stk500isp_read_byte(.., signature, 0x2, ...) avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [0a] . [00] . [11] . [1b] . [04] 0 [30] . [00] . [02] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [0a] . [00] . [11] . [1b] . [00] . [02] . [00] avrdude: jtag3_recv(): Got message seqno 10 (command_sequence == 10) Reading | ################################################## | 100% 0.19s avrdude: Device signature = 0x1ea802 avrdude: reading lock memory: Reading | | 0% 0.00savrdude: stk500isp_read_byte(.., lock, 0x0, ...) avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [0b] . [00] . [11] . [1a] . [04] X [58] . [00] . [00] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [0b] . [00] . [11] . [1a] . [00] . [cf] . [00] avrdude: jtag3_recv(): Got message seqno 11 (command_sequence == 11) Reading | ################################################## | 100% 0.01s avrdude: writing output file "" 0xcf avrdude: reading input file "0xcf" avrdude: writing lock (1 bytes): Writing | | 0% 0.00savrdude: stk500isp_write_byte(.., lock, 0x0, ...) avrdude: stk500isp_write_byte(): Sending write memory command: avrdude: jtag3_send(): sending 6 bytes avrdude: Sent: . [0e] . [00] . [0c] . [00] . [11] . [19] . [ac] . [e0] . [00] . [cf] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [0c] . [00] . [11] . [19] . [00] avrdude: jtag3_recv(): Got message seqno 12 (command_sequence == 12) Writing | ################################################## | 100% 0.01s avrdude: 1 bytes of lock written avrdude: reading lock memory: Reading | | 0% 0.00savrdude: stk500isp_read_byte(.., lock, 0x0, ...) avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [0d] . [00] . [11] . [1a] . [04] X [58] . [00] . [00] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [0d] . [00] . [11] . [1a] . [00] . [ff] . [00] avrdude: jtag3_recv(): Got message seqno 13 (command_sequence == 13) Reading | ################################################## | 100% 0.01s avrdude: writing output file "" 0xff avrdude: jtag3_send(): sending 4 bytes avrdude: Sent: . [0e] . [00] . [0e] . [00] . [11] . [11] . [01] . [01] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [0e] . [00] . [11] . [11] . [00] avrdude: jtag3_recv(): Got message seqno 14 (command_sequence == 14) avrdude: stk500v2_jtag3_close() avrdude: jtag3_close() avrdude: Sending AVR sign-off command: avrdude: jtag3_send(): sending 3 bytes avrdude: Sent: . [0e] . [00] . [0f] . [00] . [12] . [11] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [0f] . [00] . [12] . [80] . [00] avrdude: jtag3_recv(): Got message seqno 15 (command_sequence == 15) Raw message: 12 80 00 [AVR] OK avrdude: Sending sign-off command: avrdude: jtag3_send(): sending 4 bytes avrdude: Sent: . [0e] . [00] . [10] . [00] . [01] . [11] . [00] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [10] . [00] . [01] . [80] . [00] avrdude: jtag3_recv(): Got message seqno 16 (command_sequence == 16) Raw message: 01 80 00 [general] OK avrdude done. Thank you. >>> When running with safemode enabled, at slow (default) speed, it says unable to >>> read lfuse properly. $ avrdude -patmega256rfr2 -cjtag3isp -V -B125 -Ulock:w:0xcf:m avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.19s avrdude: Device signature = 0x1ea802 avrdude: reading input file "0xcf" avrdude: writing lock (1 bytes): Writing | ################################################## | 100% 0.00s avrdude: 1 bytes of lock written avrdude: safemode: Verify error - unable to read lfuse properly. Programmer may not be reliable. avrdude: safemode: Fuses OK (H:FE, E:10, L:DE) avrdude done. Thank you. >>> Once again in verbose mode $ avrdude -patmega256rfr2 -cjtag3isp -V -B125 -Ulock:w:0xcf:m -v -v -v -v avrdude: Version 6.0.1, compiled on Sep 20 2013 at 18:33:32 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2009 Joerg Wunsch System wide configuration file is "/etc/avrdude.conf" User configuration file is "/home/matthijs/.avrduderc" User configuration file does not exist or is not a regular file, skipping Using Port : usb Using Programmer : jtag3isp Setting bit clk period : 125.0 avrdude: stk500v2_jtag3_open() avrdude: usbdev_open(): Found JTAGICE3, serno: J30200031779 avrdude: jtag3_getsync() avrdude: Sending sign-on command: avrdude: jtag3_send(): sending 3 bytes avrdude: Sent: . [0e] . [00] . [00] . [00] . [01] . [10] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [00] . [00] . [01] . [80] . [00] avrdude: jtag3_recv(): Got message seqno 0 (command_sequence == 0) Raw message: 01 80 00 [general] OK avrdude: jtag3_send(): sending 4 bytes avrdude: Sent: . [0e] . [00] . [01] . [00] . [11] . [1d] . [08] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [01] . [00] . [11] . [1d] . [00] avrdude: jtag3_recv(): Got message seqno 1 (command_sequence == 1) AVR Part : ATmega256RFR2 Chip Erase delay : 55000 us PAGEL : PD7 BS2 : PE2 RESET disposition : dedicated RETRY pulse : SCK serial program mode : yes parallel program mode : yes Timeout : 200 StabDelay : 100 CmdexeDelay : 25 SyncLoops : 32 ByteDelay : 0 PollIndex : 3 PollValue : 0x53 Memory Detail : Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- eeprom 65 10 8 0 no 4096 8 0 9000 9000 0x00 0x00 Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- flash 65 10 256 0 yes 262144 256 1024 4500 4500 0x00 0x00 Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00 Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00 Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00 Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00 Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00 Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00 Programmer Type : JTAG3_ISP Description : Atmel AVR JTAGICE3 in ISP mode avrdude: jtag3_getparm() avrdude: Sending get parameter (scope 0x01, section 1, parm 0) command: avrdude: jtag3_send(): sending 6 bytes avrdude: Sent: . [0e] . [00] . [02] . [00] . [01] . [02] . [00] . [01] . [00] . [02] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [02] . [00] . [01] . [84] . [01] . [90] . [0c] . [00] avrdude: jtag3_recv(): Got message seqno 2 (command_sequence == 2) Raw message: 01 84 01 90 0c 00 [general] Data returned: 0x01 0x90 0x0c 0x00 Vtarget : 3.2 V avrdude: jtag3_send(): sending 2 bytes avrdude: Sent: . [0e] . [00] . [03] . [00] . [11] . [1e] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [03] . [00] . [11] . [1e] . [08] . [00] . [00] avrdude: jtag3_recv(): Got message seqno 3 (command_sequence == 3) SCK period : 125.00 us avrdude: jtag3_setparm() avrdude: Sending set parameter (scope 0x12, section 0, parm 0) command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [04] . [00] . [12] . [01] . [00] . [00] . [00] . [01] . [02] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [04] . [00] . [12] . [80] . [00] avrdude: jtag3_recv(): Got message seqno 4 (command_sequence == 4) Raw message: 12 80 00 [AVR] OK avrdude: jtag3_setparm() avrdude: Sending set parameter (scope 0x12, section 0, parm 1) command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [05] . [00] . [12] . [01] . [00] . [00] . [01] . [01] . [01] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [05] . [00] . [12] . [80] . [00] avrdude: jtag3_recv(): Got message seqno 5 (command_sequence == 5) Raw message: 12 80 00 [AVR] OK avrdude: jtag3_setparm() avrdude: Sending set parameter (scope 0x12, section 1, parm 0) command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [06] . [00] . [12] . [01] . [00] . [01] . [00] . [01] . [01] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [06] . [00] . [12] . [80] . [00] avrdude: jtag3_recv(): Got message seqno 6 (command_sequence == 6) Raw message: 12 80 00 [AVR] OK avrdude: jtag3_send(): sending 2 bytes avrdude: Sent: . [0e] . [00] . [07] . [00] . [11] . [1e] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [07] . [00] . [11] . [1e] . [08] . [00] . [00] avrdude: jtag3_recv(): Got message seqno 7 (command_sequence == 7) avrdude: jtag3_send(): sending 13 bytes avrdude: Sent: . [0e] . [00] . [08] . [00] . [11] . [10] . [c8] d [64] . [19] [20] . [00] S [53] . [03] . [ac] S [53] . [00] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [08] . [00] . [11] . [10] . [00] avrdude: jtag3_recv(): Got message seqno 8 (command_sequence == 8) avrdude: AVR device initialized and ready to accept instructions Reading | | 0% 0.00savrdude: stk500isp_read_byte(.., signature, 0x0, ...) avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [09] . [00] . [11] . [1b] . [04] 0 [30] . [00] . [00] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [09] . [00] . [11] . [1b] . [00] . [1e] . [00] avrdude: jtag3_recv(): Got message seqno 9 (command_sequence == 9) avrdude: stk500isp_read_byte(.., signature, 0x1, ...) avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [0a] . [00] . [11] . [1b] . [04] 0 [30] . [00] . [01] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [0a] . [00] . [11] . [1b] . [00] . [a8] . [00] avrdude: jtag3_recv(): Got message seqno 10 (command_sequence == 10) Reading | ################# | 33% 0.18savrdude: stk500isp_read_byte(.., signature, 0x2, ...) avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [0b] . [00] . [11] . [1b] . [04] 0 [30] . [00] . [02] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [0b] . [00] . [11] . [1b] . [00] . [02] . [00] avrdude: jtag3_recv(): Got message seqno 11 (command_sequence == 11) Reading | ################################################## | 100% 0.18s avrdude: Device signature = 0x1ea802 avrdude: stk500isp_read_byte(.., lfuse, 0x0, ...) avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [0c] . [00] . [11] . [18] . [04] P [50] . [00] . [00] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [0c] . [00] . [11] . [18] . [00] . [de] . [00] avrdude: jtag3_recv(): Got message seqno 12 (command_sequence == 12) avrdude: safemode read 1, lfuse value: de avrdude: stk500isp_read_byte(.., lfuse, 0x0, ...) avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [0d] . [00] . [11] . [18] . [04] P [50] . [00] . [00] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [0d] . [00] . [11] . [18] . [00] . [de] . [00] avrdude: jtag3_recv(): Got message seqno 13 (command_sequence == 13) avrdude: safemode read 2, lfuse value: de avrdude: stk500isp_read_byte(.., lfuse, 0x0, ...) avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [0e] . [00] . [11] . [18] . [04] P [50] . [00] . [00] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [0e] . [00] . [11] . [18] . [00] . [de] . [00] avrdude: jtag3_recv(): Got message seqno 14 (command_sequence == 14) avrdude: safemode read 3, lfuse value: de avrdude: safemode: lfuse reads as DE avrdude: stk500isp_read_byte(.., hfuse, 0x0, ...) avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [0f] . [00] . [11] . [18] . [04] X [58] . [08] . [00] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [0f] . [00] . [11] . [18] . [00] . [10] . [00] avrdude: jtag3_recv(): Got message seqno 15 (command_sequence == 15) avrdude: safemode read 1, hfuse value: 10 avrdude: stk500isp_read_byte(.., hfuse, 0x0, ...) avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [10] . [00] . [11] . [18] . [04] X [58] . [08] . [00] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [10] . [00] . [11] . [18] . [00] . [10] . [00] avrdude: jtag3_recv(): Got message seqno 16 (command_sequence == 16) avrdude: safemode read 2, hfuse value: 10 avrdude: stk500isp_read_byte(.., hfuse, 0x0, ...) avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [11] . [00] . [11] . [18] . [04] X [58] . [08] . [00] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [11] . [00] . [11] . [18] . [00] . [10] . [00] avrdude: jtag3_recv(): Got message seqno 17 (command_sequence == 17) avrdude: safemode read 3, hfuse value: 10 avrdude: safemode: hfuse reads as 10 avrdude: stk500isp_read_byte(.., efuse, 0x0, ...) avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [12] . [00] . [11] . [18] . [04] P [50] . [08] . [00] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [12] . [00] . [11] . [18] . [00] . [fe] . [00] avrdude: jtag3_recv(): Got message seqno 18 (command_sequence == 18) avrdude: safemode read 1, efuse value: fe avrdude: stk500isp_read_byte(.., efuse, 0x0, ...) avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [13] . [00] . [11] . [18] . [04] P [50] . [08] . [00] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [13] . [00] . [11] . [18] . [00] . [fe] . [00] avrdude: jtag3_recv(): Got message seqno 19 (command_sequence == 19) avrdude: safemode read 2, efuse value: fe avrdude: stk500isp_read_byte(.., efuse, 0x0, ...) avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [14] . [00] . [11] . [18] . [04] P [50] . [08] . [00] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [14] . [00] . [11] . [18] . [00] . [fe] . [00] avrdude: jtag3_recv(): Got message seqno 20 (command_sequence == 20) avrdude: safemode read 3, efuse value: fe avrdude: safemode: efuse reads as FE avrdude: reading input file "0xcf" avrdude: writing lock (1 bytes): Writing | | 0% 0.00savrdude: stk500isp_write_byte(.., lock, 0x0, ...) avrdude: stk500isp_write_byte(): Sending write memory command: avrdude: jtag3_send(): sending 6 bytes avrdude: Sent: . [0e] . [00] . [15] . [00] . [11] . [19] . [ac] . [e0] . [00] . [cf] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [15] . [00] . [11] . [19] . [00] avrdude: jtag3_recv(): Got message seqno 21 (command_sequence == 21) Writing | ################################################## | 100% 0.01s avrdude: 1 bytes of lock written avrdude: stk500isp_read_byte(.., lfuse, 0x0, ...) avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [16] . [00] . [11] . [18] . [04] P [50] . [00] . [00] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [16] . [00] . [11] . [18] . [00] . [ff] . [00] avrdude: jtag3_recv(): Got message seqno 22 (command_sequence == 22) avrdude: safemode read 1, lfuse value: ff avrdude: stk500isp_read_byte(.., lfuse, 0x0, ...) avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [17] . [00] . [11] . [18] . [04] P [50] . [00] . [00] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [17] . [00] . [11] . [18] . [00] . [ff] . [00] avrdude: jtag3_recv(): Got message seqno 23 (command_sequence == 23) avrdude: safemode read 2, lfuse value: ff avrdude: stk500isp_read_byte(.., lfuse, 0x0, ...) avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [18] . [00] . [11] . [18] . [04] P [50] . [00] . [00] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [18] . [00] . [11] . [18] . [00] . [de] . [00] avrdude: jtag3_recv(): Got message seqno 24 (command_sequence == 24) avrdude: safemode read 3, lfuse value: de avrdude: safemode: Verify error - unable to read lfuse properly. Programmer may not be reliable. avrdude: stk500isp_read_byte(.., lfuse, 0x0, ...) avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [19] . [00] . [11] . [18] . [04] P [50] . [00] . [00] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [19] . [00] . [11] . [18] . [00] . [de] . [00] avrdude: jtag3_recv(): Got message seqno 25 (command_sequence == 25) avrdude: safemode read 1, lfuse value: de avrdude: stk500isp_read_byte(.., lfuse, 0x0, ...) avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [1a] . [00] . [11] . [18] . [04] P [50] . [00] . [00] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [1a] . [00] . [11] . [18] . [00] . [de] . [00] avrdude: jtag3_recv(): Got message seqno 26 (command_sequence == 26) avrdude: safemode read 2, lfuse value: de avrdude: stk500isp_read_byte(.., lfuse, 0x0, ...) avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [1b] . [00] . [11] . [18] . [04] P [50] . [00] . [00] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [1b] . [00] . [11] . [18] . [00] . [de] . [00] avrdude: jtag3_recv(): Got message seqno 27 (command_sequence == 27) avrdude: safemode read 3, lfuse value: de avrdude: safemode: lfuse reads as DE avrdude: stk500isp_read_byte(.., hfuse, 0x0, ...) avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [1c] . [00] . [11] . [18] . [04] X [58] . [08] . [00] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [1c] . [00] . [11] . [18] . [00] . [10] . [00] avrdude: jtag3_recv(): Got message seqno 28 (command_sequence == 28) avrdude: safemode read 1, hfuse value: 10 avrdude: stk500isp_read_byte(.., hfuse, 0x0, ...) avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [1d] . [00] . [11] . [18] . [04] X [58] . [08] . [00] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [1d] . [00] . [11] . [18] . [00] . [10] . [00] avrdude: jtag3_recv(): Got message seqno 29 (command_sequence == 29) avrdude: safemode read 2, hfuse value: 10 avrdude: stk500isp_read_byte(.., hfuse, 0x0, ...) avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [1e] . [00] . [11] . [18] . [04] X [58] . [08] . [00] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [1e] . [00] . [11] . [18] . [00] . [10] . [00] avrdude: jtag3_recv(): Got message seqno 30 (command_sequence == 30) avrdude: safemode read 3, hfuse value: 10 avrdude: safemode: hfuse reads as 10 avrdude: stk500isp_read_byte(.., efuse, 0x0, ...) avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] . [1f] . [00] . [11] . [18] . [04] P [50] . [08] . [00] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] . [1f] . [00] . [11] . [18] . [00] . [fe] . [00] avrdude: jtag3_recv(): Got message seqno 31 (command_sequence == 31) avrdude: safemode read 1, efuse value: fe avrdude: stk500isp_read_byte(.., efuse, 0x0, ...) avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] [20] . [00] . [11] . [18] . [04] P [50] . [08] . [00] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] [20] . [00] . [11] . [18] . [00] . [fe] . [00] avrdude: jtag3_recv(): Got message seqno 32 (command_sequence == 32) avrdude: safemode read 2, efuse value: fe avrdude: stk500isp_read_byte(.., efuse, 0x0, ...) avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: jtag3_send(): sending 7 bytes avrdude: Sent: . [0e] . [00] ! [21] . [00] . [11] . [18] . [04] P [50] . [08] . [00] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] ! [21] . [00] . [11] . [18] . [00] . [fe] . [00] avrdude: jtag3_recv(): Got message seqno 33 (command_sequence == 33) avrdude: safemode read 3, efuse value: fe avrdude: safemode: efuse reads as FE avrdude: safemode: Fuses OK (H:FE, E:10, L:DE) avrdude: jtag3_send(): sending 4 bytes avrdude: Sent: . [0e] . [00] " [22] . [00] . [11] . [11] . [01] . [01] avrdude: jtag3_recv(): avrdude: Recv: . [0e] " [22] . [00] . [11] . [11] . [00] avrdude: jtag3_recv(): Got message seqno 34 (command_sequence == 34) avrdude: stk500v2_jtag3_close() avrdude: jtag3_close() avrdude: Sending AVR sign-off command: avrdude: jtag3_send(): sending 3 bytes avrdude: Sent: . [0e] . [00] # [23] . [00] . [12] . [11] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] # [23] . [00] . [12] . [80] . [00] avrdude: jtag3_recv(): Got message seqno 35 (command_sequence == 35) Raw message: 12 80 00 [AVR] OK avrdude: Sending sign-off command: avrdude: jtag3_send(): sending 4 bytes avrdude: Sent: . [0e] . [00] $ [24] . [00] . [01] . [11] . [00] . [00] avrdude: jtag3_recv(): avrdude: Recv: . [0e] $ [24] . [00] . [01] . [80] . [00] avrdude: jtag3_recv(): Got message seqno 36 (command_sequence == 36) Raw message: 01 80 00 [general] OK avrdude done. Thank you. >>> When running at higher speeds, it always seems to read the fuses as 0xff $ avrdude -patmega256rfr2 -cjtag3isp -V -B1 -Ulock:w:0xcf:m avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.18s avrdude: Device signature = 0x1ea802 avrdude: reading input file "0xcf" avrdude: writing lock (1 bytes): Writing | ################################################## | 100% 0.00s avrdude: 1 bytes of lock written avrdude: safemode: lfuse changed! Was de, and is now ff Would you like this fuse to be changed back? [y/n] n avrdude: safemode: hfuse changed! Was 10, and is now ff Would you like this fuse to be changed back? [y/n] n avrdude: safemode: efuse changed! Was fe, and is now ff Would you like this fuse to be changed back? [y/n] n avrdude: safemode: Fuses OK (H:FE, E:10, L:DE) avrdude done. Thank you. >>> When explicitely reading the fuses after writing, they all read as 0xff. $ avrdude -patmega256rfr2 -cjtag3isp -V -u -B1 -Ulock:w:0xcf:m -Ulock:r:-:h -Ulfuse:r:-:h -Uhfuse:r:-:h -Uefuse:r:-:h -Ulfuse:r:-:h -Uhfuse:r:-:h -Uefuse:r:-:h avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.19s avrdude: Device signature = 0x1ea802 avrdude: reading input file "0xcf" avrdude: writing lock (1 bytes): Writing | ################################################## | 100% 0.00s avrdude: 1 bytes of lock written avrdude: reading lock memory: Reading | ################################################## | 100% 0.00s avrdude: writing output file "" 0xff avrdude: reading lfuse memory: Reading | ################################################## | 100% 0.00s avrdude: writing output file "" 0xff avrdude: reading hfuse memory: Reading | ################################################## | 100% 0.00s avrdude: writing output file "" 0xff avrdude: reading efuse memory: Reading | ################################################## | 100% 0.00s avrdude: writing output file "" 0xff avrdude: reading lfuse memory: Reading | ################################################## | 100% 0.00s avrdude: writing output file "" 0xff avrdude: reading hfuse memory: Reading | ################################################## | 100% 0.00s avrdude: writing output file "" 0xff avrdude: reading efuse memory: Reading | ################################################## | 100% 0.00s avrdude: writing output file "" 0xff avrdude done. Thank you. >>> But when slowing down the clock again, only the lock and lfuse read >>> incorrectly directly after writing the lock bits, after that everything >>> (including the second read of lock and lfuse) read correctly. This seems >>> to suggest that after writing the lock bits, no reading should happen for a >>> while? $ avrdude -patmega256rfr2 -cjtag3isp -V -u -B350 -Ulock:w:0xcf:m -Ulock:r:-:h -Ulfuse:r:-:h -Uhfuse:r:-:h -Uefuse:r:-:h -Ulfuse:r:-:h -Uhfuse:r:-:h -Uefuse:r:-:h -Ulock:r:-:h avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.19s avrdude: Device signature = 0x1ea802 avrdude: reading input file "0xcf" avrdude: writing lock (1 bytes): Writing | ################################################## | 100% 0.00s avrdude: 1 bytes of lock written avrdude: reading lock memory: Reading | ################################################## | 100% 0.00s avrdude: writing output file "" 0xff avrdude: reading lfuse memory: Reading | ################################################## | 100% 0.00s avrdude: writing output file "" 0xff avrdude: reading hfuse memory: Reading | ################################################## | 100% 0.00s avrdude: writing output file "" 0x10 avrdude: reading efuse memory: Reading | ################################################## | 100% 0.00s avrdude: writing output file "" 0xf6 avrdude: reading lfuse memory: Reading | ################################################## | 100% 0.00s avrdude: writing output file "" 0xde avrdude: reading hfuse memory: Reading | ################################################## | 100% 0.00s avrdude: writing output file "" 0x10 avrdude: reading efuse memory: Reading | ################################################## | 100% 0.00s avrdude: writing output file "" 0xf6 avrdude: reading lock memory: Reading | ################################################## | 100% 0.00s avrdude: writing output file "" 0xcf avrdude done. Thank you.