error loading bootlader on stand alone ATMEGA8A-PU

Hi!

I'm trying to use a ATMEGA8A-PU for one project using the internal clock.

I'm using one arduino nano as ISP, using this tutorial

For configure my boards.txt I'm use the values and the bootloader at this guide.

Arduino IDE not provide too much information so I execute arvdude directly... this should work...

avrdude -Cavrdude.conf -c arduino -b 19200 -patmega8 -P /dev/ttyUSB0 -u -Ulock:w:0x3F:m -v
avrdude -Cavrdude.conf -c arduino -b 19200 -patmega8 -P /dev/ttyUSB0 -u -U hfuse:w:0xc4:m -v 
avrdude -Cavrdude.conf -c arduino -b 19200 -patmega8 -P /dev/ttyUSB0 -u -U lfuse:w:0xe4:m -v 
avrdude -Cavrdude.conf -c arduino -b 19200 -patmega8 -P /dev/ttyUSB0 -U flash:w:ATmegaBOOT.hex -v 
avrdude -Cavrdude.conf -c arduino -b 19200 -patmega8 -P /dev/ttyUSB0 -U lock:w:0x3F:m -v

But I have some problems..
ATMega signature on avrdude.conf is = 0x1e 0x93 0x07 but in my chip is 0x1e 0x95 0x0F.
I have modify the avrdude.conf.

But after the change, still failing...

$ avrdude -Cavrdude.conf -c arduino -b 56700 -patmega8 -P /dev/ttyUSB0 -B8 -e -Ulock:w:0x3F:m -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 "avrdude.conf"
         User configuration file is "/home/Carlos/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyUSB0
         Using Programmer              : arduino
         Overriding Baud Rate          : 56700
         Setting bit clk period        : 8.0
avrdude: serial_baud_lookup(): Using non-standard baud rate: 56700         AVR Part                      : ATmega8
         Chip Erase delay              : 10000 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  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom         4    20   128    0 no        512    4      0  9000  9000 0xff 0xff
           flash         33    10    64    0 yes      8192   64    128  4500  4500 0xff 0x00
           lfuse          0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
           lock           0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
           calibration    0     0     0    0 no          4    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: 2
         Firmware Version: 1.16
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: erasing chip
avrdude: reading input file "0x3F"
avrdude: writing lock (1 bytes):

Writing |                                                    | 0% 0.00s ***failed;  
Writing | ################################################## | 100% 0.02s

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: verification error, first mismatch at byte 0x0000
         0x00 != 0x3f
avrdude: verification error; content mismatch

avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: Fuses OK (H:FF, E:00, L:00)

avrdude done.  Thank you.

I'm not sure what means this...

avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: Fuses OK (H:FF, E:00, L:00)

It's my chip OK, the values (H:FF, E:00, L:00) are normal?
How I can flash the bootloader on this chip?

avrdude -Cavrdude.conf -c arduino -b 19200 -patmega8 -P /dev/ttyUSB0 -u -Ulock:w:0x3F:m -v

avrdude -Cavrdude.conf -c arduino -b 56700 -patmega8 -P /dev/ttyUSB0 -B8 -e -Ulock:w:0x3F:m -v

OK... Which one are you actually USING?

ATMega signature on avrdude.conf is = 0x1e 0x93 0x07 but in my chip is 0x1e 0x95 0x0F.
I have modify the avrdude.conf.

1E950F is an ATmega328P, which probably means that you're using the second avrdude command, and are talking to the Nano bootloader instead of the arduinoISP sketch. Running at 19200bps is supposed to prevent that from happening, but it can be better to disable the autoreset (on the nano) with hardware hacks (10uF cap between RESET and GND, for example.)

Changing avrdude.conf was a bad idea, and you should change it back.

The strange results you're getting in fuse value verification are probably because the bootloader doesn't support reading the actual fuse values...

Opps :roll_eyes:

I have tested so many thinks and I have mixed results in the copy/paste
I have reverted the changes at avrdude.conf and arduino ISP script (come back to 19200)

$ avrdude -Cavrdude.conf -b 19200 -c arduino -p atmega8 -P /dev/ttyUSB0 -B8 -e -U lock:w:0x3F:m -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 "avrdude.conf"
         User configuration file is "/home/Carlos/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyUSB0
         Using Programmer              : arduino
         Overriding Baud Rate          : 19200
         Setting bit clk period        : 8.0
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x15
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x15
         AVR Part                      : ATmega8
         Chip Erase delay              : 10000 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  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom         4    20   128    0 no        512    4      0  9000  9000 0xff 0xff
           flash         33    10    64    0 yes      8192   64    128  4500  4500 0xff 0x00
           lfuse          0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
           lock           0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
           calibration    0     0     0    0 no          4    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : Arduino
         Description     : Arduino

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x14

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x02

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x10
         Hardware Version: 4240378
         Firmware Version: 6714016.0
         Topcard         : STK502
         Vtarget         : 1.8 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: stk500_initialize(): (b) protocol error, expect=0x10, resp=0x01
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x10

avrdude done.  Thank you.

I'm looking for one 10uF capacitor as requested, and I'll update the post with the progress.

Thanks!