Problem uploading a sketch to ATMEGA2560

I have a custom board with an ATMEGA2560 MCU and I'm writing a program with about 40kb of program memory.

It was all working properly but, from a moment to another, I am receiving uploading timeout messages. With other sketches the upload works fine...

I burned the bootloader and the correct fuses/lock bits but the issue keeps occurring. I also tried uploading the program with another FTDI.

Does anyone know experienced the same issue?

many thanks!

Some versions of the Mega bootloader have a built-in monitor mode for examining memory via the Serial Monitor. It is triggered by sending '!!!'. This causes the bootloader to appear to hang if a sketch contains three or more consecutive exclamation marks.

johnwasser:
Some versions of the Mega bootloader have a built-in monitor mode for examining memory via the Serial Monitor. It is triggered by sending '!!!'. This causes the bootloader to appear to hang if a sketch contains three or more consecutive exclamation marks.

johnwasser, many thanks for your reply!

I had a Serial.println(); instruction with three consecutive exclamation marks... Now it uploads the sketch properly. You really saved my day :smiley: !