Go Down

Topic: Atmega2560 bootloader hex file? (Read 6395 times) previous topic - next topic

0miker0

I have an Atmega2560 on a protoboard and i'm looking for the correct bootloader. The bootloader folder in my arduino directory only has the stk500boot_v2_mega2560.hex file located in the stk500v2 folder. Is this the correct one? Do the fuse bits below look correct?

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

mega2560.name=Arduino Mega 2560

mega2560.upload.protocol=stk500v2
mega2560.upload.maximum_size=258048
mega2560.upload.speed=115200

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

mega2560.build.mcu=atmega2560
mega2560.build.f_cpu=16000000L
mega2560.build.core=arduino

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

Thanks,
Mike

Odisej

I'd like to add a question regarding atmega 2560 chip. Has anyone tryed to use 2560V version? Should it work with the same bootloader and diferent fuse settings (8MHz) or...?

Regards,

Peter

Mark S

Yes that is the right bootloader, but dont use that one. It has a bug in (I wrote it).

The bug is any sketch with "!!!" will hang the bootloader

I have tried to attach the new bootloader hex file but it gives me a "Folder full" error

send me a pm with your email address and I will send you the updated file


Mark

konfu

Hi guys,

is there a bootloader for the 2560V anywhere?

hiduino

#4
Jun 09, 2013, 06:55 am Last Edit: Jun 09, 2013, 07:01 am by hiduino Reason: 1
The IDE v1.0.4 or v1.0.5, \hardware\arduino\bootloaders\stk500v2\stk500boot_v2_mega2560.hex should be the latest corrected bootloader file.

Also you can use the same bootfile for the meag2560 or mega2560V @ 8MHz and 57600 baud.  Just create a new boards.txt entry for it.  The mega2560 and mega2560V have the same support, only the max clock speed and voltage ratings are different.
Code: [Select]

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

mega2560b576.name=Arduino Mega 2560 or Mega ADK (8MHz Internal, Baud=57.6K)

mega2560b576.upload.protocol=wiring
mega2560b576.upload.maximum_size=258048
mega2560b576.upload.speed=57600

mega2560b576.bootloader.low_fuses=0xE2
mega2560b576.bootloader.high_fuses=0xD8
mega2560b576.bootloader.extended_fuses=0xFD
mega2560b576.bootloader.path=arduino:stk500v2
mega2560b576.bootloader.file=stk500boot_v2_mega2560.hex
mega2560b576.bootloader.unlock_bits=0x3F
mega2560b576.bootloader.lock_bits=0x0F

mega2560b576.build.mcu=atmega2560
mega2560b576.build.f_cpu=8000000L
mega2560b576.build.core=arduino:arduino
mega2560b576.build.variant=arduino:mega

Note: this is for 8MHz internal clocking.

Change the low_fuses to 0xFF for 8 MHz external clocking.


lemming

Isn't the standard bootloader compiled for 16Mhz while the 2560V will be running at 8 Mhz: i.e the standard bootloader won't work even if you modify boards.txt?

CrossRoads

Code: [Select]
mega2560b576.build.f_cpu=8000000L
This takes care of the 8/16MHz
Other fuse settings may have been tweaked, compare the prior post against the Mega2560 settings.
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.

lemming

#7
Jun 10, 2013, 02:53 am Last Edit: Jun 10, 2013, 02:59 am by lemming Reason: 1
Does this mean arduino bootloaders will work at any speed without recompiling?
I thought the boards entry just fixed the millis() timing.

With custom 328 boards I have not been able to boot them at 8Mhz with the standard bootloader. I had to use the Lilypad 8Mhz one instead.

westfw

Quote
Does this mean arduino bootloaders will work at any speed without recompiling?

Yes, if you adjust the upload.speed as well.  If you take a bootloader that uploads at 115200bps when running at 16MHz, it should work fine uploading at 57600bps when running at 8MHz.
Changing to clock frequencies that result in non-standard bitrates (say, running at 10MHz, yielding 72000bps) might be more of a challenge, depending on the pickyness of your app/os/driver/serial chip.

lemming

#9
Jun 10, 2013, 03:01 am Last Edit: Jun 10, 2013, 03:04 am by lemming Reason: 1
Why do they bother putting different bootloaders into the IDE with different speed arduinos using te same chip?

If you set the fuses for 8Mhz with 8 x divisor, I take it your would divide the baud rate by 16?

hiduino


If you set the fuses for 8Mhz with 8 x divisor, I take it your would divide the baud rate by 16?


If the bootloader was built for 16MHz and 115200 baud, then yes, you would divide by 16, but that would result in a 7200 baud rate.  Not quite standard.


vanweric

I am also using the stk500boot_v2_mega2560 on a 2560V running on 3.3V at 8MHz.  I am programming this with an AVRISP mkii It was working beautifully until my code size grew past about 21kBytes.  When my hex size is less than that critical size, it works perfectly.  Going above that gives me verification errors, such as:
Quote
avrdude: verification error, first mismatch at byte 0x14454
         0xff != 0x00
avrdude: verification error; content mismatch


I can force the issue by artifically inflating program size across that boundary, using code such as:
Code: [Select]

int filler[8000] = {3};
filler[5] = 7;


The confusing portion of this is that I can no longer program the bootloader, and receive similar errors when I attempt to do so.

Here is the relevant portion of my boards.txt file:
Code: [Select]
mega2560_3v3.name= ATmega2560v 3v3

mega2560_3v3.upload.protocol=wiring
mega2560_3v3.upload.maximum_size=258048
mega2560_3v3.upload.speed=57600

mega2560_3v3.bootloader.low_fuses=0xFF
mega2560_3v3.bootloader.high_fuses=0xD8
mega2560_3v3.bootloader.extended_fuses=0xFE
mega2560_3v3.bootloader.path=arduino:stk500v2
mega2560_3v3.bootloader.file=stk500boot_v2_mega2560.hex
mega2560_3v3.bootloader.unlock_bits=0x3F
mega2560_3v3.bootloader.lock_bits=0x0F

mega2560_3v3.build.mcu=atmega2560
mega2560_3v3.build.f_cpu=8000000L
mega2560_3v3.build.core=arduino
mega2560_3v3.build.variant=arduino:mega


My arduino environment is version 1.0.5.  I do not have any instances of "!!!" in the code.

Any ideas how to push down larger code sizes?

Thank you!

CrossRoads

Try NickGammon's loaders instead.
http://www.gammon.com.au/scripts/forum.php?bbtopic_id=123
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.

arxwjh

#13
Sep 01, 2014, 10:59 am Last Edit: Sep 01, 2014, 11:06 am by arxwjh Reason: 1

Yes that is the right bootloader, but dont use that one. It has a bug in (I wrote it).

The bug is any sketch with "!!!" will hang the bootloader

I have tried to attach the new bootloader hex file but it gives me a "Folder full" error

send me a pm with your email address and I will send you the updated file


Mark



I have the same problem, i made a bord using a mega2560, and i always met some errors caused by the stk500v2_mega2560 i guess, cause i checked the other parts of the bord. So, i want a stable version about the bootloader, thanks a lot.
My email address: arbalest.micheal@gmail.com
btw, my IDE version is 1.5.7

westfw

Mark's message is from several years ago.  The "!!!" fix has been in the bootloader sourcecode that's distributed with the Arduino IDE (hardware/arduino/avr/bootloaders/stk500v2/stk500boot/*)  I think the .hex file there is recent as well.

Unfortunately, I don't think that "they" have updated the version that is loaded into the actual MEGA boards.

Go Up