Pages: [1]   Go Down
Author Topic: Atmega2560 bootloader hex file?  (Read 4387 times)
0 Members and 1 Guest are viewing this topic.
Nova Scotia
Offline Offline
Full Member
***
Karma: 4
Posts: 186
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Slovenia, Europe
Offline Offline
Full Member
***
Karma: 0
Posts: 103
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

USA
Offline Offline
Full Member
***
Karma: 2
Posts: 213
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Germany
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi guys,

is there a bootloader for the 2560V anywhere?
Logged

Wahiawa, Hawaii
Offline Offline
God Member
*****
Karma: 27
Posts: 582
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
##############################################################

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.

« Last Edit: June 09, 2013, 12:01:55 am by hiduino » Logged

Australia
Offline Offline
Sr. Member
****
Karma: 10
Posts: 393
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 435
Posts: 23597
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Australia
Offline Offline
Sr. Member
****
Karma: 10
Posts: 393
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: June 09, 2013, 07:59:47 pm by lemming » Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 106
Posts: 6364
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Australia
Offline Offline
Sr. Member
****
Karma: 10
Posts: 393
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
« Last Edit: June 09, 2013, 08:04:27 pm by lemming » Logged

Wahiawa, Hawaii
Offline Offline
God Member
*****
Karma: 27
Posts: 582
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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:
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!
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 435
Posts: 23597
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Try NickGammon's loaders instead.
http://www.gammon.com.au/scripts/forum.php?bbtopic_id=123
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: