View Single Post
Old 01-16-2017, 04:54 PM   #35 (permalink)
josemapiro
EcoModding Apprentice
 
Join Date: Dec 2012
Location: Portugal
Posts: 197
Thanks: 93
Thanked 70 Times in 64 Posts
Hi t vago
Quote:
Originally Posted by t vago View Post
I still could not duplicate the issue, even with removing everything off my AtMega2560 and programming it with your LCD and button configuration.

I think I may have inadvertently solved the issue when I re-burned my AtMega2560's bootloader.

I also think this problem is not limited to my version of the MPGuino code.

Google: "mega2560 programming times out site:forum.arduino.cc"

So I was wrong to assume that there wouldn't be anything within a successfully compiled sketch that would cause the programming to fail, simply because there was something within the sketch itself. The AtMega2560 appears to suffer from a bootloader bug that does exactly this.

Trouble is, there's nothing in my code that is obviously the cause of the problem. For instance, many users report that if they include "!!!" within a string in their sketch, it will not load onto their AtMega2560. In my code, there is no "!!!" that gets compiled. There were "!!!"s in the source file, in the #error directives, but they do not get compiled into the code. Besides, those "!!!"s in the #error directives were in the 20170107 version, and you reported that it successfully uploaded.

There is also another sequence of hex numbers that apparently causes programming to fail with this timeout error, but I am not able to find this sequence. Like I said, I re-programmed my AtMega2560's bootloader, and apparently, the new bootloader does not have this bug. I cannot duplicate this problem with my AtMega2560.
I'm going to install the bootloader again, as suggested, but it will take quite a few days because I bought USBasp on ebay today and it will take several days to arrive.

Thanks
José Rodrigues
  Reply With Quote
The Following User Says Thank You to josemapiro For This Useful Post:
t vago (01-16-2017)