Pages: [1]   Go Down
Author Topic: Unable to Write Fuses with ArduinoISP  (Read 1738 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OS: Windows 7 64-bit
ISP: ArduinoISP (via USB, COM4)
Chip used as programmer: Arduino UNO, ATmega328P
Chip being written to: Breadboard, ATmega328P, Internal clock (can't change until I can write fuses)

----------
Hello fellow Arduinoers, I was hoping for some help with a rather perplexing problem. I have built an ArduinoISP in accordance with website directions, but cannot write any fuses. Every time I try, regardless of which fuse I try to set, I get the same result:

Code:
C:\:P\bin>avrdude -p m328p -c arduino -P com4 -U efuse:w:0xfc:m

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e950f
avrdude: reading input file "0xfc"
avrdude: writing efuse (1 bytes):

Writing |                                                    | 0% 0.00s ***faile
d;
Writing | ################################################## | 100% 0.06s

avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0xfc:
avrdude: load data efuse data from input file 0xfc:
avrdude: input file 0xfc contains 1 bytes
avrdude: reading on-chip efuse data:

Reading | ################################################## | 100% 0.01s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
         0xfc != 0x00
avrdude: verification error; content mismatch

avrdude: safemode: efuse changed! Was fc, and is now 0
Would you like this fuse to be changed back? [y/n] y
avrdude: stk500_cmd(): programmer is out of sync

C:\WinAVR-20100110\bin>avrdude -p m328p -c arduino -P com4 -b19200 -U efuse:w:0x
fc:m
avrdude: stk500_getsync(): not in sync: resp=0x00

avrdude done.  Thank you.


C:\WinAVR-20100110\bin>avrdude -p m328p -c arduino -P com4 -U efuse:w:0xfc:m

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e950f
avrdude: reading input file "0xfc"
avrdude: writing efuse (1 bytes):

Writing |                                                    | 0% 0.00s ***faile
d;
Writing | ################################################## | 100% 0.06s

avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0xfc:
avrdude: load data efuse data from input file 0xfc:
avrdude: input file 0xfc contains 1 bytes
avrdude: reading on-chip efuse data:

Reading | ################################################## | 100% 0.01s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
         0xfc != 0x00
avrdude: verification error; content mismatch

avrdude: safemode: efuse changed! Was fc, and is now 0
Would you like this fuse to be changed back? [y/n] y
avrdude: stk500_cmd(): programmer is out of sync

That however is not the perplexing part. I know my ArduinoISP is working, as the signature reads correctly and it will cheerfully accept any flash writes I want to throw at it.

Code:
C:\ :P\bin>avrdude -p m328p -c arduino -P com4 -U flash:w:"c:\<some_path>.cpp.hex":i

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e950f
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: reading input file "c:\<some_path>.cpp.hex"
avrdude: writing flash (7392 bytes):

Writing | ################################################## | 100% 1.59s

avrdude: 7392 bytes of flash written
avrdude: verifying flash memory against c:\<some_path>.cpp.hex:
avrdude: load data flash data from input file c:\<some_path>.cpp.hex:
avrdude: input file c:\<some_path>.cpp.hex contains 7392 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 1.26s

avrdude: verifying ...
avrdude: 7392 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

Mighty Google has turned up nothing, as has a search of the forums. Any assistance would be greatly appreciated!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Wanted to provide a little more info:

Code:
C:\:P\bin>avrdude -p m328p -c arduino -P com4 -v

avrdude: Version 5.10, compiled on Jan 19 2010 at 10:45:23
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\:P\bin\avrdude.conf"


         Using Port                    : com4
         Using Programmer              : arduino
         AVR Part                      : ATMEGA328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         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  Max
W   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
           eeprom        65     5     4    0 no       1024    4      0  3600  36
00 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  45
00 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  45
00 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  45
00 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  45
00 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  45
00 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0
 0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0
 0 0x00 0x00

         Programmer Type : Arduino
         Description     : Arduino
         Hardware Version: 3
         Firmware Version: 4.4
         Vtarget         : 0.3 V
         Varef           : 0.3 V
         Oscillator      : 28.800 kHz
         SCK period      : 3.3 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e950f
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0

avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: safemode: Fuses OK

avrdude done.  Thank you.

The memory reads as intact, yet the fuse readings are clearly wrong, as the reset and SPI interfaces are enabled. Again, anything anyone can do to help would be greatly appreciated!
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 210
Posts: 13039
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Change -v to -v -v -v -v and post the results.
Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 137
Posts: 6792
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
C:\smiley-razz\bin>avrdude -p m328p -c arduino -P com4 -U efuse:w:0xfc:m
Since you haven't stepped the speed down to 19200 that ArduinoISP uses, I suspect that you have not disabled autoreset on the programmer arduino.  This leads to avrdude talking to the arduino bootloader, rather than to Arduino ISP.  The Arduino bootloader returns 0 for all fuse requests, and cant changes its own fuses anyway.

You can try:  avrdude -p m328p -c arduino -P com4  -b19200  efuse:w:0xfc:m
Logged

Pages: [1]   Go Up
Jump to: