Trouble burning bootloader to Atmega2561

Ok,
Added a couple wirewrap wires, not too difficult since the headers will be there anyway. I typically plug on FTDI Basic for power, I don't want it's outputs interfering with the bootloader, so battery power used instead.


Bootloading was successful:

avrdude: verifying ...
avrdude: 261406 bytes of flash verified
avrdude: reading input file "0x0F"
avrdude: writing lock (1 bytes):

Writing | avrdude: Sent: . [1d] . [04] . [04] . [00] X [58] . [00] . [00] . [00] 
avrdude: Recv: . [1d] . [00] . [00] X [58] . [00] . [ff] . [00] 
avrdude: Sent: . [1d] . [04] . [04] . [00] . [ac] . [e0] . [00] . [cf] 
avrdude: Recv: . [1d] . [00] . [00] . [ac] . [e0] . [00] . [00] 
avrdude: Sent: . [1d] . [04] . [04] . [00] X [58] . [00] . [00] . [00] 
avrdude: Recv: . [1d] . [00] . [cf] X [58] . [00] . [ff] . [00] 
avrdude: Sent: . [1d] . [04] . [04] . [00] X [58] . [00] . [00] . [00] 
avrdude: Recv: . [1d] . [00] . [00] X [58] . [00] . [ff] . [00] 
avrdude: Sent: . [1d] . [04] . [04] . [00] X [58] . [00] . [00] . [00] 
avrdude: Recv: . [1d] . [00] . [00] X [58] . [00] . [cf] . [00] 
################################################## | 100% 0.01s

avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x0F:
avrdude: load data lock data from input file 0x0F:
avrdude: input file 0x0F contains 1 bytes
avrdude: reading on-chip lock data:

Reading | avrdude: Sent: . [1d] . [04] . [04] . [00] X [58] . [00] . [00] . [00] 
avrdude: Recv: . [1d] . [00] . [00] X [58] . [00] . [cf] . [00] 
################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of lock verified
avrdude: Sent: . [11] . [01] . [01] 
avrdude: Recv: . [11] . [00] 

avrdude done.  Thank you.

When I try to download tho, I get this:

avrdude: Device signature = 0x1e9801
avrdude: Expected signature for ATMEGA2561 is 1E 98 02
         Double check chip, or use -F to override this check.
avrdude: Send: . [1b] . [0a] . [00] . [03] . [0e] . [11] . [01] . [01] . [0d] 
avrdude: Recv: . [1b] 
avrdude: Recv: . [0a] 
avrdude: Recv: . [00] 
avrdude: Recv: . [02] 
avrdude: Recv: . [0e] 
avrdude: Recv: . [11] 
avrdude: Recv: . [00] 
avrdude: Recv: . [0c] 

avrdude done.  Thank you.

ATmega2561 0x1E 0x98 0x02 agrees with the datasheet.
Is my avrdude.conf incorrect?
Looks correct:

#------------------------------------------------------------
# ATmega2561
#------------------------------------------------------------

part
    id               = "m2561";
    desc             = "ATMEGA2561";
    signature        = 0x1e 0x98 0x02;
[code]

Bootloading showed the same,
avrdude: Device signature = 0x1e9802

[/code]
So where's 1e9801 coming from? Arrrgh.

So do I need a tweaked version of this file then?
mega2561.bootloader.file=stk500boot_v2_mega2560.hex
I don't know how else that signature is making it in.

CrossRoads:
So do I need a tweaked version of this file then?
mega2561.bootloader.file=stk500boot_v2_mega2560.hex
I don't know how else that signature is making it in.

Something left over from 2560 configuration is my guess.
I am out of my comfort zone. :frowning:

How about using Nicks program to add the bootloader to the board.
Add the 2561 to his pgm if it is not already there?

I looked earlier, 2561 isn't listed. I sent a PM to westfw, I'll try Nick Gammon in a while.

optiboot does not support chips >128k like m2561. to save space signatures are hard coded into the bootloaders during compile time and afaik m2561 not supported by make. too bad ide creators dont allow -F option which would solve about half the issues posted on this forum (MILLIONS of man hours).

these are just a couple reasons i personally avoid serial program upload in favor of isp.

Nick's board programming has this reference
{ { 0x1E, 0x98, 0x02 }, "ATmega2561", 256 * kb, 1 * kb },

  #if USE_ATMEGA2560
        atmega2560_bootloader_hex,// loader image
  #else
        0,
  #endif
        0x3E000,      // start address
  #if USE_ATMEGA2560
        sizeof atmega2560_bootloader_hex,
  #else
        0,
  #endif
        256,          // page size in bytes (for committing)
        0xFF,         // fuse low byte: external clock, max start-up time
        0xD8,         // fuse high byte: SPI enable, boot into bootloader, 8192 byte bootloader
        0xFD,         // fuse extended byte: brown-out detection at 2.7V
        0x2F },       // lock bits: SPM is not allowed to write to the Boot Loader section.

  { { 0x1E, 0x98, 0x02 }, "ATmega2561",  256 * kb,   1 * kb },

https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/bootloaders/stk500v2/stk500boot.c#L795-L811

The arduino2560 bootloader does not read the signature from the chip when requested - instead, the signature is hardcoded. I'd assume it was to save space, except that bootloader is not exactly written to reduce flash use....

Anyway, you just need to rebuild it for 2561.

Try this:

http://drazzy.com/e/espruino/etc/stk500boot_v2_mega2561.hex

that was built with the build options used with mega2560, but for the mega2561 - which I think is what you wanted? No idea if it works.

Wish I knew that earlier, I would have added some more jumper pads.

Déjà vu

http://forum.arduino.cc/index.php?topic=280143.0

.

Ok, getting closer. Used the 2561_hex from the old thread, but that pins_arduino.h has too many compile errors for missing ports. Using the one I edited compiles ok, but times out starting the serial transfer. Maybe a speed setting problem ...

john1993:
to save space signatures are hard coded into the bootloaders during compile time

DrAzzy:
bootloader does not read the signature from the chip when requested - instead, the signature is hardcoded. I'd assume it was to save space

Déjà vu :slight_smile:

Success!
This combination seems to work: pins_arduino.h and the 2561 hex from the other thread, which I couldn't attach.

mega2561.name=Arduino Mega 2561
mega2561.upload.protocol=wiring
mega2561.upload.maximum_size=258048
mega2561.upload.speed=115200
mega2561.bootloader.low_fuses=0xFF
mega2561.bootloader.high_fuses=0xD8
mega2561.bootloader.extended_fuses=0xFD
mega2561.bootloader.path=stk500v2
mega2561.bootloader.file=stk500boot_v2_m2561_16mhz.hex
mega2561.bootloader.unlock_bits=0x3F
mega2561.bootloader.lock_bits=0x0F
mega2561.build.mcu=atmega2561
mega2561.build.f_cpu=16000000L
mega2561.build.core=arduino
mega2561.build.variant=mega2561

Here's "blink" to you! Thanks for the help LarryD & john1993.

pins_arduino.h (9.2 KB)

I'm delighted to see a result in such a short time for you Bob, but also glad I followed this thread. I've learned a heap from your experience, words and links, thanks Geoff

I always liked George Peppard. More so as Banacek vs the A-Team tho.

Hi! can you please post a link to the atmega 2561 profile you had use in able to bootload your arduino 2561 ( hex files etc.). please?. It would be very helpful 'cause I have 20 pcs. of 2561 in my spare box I want to use it also to arduino ide. please, please I need help.

Boards.txt entry is in reply #32, and the .hex file is posted in one the replies as well. The key to success is that the SPI pins are not the ICSP pins as they are on many other chips (328, 1284, 2560).

Update: I got my 2561 bootloaded. I use the pins_arduino.h you edited in this thread and bootloader from avr developers.
though i have some error during the bootloading process, i can still download the sample blink sketch to my circuit.
I 've noticed it took 10 to 12 sec. before it start my program.

thanks so much CrossRoads! :slight_smile:

Did you try with
mega2561.bootloader.file=stk500boot_v2_m2561_16mhz.hex
from reply #28?
If I remember, I can post my copy of that when I get home tonight if it turns out to be different. Certainly doesn't 10-12 second to start the program,