A bit too much opti, not enough boot
The newer Arduino boards such as the Uno include a new bootloader that takes up about 1/4 of the size of the old one. That means some extra memory can be freed up for applications. The new bootloader is known as Optiboot, and the site says "Compatible with 168 and 328 Arduinos including Lilypad, Pro, Nano". Unfortunately, in the case of the Pro Mini, that's not true, but it can be made to work.
- At the time of writing, the current v3 release tarball doesn't include some important bugfixes such as this one. My advice is to pull the latest version from the repository and build it yourself.
With the standard makefile flags Optiboot may not build, depending on which version of the compiler you are using. The fix is to add
LDFLAGSas detailed in this bug.
Optiboot uses different upload baud speeds from the old bootloader, apparently to shave a few seconds off uploads. Unfortunately that has caused sketch upload issues such as this, and in the specific case of the Pro Mini, this. The common factor is that the Optiboot baud rate is too high to be reliable. I suspect that several of the other "Sketch won't upload" reports are caused by the same thing. Also, changing the baud rate means that it's not only necessary to fiddle with the boards.txt file to make the Arduino environment use the new baud rates, it's also necessary that you know exactly what bootloader is on a board. My recommendation is to edit the Makefile and change the
-DBAUD_RATE=XXXXXvalues to those in the original boards.txt file.
I've tried five different Pro Minis, setting the baud rate to 57600 instead of 115200 and whilst four of them upload fine with Optiboot, one of them doesn't. I can get it to work by manually resetting the board, and it works fine with the standard Arduino bootloader. Clearly there's some sort of timing issue related to resets, I'll have to tinker some more.