Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By dwalker-uk
#91874 Hi,

I've been using ESP8266-12S successfully for a couple of years, soldered onto a range of custom PCBs and all with a standard sketch. I'm using the Arduino.cc software (v1.8.15) on a Mac, and all flashing is done via a CH340 USB interface. I use a manual slide switch to put the connected ESP8266 into programming mode.

Recently I've had two boards which I can't flash. I get the dreaded "Connecting........_____....." lack of progress, followed by an "esptool.FatalError: Failed to connect to ESP8266: Invalid head of packet (0xC8)" error.

One of them has never worked; the other was soldered together and flashed and worked fine yesterday, but I now can't re-flash it. In Serial Monitor the one that's never worked reports "Ai-Thinker Technology Co. Ltd." and "ready". The sketch on the one that flashed successfully still works, and output is still shown in Serial Monitor. So in both cases Serial Comms is working fine - I just can't flash them any longer.

I've checked the connections and it should definitely be in programming mode - it's powered at 3.3v, GPIO2 is high, GPIO15 is low, and GPIO0 is low when I switch into programming mode (with my manual slide switch).

The same CH340 USB interface and the same laptop, Arduino software and sketch still work fine to programme other (old) ESP8266 based PCBs I've got.

So my question... what could be causing this to fail? Everything seems to be fine. Is there anything else I can check to identify the cause of my issue? Could it just be bad luck and two dodgy modules in a row, and I should just build another (third) PCB?

Very many thanks - it's driving me crazy! :cry: