Arduino Bootloader uploading error

Hi all,

I have Arduino Mega 2560 board. I was working on a project yesterday. Everything was well the day before yesterday. But when yesterday I tried to upload the code, I was getting the error of timeout.

Then I searched on internet that it is due to wrong port selection so I uninstalled the driver and then reinstalled them. By choosing the same port, I was still getting that error. Then I again searched that if the LED is not blinking after choosing the correct port, then it might be a problem of bootloader so reinstall the bootloader program to micro.

So I am trying to install the boot loader program using USBasp ISP programmer over AVRDUDE GUI. But I am not getting done.

I have set all the fuses correctly, the baud rate is correct. But I am getting the application time out error. So I again searched on internet for that and got that I have to give external extra power supply to the Arduino board as it has been given the supply from USB and it is not sufficient. I have done it for standalone ATmega128 and I was succeed to solve this error before.

But for this, I do not know, where I should give the supply on board? I mean if I connect the 12V adapter to the DC socket that is given already in board, it gives 5V in output from 7805 regulator from board, so I am really confused that where I have to provide the 12V supply?

Please try to help to solve my problem of application timeout.

I have attached the image of error I am getting and following is the output of AVRDUDE GUI :

avrdude.EXE: AVR device initialized and ready to accept instructions

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

avrdude.EXE: Device signature = 0x1e9801
avrdude.EXE: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude.EXE: erasing chip
avrdude.EXE: reading input file “0xFF”
avrdude.EXE: writing lfuse (1 bytes):

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

avrdude.EXE: 1 bytes of lfuse written
avrdude.EXE: verifying lfuse memory against 0xFF:
avrdude.EXE: load data lfuse data from input file 0xFF:
avrdude.EXE: input file 0xFF contains 1 bytes
avrdude.EXE: reading on-chip lfuse data:

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

avrdude.EXE: verifying …
avrdude.EXE: 1 bytes of lfuse verified
avrdude.EXE: reading input file “0xD8”
avrdude.EXE: writing hfuse (1 bytes):

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

avrdude.EXE: 1 bytes of hfuse written
avrdude.EXE: verifying hfuse memory against 0xD8:
avrdude.EXE: load data hfuse data from input file 0xD8:
avrdude.EXE: input file 0xD8 contains 1 bytes
avrdude.EXE: reading on-chip hfuse data:

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

avrdude.EXE: verifying …
avrdude.EXE: 1 bytes of hfuse verified
avrdude.EXE: reading input file “0xFD”
avrdude.EXE: writing efuse (1 bytes):

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

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

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

avrdude.EXE: verifying …
avrdude.EXE: 1 bytes of efuse verified
avrdude.EXE: reading input file “F:\Softwares\arduino\arduino-1.0.6-windows\arduino-1.0.6\hardware\arduino\bootloaders\stk500v2\stk500boot_v2_mega2560.hex”
avrdude.EXE: input file F:\Softwares\arduino\arduino-1.0.6-windows\arduino-1.0.6\hardware\arduino\bootloaders\stk500v2\stk500boot_v2_mega2560.hex auto detected as Intel Hex
avrdude.EXE: writing flash (261406 bytes):

Writing | ##################### from here I am getting error and the program hangs up and then the prompt appears that I have attached here.

Please help me.

Thanks.
Chirag

You should not have to run AVRDUDE manually to burn a bootloader. That’s what the “Burn Bootloader” menu option is for.

Using USBasp ISP to Burn Bootloader

Step 1: CONNECT THE ISP TO THE TARGET BOARD

The Arduino has a 6-pin ICSP (In-Circuit Serial Programming?) header. The USBasp generally comes with a 10-pin cable which has four extra Ground pins. You will need an adapter to connect the 10-pin cable to the 6-pin header.

Pin 1 on the board is the top left pin when viewing the component side of the board with the labels right side up. Pin 1 on the cable is generally marked with a stripe on one edge of the ribbon cable and/or a mark on one corner of the connector. Plug in the cable so that the stripe is at the Pin 1 end of header.

ICSP Header Pinout:

1:MISO 2:VCC
3:SCK 4:MOSI
5:/RESET 6:GROUND

Step 2: READY TO BURN!

Now that you have everything wired you can attempt to burn a bootloader.

Note that even if you don’t plan to use the serial bootloader (using “Upload Using Programmer” instead) you still need to go through this process once on each processor to set the hardware configuration fuses. Factory fresh chips run at 1 MHz so if your Arduino is running VERY slow someone may have skipped this step.

  • Tools->Board->(select your target Arduino type)
  • If present in 1.6.x: Tools->Processor->(your target Arduino processor and speed)
  • Tools->Port->we don’t care
  • Tools->Programmer->USBasp
  • Tools->Burn Bootloader

If all has gone well: SUCCESS!

Step 3: TROUBLESHOOTING

If anything goes wrong, turn on verbose logging. Go to Preferences… and check the box for “Show verbose output during: compilation upload”

Error Type 1:

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

avrdude: Device signature = 0x1eXXXX
avrdude: Expected signature for ATmegaXXX is 1E XX XX
         Double check chip, or use -F to override this check.

That generally means that your target processor is not the right type for the Arduino board you selected in Step 2.

Error Type 2:

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

This is a symptom of the target chip’s clock not running. That almost never happens when burning to an Arduino board since the Arduino board has the necessary crystal or resonator. It is possible you have a chip with configuration fuses set to disable serial programming. To fix the fuses you will need something like the HV Rescue Shield 2 from MightyOhm (http://mightyohm.com/blog/products/hv-rescue-shield-2-x/). That uses High Voltage Serial Programming to reset your ATmega/ATtiny configuration fuses to factory defaults. If that doesn’t work your ATmega/ATtiny is probably damaged beyond use.

Error Type 3:

avrdude: verifying ...
avrdude: 1 bytes of lock verified

avrdude done.  Thank you.

That’s no error! That indicates SUCCESS!

Step 4: UPLOAD USING PROGRAMMER
Once you have the bootloader installed you can use the same wiring to upload sketches. Steps 1 through 3 are the same. In Step 4 you:

  • Tools->Board->(select your target Arduino type)
  • If present in 1.6.x: Tools->Processor->(your target Arduino processor and speed)
  • Tools->Port->we don’t care
  • Tools->Programmer->USBasp
  • Select the sketch you want to upload
  • File->Upload Using Programmer

NOTE: When you use “File->Upload Using Programmer” you are overwriting the bootloader. You will not be able to do a serial upload until you re-burn the bootloader as in the original Step 2.