Problems on flashing bootloader on custom Mega2560

Hi,

I am trying to upload the Arduino bootloader on a custom PCB with MEGA2560. The configuration of this board is minimal and is using the same scheme of official Arduino Mega2560.

IDE: Arduino 1.0.1 Programmer: Arduino Uno as ISP + ISP kit from Sparkfun http://www.sparkfun.com/products/11168 Target: Custom made ATMega2560 with 16Mhz oscillator.

I followed these steps:

1 - Upload the ArduinoISP sketch on the programmer 2 - Upload the bootloader on the target. I received this error:

avrdude: verification error, first mismatch at byte 0x1e000 0xff != 0x0d avrdude: verification error; content mismatch

After that, led 13 continuosly blinks 2 times and half second delay.

I also tried to:

  • Use 10uF cap on reset. Same error.
  • Change the IDE version (.022, 0.23)- Same Error
  • Use the ZIF socket to program a brand new ATmega328. It works with no problems. (programmer looks to work).
  • Ignore the error and tried to program a sketch. The upload finished without problems with every example sketch I tried, but the board does not work at all (every led is off and rx/tx does not work).

Any idea?

Thanks

Mirko

Mirko76: avrdude: verification error, first mismatch at byte 0x1e000 0xff != 0x0d avrdude: verification error; content mismatch

In my case that meant "You didn't disable auto-reset on the Arduino running ArduinoISP."

I'm a little surprised that ArduinoISP would work on an ATmega2560. The 2560 needs the STK500 V2 protocol to handle the larger memory size. If you are designing custom Arduino clones you should probably invest in a hardware ISP programmer. You can get the USBasp for under $10.

Hi John,

thanks for replying. I disabled autoreset on Arduino ISP.

0x1e000 is exactly 120KB... so, I suppose that the problem should be related to the STK500 V2 protocol and the larger memory size.

You are right about the programmer. I think to buy a Polulu USB AVR that should be able to manage STK500 V2 investing about $20.

Have a good day. Mirko

I have bootloaded a Mega2560 using my Uno. I followed this page.

http://www.gammon.com.au/forum/?id=11635

Confirmed, works well

i was to try tutorial from http://www.gammon.com.au/forum/?id=11635 i was download "Atmega_Board_Programmer" and place it on library folder of arduino. then i run arduino ide..open example "Atmega_Boot_Programmer"..but when i compile i get an error like this:

Atmega_Board_Programmer\md5.c.o: In function md5_starts': C:\Users\micosoft\Desktop\arduino-1.0.4\libraries\Atmega_Board_Programmer/md5.c:40: multiple definition ofmd5_starts' md5.c.o:C:\Users\micosoft\AppData\Local\Temp\build1166844666296615961.tmp/md5.c:40: first defined here Atmega_Board_Programmer\md5.c.o: In function md5_process': C:\Users\micosoft\Desktop\arduino-1.0.4\libraries\Atmega_Board_Programmer/md5.c:51: multiple definition ofmd5_process' md5.c.o:C:\Users\micosoft\AppData\Local\Temp\build1166844666296615961.tmp/md5.c:51: first defined here Atmega_Board_Programmer\md5.c.o: In function md5_update': C:\Users\micosoft\Desktop\arduino-1.0.4\libraries\Atmega_Board_Programmer/md5.c:174: multiple definition ofmd5_update' md5.c.o:C:\Users\micosoft\AppData\Local\Temp\build1166844666296615961.tmp/md5.c:174: first defined here Atmega_Board_Programmer\md5.c.o: In function md5_finish': C:\Users\micosoft\Desktop\arduino-1.0.4\libraries\Atmega_Board_Programmer/md5.c:221: multiple definition ofmd5_finish' md5.c.o:C:\Users\micosoft\AppData\Local\Temp\build1166844666296615961.tmp/md5.c:221: first defined here

what's wrong i'm doing?? please help...

testes88: i was to try tutorial from http://www.gammon.com.au/forum/?id=11635 i was download "Atmega_Board_Programmer" and place it on library folder of arduino. then i run arduino ide..open example "Atmega_Boot_Programmer"..but when i compile i get an error like this:

Atmega_Board_Programmer\md5.c.o: In function md5_starts': C:\Users\micosoft\Desktop\arduino-1.0.4\libraries\Atmega_Board_Programmer/md5.c:40: multiple definition ofmd5_starts' md5.c.o:C:\Users\micosoft\AppData\Local\Temp\build1166844666296615961.tmp/md5.c:40: first defined here Atmega_Board_Programmer\md5.c.o: In function md5_process': C:\Users\micosoft\Desktop\arduino-1.0.4\libraries\Atmega_Board_Programmer/md5.c:51: multiple definition ofmd5_process' md5.c.o:C:\Users\micosoft\AppData\Local\Temp\build1166844666296615961.tmp/md5.c:51: first defined here Atmega_Board_Programmer\md5.c.o: In function md5_update': C:\Users\micosoft\Desktop\arduino-1.0.4\libraries\Atmega_Board_Programmer/md5.c:174: multiple definition ofmd5_update' md5.c.o:C:\Users\micosoft\AppData\Local\Temp\build1166844666296615961.tmp/md5.c:174: first defined here Atmega_Board_Programmer\md5.c.o: In function md5_finish': C:\Users\micosoft\Desktop\arduino-1.0.4\libraries\Atmega_Board_Programmer/md5.c:221: multiple definition ofmd5_finish' md5.c.o:C:\Users\micosoft\AppData\Local\Temp\build1166844666296615961.tmp/md5.c:221: first defined here

what's wrong i'm doing?? please help...

you need to rename md5.c to md5.cpp and then you get error "onli"

md5.cpp: In function 'void md5_update(md5_context*, unsigned char*, long unsigned int)':
md5.cpp:191: error: 'memcpy' was not declared in this scope
md5.cpp:208: error: 'memcpy' was not declared in this scope

@sttaaannnnoooo,
Check the dates on posts you reply to. This one has been inactive for nearly a year.