Avrdude issue...another one

So i tried to avoid posting in the forum and fix the issue myself for some time and no luck. I have am running a DFRobot Mega 2560 V3.0 and have been getting the below issue over the past few months. Its been getting progressively worse to the point where it just doesn't want to work.

avrdude: verification error, first mismatch at byte 0x22b1 0x92 != 0x89 avrdude: verification error; content mismatch avrdude: verification error; content mismatch

Have tried the following: - Different versions of the arduino IDE - Tried a different Mega board - Played around with the drivers and USB settings - Tried different autorest disabling methods.. - Updated the firmware on the board

I am fat out of ideas. Any suggestions?

First try to upload a simple blink example. Make sure to select the right board.

You might need to install an arduino bootloader on that chip.

You did not try different USB cables ;)

Although I'm not the specialist on the subject of avrdude, I think that verification errors (usually) indicate that your flash memory is on it's way out. The fact that it got progressively worse confirms that; however if this happens with different boards it's less likely to be the case.

So after some messing around i found its a problem with the sketch (it seems). I have successfully uploaded a variety of simpler sketches no problem. But then when i try the current one i am working on it fails every time, even tough it complies just fine.

Anyone ever come across this?

Post the code. I have heard of the board rejecting certain code.