Please use esptool from command line and use the erase flash command and see if your problem persists https://github.com/espressif/esptool