Go Down

Topic: Has anyone EVER uploaded more than 30k sketch to a Mega 2560 or ADK? (Read 2 times) previous topic - next topic


I have my IDE set to the Arduino ADK and I have the appropriate port set.

Are you quite sure of this? The IDE tells you its configuration in the green stripe at the bottom.

There could also be an installation problem, although the symptoms don't obviously point to that. I think I have some silly newbie installation problem with the latest IDE on a laptop, but I have never gotten round to looking at it.


The assorted REPRAP firmwares that run on MEGA exceed 30k.
Most people have managed to get them to work, I think.


Jan 29, 2013, 12:30 am Last Edit: Jan 29, 2013, 05:29 am by Jeepdude2009 Reason: 1
Still no resolution.

New Bootloader: OK, today I tried out the tutorial on using an UNO to program my mega ADK...I followed the wiring diagram on the Arduino site using pins 10, 11, 12 and 13 as opposed to the one on Adafruit and elsewhere that use the ICSP pins.

I downloaded the ROBOTC bootloader hex for the mega/ADK and gave that a try (after placing it in the appropriate /hardware/arduino/bootloaders folder).

But all I get is the infamous AVRDUDE: Yikes invalid device signature message.  

Trying to prove the 30k limit:
In order to rule out anything in my code, I tried a very simple sketch which consisted of nothing in the setup or loop function and contained ONLY String (capital S) declarations at the global level.
I grabbed a book from the Gutenberg project and threw it into those String declarations.

I could upload the sketch as long as it was under 30k...add one more String declaration and whammy - it failed.  So this clearly ruled out anything I had in my actual code.

Trying to rule out the ADK (as opposed to the regular Mega):
Frustrated, I went to Radio Shack and bought a regular Mega (not an ADK).  Guess what?  Same exact issue - nothing greater than 30k will upload to it.

My last ditch option is that I ordered an actual Atmel AVR ISP programmer.  Will update after I get that tomorrow.


Jan 29, 2013, 02:17 am Last Edit: Jan 29, 2013, 04:31 am by Nick_Pyner Reason: 1

Still no resolution.

New Bootloader:

I downloaded the ROBOTC bootloader hex for the mega/ADK an

Basically, ARDUINO is screwing you if you think that the 256k is going to benefit you.  All you seem to get with the Mega is additional IOs, not additional usable program space.

I'm so pissed off right now, I could scream...three Mega boards that are no more capable than a 24 dollar UNO.  Oh, and no response whatsoever from Arduino.

I ordered an actual Atmel AVR ISP programmer.  Will update after I get that tomorrow.

The answer in my first post should have been - Yes, me, and a bazillion others.

Seems pretty clear your problem is a matter of pilot error. If the Mega boards really are as incapable as you say they are, everybody would have been complaining, and Arduino would have gone out of business years ago. Furthermore, having three Mega boards and still no resolution more or less proves it's pilot error, and two would probably have sufficed for that.  

I submit the first thing you need to do is stop throwing money at the problem and try to find out why you have the problem and nobody else does.  What I don't understand is why you have all these bootloaders and programmers in your agenda.  Are you trying to do something so mysterious and unique that you have to have all that? You have never posted your code, I have no idea what you are trying to achieve, and the lack of response from Arduino could be because they have no idea either. Having said that, I'm not sure that posting your code will solve anything. After all, you have never said it won't compile, so it's fair to assume it's kosher, but you do say it is "very straightforward" so, in that event, why don't you just press the arrow button in your Arduino 1.0.1, or whatever, and upload the programme like everybody else does?

There is code attached to reply #3 below that you might try to load. It is about 45k, it works, and loads just like any other code. You may have to install a couple libraries first, but that is simple enough, they are free, and worth it to prove the point.


You can be pretty sure that all you have is some stupid newbie mistake that will only happen once, and all will be fine after that.


I tried out the tutorial on using an UNO to program my mega ADK

I did already mention that ArduinoISP won't program a mega2560... (though I don't think you got that far.)

As it happens, I don't have any m2560 arduinos, and my sense of duty toward community support doesn't quite go as far as going out and paying for hardware that I don't need, in order to debug other peoples' bootloader problems.  However, I dug out my mega1280 and tried to upload the "Sprinter" RepRap sketch, which is about 53k.  It worked fine.

Now, the mega1280 doesn't have the same bootloader as the mega2560, so that isn't really much of a test.  There isn't a .hex file for the new bootloader for the 1280, so I compiled one from scratch using the source in arduino1.0.2 (this only took three tries at avr-gcc versions.  Sigh.)  I modified boards.txt to create the new board type, "burned bootloader" using ArduinoISP (which DOES work on a m1280!), and uploaded some new sketches.  The 53k Sprinter sketch still uploads fine.
This *is* probably the production bootloader; there's no watchdog support in the source code, and it still has the "!!!" bug.  (However, I didn't get a "huh?" response when I added !!! to the sketch.  It just never completes upload.)

So I don't know what to tell you.  It looks like the bootloader works fine for sketches larger than 30k here.  You've repeatedly ignored requests for information from your side (.hex or source code.)  I have suspicions that the m2560 doesn't really support 240kbyte sketches, but I'm pretty sure that it should work for sketches larger than 30k.  As Nick points out, there have been too many MEGAs sold for a bug this serious to exist (ADKs... Perhaps less so.)

So...  please provide your code?
Are you still getting the same "verbose" output with your sample sketch?

Here's something else you can try.
Connect to your Arduino via the serial monitor at 115200bps.
Hit reset on the board, and within 1 second send "!!!" (I have to pre-type the !!! and use two hands for this :-)
This should get you to the bootloader's interactive monitor, which looks like:

Arduino explorer stk500V2 by MLS

It has a couple commands, but the one that's interesting is "?"   Send a "?", and report the results.  My 1280 says:

Bootloader>? CPU stats
Arduino explorer stk500V2 by MLS
Compiled on  = Jan 28 2013
CPU Type     = ATmega1280
__AVR_ARCH__ = 51
GCC Version  = 4.3.3
AVR LibC Ver = 1.6.7
CPU signature= 1E9703
Low fuse     = FF
High fuse    = D8
Ext fuse     = F5
Lock fuse    = CF

Go Up