When I get a problem uploading to my boards I have upload a different program like the blink example. This seems to reset something and I am then able to upload my own program (which is quite large).
It might be worth trying this to see if it works in your case, although I have no idea why it works.