Can't upload to ATMEGA 2560V-8AU

I backed a Kickstarter project a couple years back, the project ended up flopping in the end but they still made good on the hardware but it's useless without their website to drive it. I'm wanting to reprogram it myself to make the hardware useful but can't seem to get connected to it.

It's driven by an AT MEGA 2560V-8AU but I can't seem to push any code to it.

I'm plugged into it with a 5V FTDI breakout board. If I try to upload any code, it says:

avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer

Attempting to burn Bootloader with AVRISP mkII I get:

avrdude: usbdev_open(): did not find any USB device "usb"

Attempting to burn Bootloader with Arduino ISP I get:

avrdude: stk500_getsync(): not in sync: resp=0xbd

Here's the GitHub page for their firmware. LINK

Here's the parts list for the hardware. LINK

Tried on OS X 10.10 and Windows 8.1.
Arduino 1.0.6

Any help is greatly appreciated.

Attempting to burn Bootloader with AVRISP mkII I get:

avrdude: usbdev_open(): did not find any USB device "usb"

Do you actually HAVE an AVRISP programmer? The above error indicates an error prior to actually involving the target chip? The other errors are consistent with not having a bootloader.

Hah! I'm obviously new at this...I just realized those are hardware programmers....not software programmers. So, I have an Arduino Uno, can I use that to program a 2560 or do you need to program from the same kind of chip? Or do you suggest something else? Thanks for your guidance.

Putting a bootloader on a 2560 is somewhat problematic, since many of the available programmers don't support devices with more than 128k of flash.

Your best bet is probably Nick Gammon's bootloader-programming utility: Gammon Forum : Electronics : Microprocessors : Atmega bootloader programmer

Thanks, I’ll pursue that.

Ok, I used Nick Gammon's programmer and loaded it onto my Uno. I programmed the ATMEGA2560 and it verified successfully afterwards.

Now if I try to upload any sketch to the 2560 I get the following error.

avrdude: verification error, first mismatch at byte 0x0078
         0xe5 != 0xe4
avrdude: verification error; content mismatch

Seems the bytes can vary each time. Any ideas? Thanks!

What is the system clock speed of your ATMEGA 2560V-8AU equipped board?
8 MHz?
You'll likely need to define a new boards.txt entry with the slower clock speed.
Find the file /Arduino/hardware/arduino/boards.txt and add a new section something like this, assuming an external 8 MHz crystal - if using the internal 8 MHz clock source the fuses will need some changes:

############################################################

mega2560_8MHz.name=Arduino Mega 2560 8 MHz

mega2560_8MHz.upload.protocol=wiring
mega2560_8MHz.upload.maximum_size=258048
mega2560_8MHz.upload.speed=115200

mega2560_8MHz.bootloader.low_fuses=0xFF
mega2560_8MHz.bootloader.high_fuses=0xD8
mega2560_8MHz.bootloader.extended_fuses=0xFD
mega2560_8MHz.bootloader.path=stk500v2
mega2560_8MHz.bootloader.file=stk500boot_v2_mega2560.hex
mega256_8MHz0.bootloader.unlock_bits=0x3F
mega2560_8MHz.bootloader.lock_bits=0x0F

mega2560_8MHz.build.mcu=atmega2560
mega256_8MHz0.build.f_cpu=8000000L
mega256_8MHz0.build.core=arduino
mega2560.build.variant=mega

############################################################

The parts list of the hardware lists a 16 MHz Crystal so I can only assume that's what it is. Here's the list of the hardware. Link

It won't hurt anything to try at 8 MHz though, right?

No, you can change the crystal to an 8 MHz part.
Or the internal 8 MHz oscillator, that's just a fuse change.
Do you have a programmer? I recommend Atmel AVR ISP MKii, it's what I use for all my programming.
Burn the bootloader first to set the fuses per boards.txt settings, then
File:Upload Using Programmer to load the sketch with no bootloader, or
use a USB/Serial module to upload via the serial port (Rx/Tx on D0/D1).

Please run my chip detector sketch then copy and paste the output here.

The standard bootloader expects to operate at 16 MHz.

If you are getting varying results it sounds a bit like hardware. What cables are you using for programming? What FTDI board? I presume you are getting further than in your first post?

Does the target board have decoupling capacitors?

http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

The byte mismatch is consistent when I keep trying to upload the same sketch. It varies with each sketch though.

I'm using a Sparkfun STDI Basic 5V with a mini-usb cable.

Hmm, I'm seeing in the parts list that is has a 3.3V Voltage Regulator, MIC5219-3.3YM5. Could it be as simple as I need to be using a 3.3V FTDI Breakout board??

I'm not sure about the decoupling capacitors.

I think I'm getting further, at least it appears to be trying to do something now instead of just communication errors. :slight_smile:

Here's the output of the board detector, had to cut off most of the bootloader due to length, let me know if you needed that. Thanks!

Atmega chip detector.
Written by Nick Gammon.
Version 1.12
Compiled on Feb 21 2015 at 18:50:39
Attempting to enter programming mode ...
Entered programming mode OK.
Signature = 1E 98 01 
Processor = ATmega2560
Flash memory size = 262144 bytes.
LFuse = FF 
HFuse = D8 
EFuse = FD 
Lock byte = EF 
Clock calibration = A5 
Bootloader in use: Yes
EEPROM preserved through erase: No
Watchdog timer always on: No
Bootloader is 8192 bytes starting at 3E000

Bootloader:

3E000: 0D 94 89 F1 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 
3E010: 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 
3E020: 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 
3E030: 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 
3E040: 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 
3E050: 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 
3E060: 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 
3E070: 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 
3E080: 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 
3E090: 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 
3E0A0: 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 
3E0B0: 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 
3E0C0: 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 
3E0D0: 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 
3E0E0: 0D 94 B2 F1 41 54 6D 65 67 61 32 35 36 30 00 41 
............................................
Too long to post it all. Let me know if relevant.

MD5 sum of bootloader = 12 AA 80 07 4D 74 E3 DA BF 2D 25 84 6D 99 F7 20 
Bootloader name: atmega2560_bootloader_watchdog_bug_fixed

First 256 bytes of program memory:

0: 72 C0 00 00 9A C0 00 00 98 C0 00 00 96 C0 00 00 
10: 94 C0 00 00 92 C0 00 00 90 C0 00 00 8E C0 00 00 
20: 8C C0 00 00 8A C0 00 00 88 C0 00 00 86 C0 00 00 
30: 84 C0 00 00 82 C0 00 00 80 C0 00 00 7E C0 00 00 
40: 7C C0 00 00 7A C0 00 00 78 C0 00 00 76 C0 00 00 
50: 74 C0 00 00 72 C0 00 00 70 C0 00 00 D5 C6 00 00 
60: 6C C0 00 00 C8 C0 00 00 16 C2 00 00 66 C0 00 00 
70: 64 C0 00 00 62 C0 00 00 60 C0 00 00 5E C0 00 00 
80: 5C C0 00 00 5A C0 00 00 58 C0 00 00 56 C0 00 00 
90: F2 C0 00 00 3F C2 00 00 50 C0 00 00 4E C0 00 00 
A0: 4C C0 00 00 4A C0 00 00 48 C0 00 00 46 C0 00 00 
B0: 44 C0 00 00 42 C0 00 00 40 C0 00 00 3E C0 00 00 
C0: 3C C0 00 00 3A C0 00 00 38 C0 00 00 14 C1 00 00 
D0: 60 C2 00 00 32 C0 00 00 4E C1 00 00 99 C2 00 00 
E0: 2C C0 00 00 7A 04 11 24 1F BE CF EF D1 E2 DE BF 
F0: CD BF 00 E0 0C BF 12 E0 A0 E0 B2 E0 EC E3 F0 E1

The sumcheck matches the bootloader, so clearly you have the bootloader there.

The fuses are set for an external crystal. If you have a 16 MHz one that should be fine.

Hmm, I'm seeing in the parts list that is has a 3.3V Voltage Regulator, MIC5219-3.3YM5. Could it be as simple as I need to be using a 3.3V FTDI Breakout board??

What is the supply voltage for your board?

Does your sketch have "???" in it somewhere?

I'm not sure about the decoupling capacitors.

Your board should have 0.1 µF capacitors between +5V (or whatever Vcc is) and Gnd in a number of places.

Now that I'm looking at this closer, I can see it has a PS-05-5V Power Supply that goes to a small board with the 3.3V regulator on it.

I'm just trying to upload a basic communication sketch ASCIITable, or Blink, or Bare Minimum.

The caps are all so small on this thing I can't really tell what any of them are, but I do see in the parts list that it has 6 x 0.1µF capacitors.

Here's a picture of what I'm looking at.

I'm not sure why you are getting those errors, but you know you can program using the ICSP interface. If you have an SD card breakout board you could use my hex programmer sketch ( Gammon Forum : Electronics : Microprocessors : Atmega chip stand-alone programmer to upload .hex files) or get an ICSP programmer and program using that from the IDE.

Ok, I guess the SD Card Breakout and your uploader would be the cheapest way to go. I'll order one and see how it goes.

Thanks for your help!

Ok, more info....I just realized that even though it's spitting out those avrdude: verification errors, it's actually uploading the sketch! At least part of it...I uploaded the ASCIITable sketch and it outputs.

ASCII Table ~ Character Map
!, dec: 33, hex: 21, oct: 41, bincô

and that's followed by a bunch of block symbols that scrolls off the screen.

I uploaded the original device firmware and it seems to spit out all relevant information in the serial monitor...but it concerns me that the upload always ends in a avrdude: verification error, and I don't think that ASCII Table output is complete....

Nevermind! I put it in 9600 baud and the ASCII Table prints out the expected output…

Should I just ignore the avrdude errors?