user7127: I bought a SainSmart Arduino Mega 2560. I uploaded a small sketch to it, and it uploaded fine. When I upload a larger sketch though, I get this error:
verification error, first mismatch at byte 0x3895
         0xdf != 0x44

So obviously there's nothing wrong with my bootloader because I can upload smaller files. Why is this happening?

user10794: If your sketch contains !!! in it, that can cause some versions of the bootloader to drop into interactive mode, eg.
Serial.println ("Rocket firing!!!");

Also there can be problems with 0xFF bytes in your code causing the bootloader to incorrectly assume that that page of memory was erased, when it was not. 
I have a bootloader-uploader sketch at: Atmega bootloader programmer
You need a second board to use it (eg. a Uno) - the bootloader for the Mega2560 is a reasonably up-to-date one. I haven't actually tested it with the Sainsmart version of the Mega, but I presume that internally that part is the same.

7127: <p>I bought a SainSmart Arduino Mega 2560. I uploaded a small sketch to it, and it uploaded fine. When I upload a larger sketch though, I get this error:</p>

<pre><code>verification error, first mismatch at byte 0x3895
         0xdf != 0x44
</code></pre>

<p>So obviously there's nothing wrong with my bootloader because I can upload smaller files. Why is this happening?</p>
 10794: <p>If your sketch contains !!! in it, that can cause some versions of the bootloader to drop into interactive mode, eg.</p>

<pre><code>Serial.println ("Rocket firing!!!");
</code></pre>

<p>Also there can be problems with 0xFF bytes in your code causing the bootloader to incorrectly assume that that page of memory was erased, when it was not. </p>

<p>I have a bootloader-uploader sketch at: <a href="http://www.gammon.com.au/bootloader" rel="nofollow">Atmega bootloader programmer</a></p>

<p>You need a second board to use it (eg. a Uno) - the bootloader for the Mega2560 is a reasonably up-to-date one. I haven't actually tested it with the Sainsmart version of the Mega, but I presume that internally that part is the same.</p>
