Go Down

Topic: Trouble burning bootloader to Atmega2561 (Read 6661 times) previous topic - next topic

CrossRoads

Ok, so ICSP header connects up:
MISO /TX pin 3,  1   2 +5
SCK         pin 11, 3   4  MOSI/RX pin 2
Reset      pin 20,  5   6 GND

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

So do I understand you correctly that SPI and Serial0 are usable (connectable to outside devices) at the same time?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

john1993

im not sure but i suspect once you enable uart other functions are overridden.  at least thats true on most other chips i worked on.

larryd

#17
Feb 20, 2016, 11:44 pm Last Edit: Feb 20, 2016, 11:45 pm by LarryD
 :smiley-confuse:

No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

john1993


larryd

#19
Feb 20, 2016, 11:47 pm Last Edit: Feb 21, 2016, 12:24 am by LarryD
Will you make up a DuPont serial programming cable then?
Add 2X16 female headers then use pre made Male DuPont programming cable when ISCP programming.
.
No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

CrossRoads

#20
Feb 21, 2016, 12:24 am Last Edit: Feb 21, 2016, 12:28 am by CrossRoads
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:
Code: [Select]

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:
Code: [Select]

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:
Code: [Select]

#------------------------------------------------------------
# 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.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

larryd

#21
Feb 21, 2016, 12:59 am Last Edit: Feb 21, 2016, 01:01 am by LarryD

No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

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.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

larryd

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. :(
No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

larryd

How about using Nicks program to add the bootloader to the board.
Add the 2561 to his pgm if it is not already there?
No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

CrossRoads

I looked earlier, 2561 isn't listed.  I sent a PM to westfw, I'll try Nick Gammon in a while.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

john1993

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.

larryd

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

Code: [Select]

  #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 },
No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

DrAzzy

#28
Feb 21, 2016, 02:29 am Last Edit: Feb 21, 2016, 03:23 am by DrAzzy
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.
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

larryd

#29
Feb 21, 2016, 02:58 am Last Edit: Feb 21, 2016, 03:00 am by LarryD
Quote
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



.

No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

Go Up