arduino bootloader error

I have been trying to burn a bootloader to my atmega8 chip.
There are 2 questions

  1. Can I use atmega328 arduuino uno board to burn bootloader to atmega8?
  2. Does the following error make any sense to anyone?

Arduino: 1.6.5 (Windows 7), Board: "Arduino NG or older, ATmega8"

C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega8 -cstk500v1 -PCOM13 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:{bootloader.extended_fuses}:m -Uhfuse:w:0xca:m -Ulfuse:w:0xdf:m

avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58

Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

Using Port : COM13

Using Programmer : stk500v1

Overriding Baud Rate : 19200

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 : STK500

Description : Atmel STK500 Version 1.x firmware

Hardware Version: 2

Firmware Version: 1.18

Topcard : Unknown

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.05s

avrdude: Device signature = 0x1e9307

avrdude: erasing chip

avrdude: reading input file "0x3F"

avrdude: writing lock (1 bytes):

Error while burning bootloader.

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.02s

avrdude: verifying ...

avrdude: 1 bytes of lock verified

"efuse" memory type not defined for part "ATmega8"

avrdude done. Thank you.

Looks like an IDE bug. The IDE is trying to set the non-existent Extended fuse byte. You could try an older version of the IDE from back in the time when the Arduino NG was more common. I'd try 1.0.6.

Alternatively, you can learn to run avrdude directly. You can grab the commands from the verbose output and strip out the bad part:

C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.con -v -patmega8 -cstk500v1 -PCOM13 -b19200 -e -Ulock:w:0x3F:m -Uhfuse:w:0xca:m -Ulfuse:w:0xdf:m

... if John is correct (he has a wonderful track record) you could try an older version of the IDE... maybe go back as far as a year since the IDE is constantly being revised as part of a number of efforts.

Ray

This ide bug has been known for a while. Looking at how the hardware spec works for platform.txt and such, I don't see how this could be fixed without creating a separate core that used it's own platform.txt to specify a recipe for calling avrdude without specifying an extended fuse.

without creating a separate core

Now that separate cores are so much easier to make and install, perhaps that's how the (legacy) ATmega8 cpus should handled?

Thank you :slight_smile:

The GitHub issue for this is Write bootloader - problem on ATmega8 · Issue #2075 · arduino/Arduino · GitHub. IMO the best solution, which only requires an edit of avrdude.conf is described at Write bootloader - problem on ATmega8 · Issue #2075 · arduino/Arduino · GitHub. I have tested it and it works well. It could also be solved by creating a different avrdude tool in Arduino AVR Boards platform.txt(as explained at "efuse" memory type not defined for part "ATMEGA8" · Issue #2541 · arduino/Arduino · GitHub) but that adds a lot of clutter just for a single board so I think the avrdude.conf solution is much better.

Yes, I know this is an old thread but I had it on my issues to report list and just got to it. I've learned more about the issue in the meantime and thought I should update the thread.

I'm surprised that the Arduino team haven't done anything about this, even though this issue have been known for years!

The fix in the avrdude.conf was rather clever! I might incorporate that in MightyCore and MiniCore before the next releases :slight_smile: It's almost like cheating, but much more elegant than having two different avrdude options in the platform.txt file

Yes, I thought of you when I saw that solution because I have noticed your avrdudeCustom tool solution but I figured that your way works just as well so decided not to bring it up.