Hexfile upload weirdness

As my last 2-3 posts have chronicled, I have been on a journey to pull a hexfile from an old MEGA2560 board and put it onto a new one. I have successfully downloaded this hexfile a while ago now but any time I try to upload it to a new MEGA2560, the following error occurs:


After this, the board refuses to accept uploads through both, the Arduino IDE and a regular terminal - returning the stk500v2 timeout message. This has happened to two separate boards now and the first upload stopped at 97% both times. Interestingly, the file uploads to the old board without error. What could be causing this and is there a potential way to fix the new board? The board's orange LEDs become a lot dimmer after the first upload.

Update: I was able to use a separate Arduino as an ISP to reflash the other boards' bootloaders. That fixed the boards but I'm still wondering why that specific hexfile breaks things. Another detail: The original board is an Arduino MEGA2560 R2 whereas the new ones are R3 boards.

How are you trying to upload the code? Serial or ICSP?

When you pulled the code from the R2, you got the whole 256k. If you try to upload that using serial I can imagine that that will not work; I'm not sure of the side effects but the bootloader might be overwritten which might result in the timeouts.

I'm not sure of the difference between R2 and R3; there might be a difference in bootloader but that should not matter.

I'm not sure which method this counts as but I use the avrdude terminal command generated by the Arduino IDE to transfer the file over USB.

That would be serial.

Would it be possible to use an Arduino MEGA 2560 as an ISP/ICSP programmer to complete this transfer instead?

You wrote

Why do you ask about using another Mega as ISP if you have used another board to reflash bootloader already?

I'm asking if the ISP/ICSP transfer will avoid the bootloader problems that serial transfer seems to be causing.

Yes. It was implied in reply #3. You could have tried :slight_smile:

Sorry, I don't have constant access to the boards so I couldn't post any updates till now. The issue was indeed solved by using one arduino as an ISP. Thank you for your help!

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.