Arduino Mega 2560 R3 - Can't upload a sketch larger than 64 kb

Hello everyone. As the title says I'm stuck with this old bootloader problem with the deary atmega2560. I've followed Nick Gammon's tutorial and it seems to burn the v2 bootloader without any problems but... I still cannot upload an 89 kb sized sketch to the board. If I cut some of the code and PROGMEM data to make the sketch fit within the 64 kb, it works just fine.

I've been looking for a solution to this for several days with no success. Is there any solution/update on this? I suspect there is but I wasn't able to find it.

Any help would be appeciated!

My board is an Arduino Mega 2560 R3 and the IDE's version is 1.8.9

:confused: :confused:

What error do you get?

Is most of the data in PROGMEM? accessing more than 64k of data in progmem is more complicated because it needs a different call to access it, and none of the arduino functions that work with stuff in progmem do that.

I'm not getting any error. The code compiles and uploads quite well (as I could see in verbose mode) but then the board doesn't boot at all. I have a tft ILI9486 screen that shows several bitmaps on boot (they are stored on the flash... or that's my intention) and nothing shows: the screen stays on white.

Digging around I found out that apparently it isn't a problem of the bootloader itself but, as you said, it appears to be an addressing matter. I read something about putting all PROGMEM data after the code and functions. I didn't try that yet.

I'll be looking for the correct way of access the high banks of memory of the Mega. If you can point me in the right direction, I'll be very grateful!


Ok, I've found out that working with PROGMEM is a pain in the ass. I don't undestand why is so difficult to access the program space. The solution that worked for me is to migrate my project (An ECU for my 62 Dodge D100) to a Raspberry PI. Linux an C have all the solutions I need.

Thanks anyway!