Go Down

Topic: Burning bootloader on standalone Atmega328(internal clock 8MHz) (Read 42180 times) previous topic - next topic

Vilimerth

Hi there,

For the last couple of hours I was trying to burn bootloader on standalone Atmega328. I want to use 8Mhz internal clock instead of external 16MHz clock. As a guidelines, I followed below instructions:

http://arduino.cc/en/Tutorial/ArduinoToBreadboard
http://oddwires.blogspot.com/2012/06/burning-bootloader-into-bare-atmega328.html
http://phaq.phunsites.net/2013/09/12/use-arduino-micro-as-isp-with-atmega-on-a-breadboard/

The problem is that when I am trying to burn bootloader I am receiving following error message:
"Error while burning bootloader: missing 'bootloader.tool' configuration parameter"

None of the solutions which I could find solved my problem.

It looks like, that avaiable solutions apply for older version of the 'Arduino IDE' and they do not work with the latest IDE releases ( I was trying both: 1.6 and 1.6.1).

Any idea how to solve it?

I will be very grateful for help.

johnwasser

Sounds like the boards.txt entry you are using was not updated for Arduino 1.6.  Just before "{name}.bootloader.low_fuses=0xff" put "{name}.bootloader.tool=avrdude".

Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

Vilimerth

Thank you John,
I did as you said and I can see some progress - still not success but I have different error message.
This time it is:
"Could not find tool avrdude"
I was trying to google it, but without success. This how my 'boards.txt' file looks like:
##############################################################

atmega328bb.name=ATmega328 on a breadboard (8 MHz internal clock)

atmega328bb.upload.protocol=stk500
atmega328bb.upload.maximum_size=30720
atmega328bb.upload.speed=57600

atmega328bb.bootloader.tool=avrdude
atmega328bb.bootloader.low_fuses=0xE2
atmega328bb.bootloader.high_fuses=0xDA
atmega328bb.bootloader.extended_fuses=0x05
atmega328bb.bootloader.path=arduino:atmega
atmega328bb.bootloader.file=ATmegaBOOT_168_atmega328_pro_8MHz.hex
atmega328bb.bootloader.unlock_bits=0x3F
atmega328bb.bootloader.lock_bits=0x0F

atmega328bb.build.mcu=atmega328p
atmega328bb.build.f_cpu=8000000L
atmega328bb.build.core=arduino:arduino
atmega328bb.build.variant=arduino:standard


Any advice?


johnwasser

Looking at the ATtiny core for Arduino 1.6.x it looks like you have to use 'arduino:avrdude' instead of just 'avrdude' in your custom boards.txt files.  Sorry I did not know that before.

Without using a custom boards.txt file you can get the same effect (328p with internal clock) by treating your ATmega328p as a LilyPad Arduino board with an ATmega328 processor (Select Tools->Board->LilyPad Arduino, then Tools->Processor-> ATmega328)


Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

Vilimerth

John, every advice from you is taking me further, but I am still not quite there yet.
Now I have another error message:

'avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.

Error while burning bootloader.'

I can see this error in both cases: for LilyPad and for standalone Atmega 328 and on both IDE's: 1.6 and 1.6.1.

Do you have any idea what to do next?

mart256

I'd try with 1.0.6 IDE, 1.6 I recommend for Yun and Due.

johnwasser

Did you, by any chance, purchase an ATmega328 instead of the ATmega328P used in all the Arduinos?  The 'P' (Pico-power) version has a different signature.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

Budvar10

Did you, by any chance, purchase an ATmega328 instead of the ATmega328P used in all the Arduinos?  The 'P' (Pico-power) version has a different signature.
He should set to verbose output (in preferences) to obtain exact signature bytes. If it is zero or not.
Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

Vilimerth

 
Did you, by any chance, purchase an ATmega328 instead of the ATmega328P used in all the Arduinos?  The 'P' (Pico-power) version has a different signature.
No. I checked that and I have only ATmega328P. I am able to run my project with the external oscillator but I would like to shrink it, and that is why I need to use internal oscillator.

He should set to verbose output (in preferences) to obtain exact signature bytes. If it is zero or not.
I did it as well and this is what I am getting:

System wide configuration file is "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/AndrzejKonto/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/tty.usbmodem14211
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
         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  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 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 : 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 = 0x000000 (retrying)

Reading | ################################################## | 100% 0.06s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.05s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.


johnwasser

What model Arduino are you running the ArduinoISP sketch on?  One of the page you link to is for an Arduino Micro.

Did you select "Arduino as ISP" (not "ArduinoISP") from Tools->Programmer before selecting Tools->Burn Bootloader? 

"avrdude: Device signature = 0x000000"

That tends to indicate a wiring error.  The wiring will somewhat depend on which model Arduino you are using for ArduinoISP.  

Has the ATmega328P you are programming been set to expect a crystal?  If so you have to provide a crystal or an alternative clock.  Adafruit has an alternative version of ArduinoISP that uses Arduino Pin 9 for an 8 MHz clock output.  You can connect it to pin 9 (XTL1) of the ATmega.  https://github.com/adafruit/ArduinoISP
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

Vilimerth

What model Arduino are you running the ArduinoISP sketch on?  One of the page you link to is for an Arduino Micro.
I am running ArduinoISP sketch on UNO.

Did you select "Arduino as ISP" (not "ArduinoISP") from Tools->Programmer before selecting Tools->Burn Bootloader?
Yes


"avrdude: Device signature = 0x000000"

That tends to indicate a wiring error.  The wiring will somewhat depend on which model Arduino you are using for ArduinoISP. 
This is what I using for wiring: http://oddwires.blogspot.com/2012/06/burning-bootloader-into-bare-atmega328.html

Has the ATmega328P you are programming been set to expect a crystal?  If so you have to provide a crystal or an alternative clock.  Adafruit has an alternative version of ArduinoISP that uses Arduino Pin 9 for an 8 MHz clock output.  You can connect it to pin 9 (XTL1) of the ATmega.  https://github.com/adafruit/ArduinoISP
I have 3 ATmega 328P. Only one of them should be set to work with crystal and it works with crystal. The other 2  are new and it shouldn't work with external crystal but when I was trying burn bootloader on them I can see this:
 '  Oscillator      : Off'

so I am not so sure anymore.

Vilimerth

I tried to use 'https://github.com/adafruit/ArduinoISP' file.

- I enabled LOW_SPEED, and loaded it to the programmer.
- I connect Arduino pin 9 with with Atmega XTL1
- I switched to 'LilyPad Arduino'
- I tried to 'Burn Bootloader'

This is the error message I got:

'avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.04s

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 "/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/avr/bootloaders/atmega/ATmegaBOOT_168_atmega328_pro_8MHz.hex"
avrdude: writing flash (32652 bytes):

Writing | ################################################## | 100% 0.00s


avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x00
avrdude: stk500_cmd(): programmer is out of sync
Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.'

Vilimerth

After previouse attempt I loaded regular 'ArduinoISP' sketch, and with the Arduino pin 9 still contected to ATmega XTL1 I tried to burn bootloader again. In this case I recived below error message:

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.05s

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

Writing |  ***failed; 
################################################## | 100% 0.16s

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:

Error while burning bootloader.
Reading | ################################################## | 100% 0.02s

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

avrdude done.  Thank you.

johnwasser

That symptom looks like what I saw when I had not disabled auto-reset on the Arduino UNO running ArduinoISP.  The Arduino bootloader uses the same protocol as the ArduinoISP.  The bootloader will return the signature for an ATmega328P but then it will return 0 if you try to read memory or fuses.

Did you connect a 1 to10 uF capacitor from Reset (+) to Ground (-)?
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

Vilimerth

I tried with the capacitor and I have exactly the same errors like before...

Go Up