Bootloader For Arduino Mega2560 PDF
Bootloader For Arduino Mega2560 PDF
Bootloader For Arduino Mega2560 PDF
The standard Arduino bootloader uses STK500 version 1 protocol. This protocol works fine up to chips that have
128 bytes of Flash.
After that it does not understand the extended addressing. Fortunately there is STK500v2 protcol
that can handle larger memory footprints.
I started with the wiring project stk500 v2 bootloader and modified it to work with the 2560.
It should be able to be made to work with any larger atmega cpu by modifiying the make file which is included with
the source.
NOTE: This ONLY applies to version 0019 and earlier. If you have 0020 you DO NOT NEED TO DO THIS.
Update eeprom.h
The current bootloader in the Arduino mega board has a little known fact that it has a monitor built in. It is not very
usable in that it has to be done with a program and cannot be used via a terminal because it uses binary commands.
In order
to access this "monitor" you have to open the serial port at 57600 baud and type "!!!" before it jumps to the
main program.
I have done the same thing in the new bootloader but it is a command prompt to allow you to look at the hardware
http://www.avr-developers.com/bootloaderdocs/index.html[18/05/2017 13:59:09]
Bootloader for Arduino Mega2560
and memory.
To access this monitor open up a serial port at 115200 and type "!!!" within 3 seconds.
This bootloader takes 8K memory and I have used almost every available byte. The monitor can be turned of but this
was designed for the atmega2560, atmega1280, and atmega128, all of which have plenty of flash memory space.
The monitor is VERY useful to test hardware. For example you can blink any port, you can look at flash, ram and
eeprom.
Sample output
http://www.avr-developers.com/bootloaderdocs/index.html[18/05/2017 13:59:09]
Bootloader for Arduino Mega2560
PORTJ
PORTK
PORTL
Arduino Bootloader>
Arduino Bootloader>R Dump RAM
0000 - 00 00 20 02 87 20 10 10 08 00 00 00 00 00 0E 00 .. .. ..........
0010 - 00 00 00 E3 00 00 20 00 2E 10 01 02 86 20 1E 00 ...... ...... ..
0020 - 00 00 00 80 80 80 00 00 00 07 00 00 03 00 00 00 ................
0030 - 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0040 - 00 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 62 ...............b
0050 - 30 00 62 00 07 00 62 00 62 62 62 07 01 86 20 02 0.b...b.bbb... .
0060 - 00 00 62 62 00 00 88 62 00 00 00 00 00 00 00 00 ..bb...b........
0070 - 00 00 00 00 00 00 62 62 00 00 00 00 00 00 00 00 ......bb........
0080 - 00 00 00 62 00 00 00 00 00 00 00 00 00 00 62 62 ...b..........bb
0090 - 00 00 00 62 00 00 00 00 00 00 00 00 00 00 62 62 ...b..........bb
00A0 - 00 00 00 62 00 00 00 00 00 00 00 00 00 00 62 62 ...b..........bb
00B0 - 00 00 00 00 00 62 00 62 00 F8 FE FF 00 00 62 62 .....b.b......bb
00C0 - 22 18 06 62 10 00 6C 62 20 00 06 62 00 00 00 62 "..b..lb ..b...b
00D0 - 20 00 06 62 00 00 00 62 62 62 62 62 62 62 62 62 ..b...bbbbbbbbb
00E0 - 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 bbbbbbbbbbbbbbbb
00F0 - 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 bbbbbbbbbbbbbbbb
Arduino Bootloader>
http://www.avr-developers.com/bootloaderdocs/index.html[18/05/2017 13:59:09]