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?
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...?
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.
##############################################################
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.
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?
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:
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.
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:
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:
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:
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
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.
Hopefully, someone can help me in this thread.. I seem to have Bricked my Non-R3 MEGA2560... (crashed while trying to upload a EPROM reading program w2hich uses the upper DXX pins 22-53, Under LINUX, and I was holding the Reset button to force it to wait in standby while the code was compilng, otherwise, the already uploaded (running at a faster baud rate) was already running, and the Linux IDE would either say the port unavailable, or it would lock-up.)
Tools available to me: the 1.0.6 IDE (Both under Windows on a Win-7 laptop, and Linux version under UBUNTU)
The ArduinoISP (Sketch that comes with the IDE).
a set of male-to-female jumper wires.
Now, IS it possible, to use the Bootloader sketch, to burn (or in this case, re-write) the bootloader back to the 2560?
At present, the MEGA2560 is dormant.. (no response, no D13 flashes when powered-up). the USB-Serial chip is still
working, will echo if I jumper D0 to D1, still recognized as /dev/ttyACM0 under Linux, or COM29 under Windows 7.
The Arduino I'll be using as the ArduinoISP, is a clone Duemilinova (came with the JTag pins for the FT232R), but will be wiring via the pin-out from the Bootloader sketch. (13-10, 9-7 as the indicators sitting atop a Adafruit Protoboard)
Otherwise, only option would be buying as new MEGA2560. (and My financial status is LIMITED!)
So I can load the bootloader but I can not load a simple blink sketch. It just times out. I load the bootloader using an AVR Dragon and Atmel studio. The fuses look correct. This is a mega2560 with an external oscillator at 8mhz.
My TX0 and RX0 connections are good. Im kind of stumped.