I had a very similar issue, and managed to resolve it by following the quoted process found in the below link (please note I have a ESP8266-12E & it worked for me but do not guarantee it is the solution for all).:
https://github.com/esp8266/Arduino/issues/95#issuecomment-96399149
*** ROOT ISSUE - ESPTool.exe is NOT correctly erasing flash, allows module to get "borked" and is then "unborkable".
Above wall of text can be summarized as "sometimes on windows modules get to a state where uploads stop working", and many people suggest many different hardware-related fixes. They didn't work for me, and simply grabbing the esptool.py script and running:
F:\Users\timm\Documents\Arduino\PythonESPTool>python esptool.py --port COM5 --baud 76800 erase_flash
put the module back into an uploadable state.
Manually asking esptool.exe to erase the module did not work.... so esptool.exe as packaged here has a bug wrt erasing that esptool.py doesn't.
So - for all other frustrated windows users, if you bork your module and it stops working, do the following until this bug is fixed:
install Python2.7 (google for instructions)
download esptool.py from this git distro into a local directory (hope this link keeps working - https://github.com/themadinventor/esptool, I could not find in this GIT repo)
open a command window in the same directory and run "python esptool.py --port COM5 --baud 76800 erase_flash"
use your IDE to download your prev sketch, should now work again.
I'm going to try to diddle the platform.txt file to use this instead of the esptool.exe, if it is easy I'll report back.
This may be hard to reproduce, if I find a sketch that consistently breaks esptool.exe I will share, but please comment IF this approach helps you out of a "stuck" module so the smart guys (Ivan, looking at you) can prioritize and look into whether it's worth fixing/replacing esptool.exe.