Programming new ESP-07 unit via serial fails, why?

Probably stupid question but I have failed to understand why my programming does not work...

I am using the Sloeber IDE for Arduino to code for my devices.
About 6 months ago I prepared a pair of ESP07 units by flashing the devices from within the IDE via the serial port. It worked OK.
The code I flashed included the webupdater function so after doing this initial flashing (with full erase) I never used serial programming again. I always updated the flash via the network.

But 2 days ago I managed to brick the two lab devices so I had to get a new ESP07 and when I plugged it into my prototyping system it started up fine with the AI-Thinker AT firmware in AP mode.

So I thought that I could flash my working code via the IDE. I reset with the flash pin low to go into programming mode and then told the IDE to program the chip.
But it failed with these messages in the console:

Starting upload
using arduino loader
Starting reset using DTR toggle process
Toggling DTR
Continuing to useCOM29
Ending reset


LaunchingC:\Programs\sloeber\/arduinoPlugin/packages/esp8266/tools/esptool/0.4.13/esptool.exe -cd ck -cb 115200 -cp COM29 -ca 0x0 -cz 0x400000 -ca 0x00000 -cf D:\Engineering\Arduino\DHT_MONITOR/Release/DHT_MONITOR.bin 
Output:
warning: espcomm_sync failed
error: espcomm_open failed
/arduinoPlugin/packages/esp8266/tools/esptool/0.4.13/esptool.exe finished
upload done

So nothing at all happened...
I repeated it with an oscilloscope connected to the serial Rx line and there was not a single byte sent!
If I use a terminal (I use Termite) and type in AT then I see the 40 bits of data on the line, so there is nothing wrong with the serial connection. It is set to 115200 baud.
What could be wrong here?
I attach a screenshot of the project options...

does the loader do another reset ? then you have to 'keep' the flashpin low. You can confirm it is actually in 'flash-mode' since then the AT commands will not work anymore.

Just adding info on the problem:

  1. I have hooked up a Termite serial monitor program to the ESP-07 at 115200 baud via a USB-digital adapter

  2. When I hit the reset button on the ESP-07 breadboard this is seen in the console after some binary garbage:

Ai-Thinker Technology Co. Ltd.

ready
  1. If I enter AT from the console nothing is returned from the ESP-07.

  2. But I can see on my oscilloscope that the AT bit pattern is sent at 115200 baud and contains the CRLF ending.
    So output from the PC via the USB adapter reaches the Rx pin of the ESP-07

  3. The ESP-07 creates an Access Point with SSID “AI-THINKER_E8C407”, so it is operational.

  4. When I run the programming test from the IDE I can see the data sent from the IDE on my oscilloscope.
    But there is no response from the ESP-07 at all.
    When I try this I push the Flash button while I reset the ESP.

So it seems like for some reason:
A) The ESP-07 does not respond to AT commands
B) The ESP-07 does not respond to the programmer commands either

What could be at play here? Baudrates?
I am totally confused about how to actually start programming an out-of-the-box ESP-07 attached to a breadboard.

Is there some way via the AP created by the ESP to send flash code and get my initial code on board?

BosseB:
after some binary garbage:

Ai-Thinker Technology Co. Ltd.

ready

so the baud-rate is correct or you wouldn’t be receiving anything

BosseB:
3) If I enter AT from the console nothing is returned from the ESP-07.

so the unit is not receiving your command,

BosseB:
4) But I can see on my oscilloscope that the AT bit pattern is sent at 115200 baud and contains the CRLF ending.
So output from the PC via the USB adapter reaches the Rx pin of the ESP-07

does it, where do you connect the oscilloscope ?

BosseB:
Is there some way via the AP created by the ESP to send flash code and get my initial code on board?

no i don’t think so. There must be a poor connection or a short on the rx-pin that is the only logical explanation. What is your physical setup connecting the usb-com to the ESP ?

Deva_Rishi:
so the baud-rate is correct or you wouldn't be receiving anything

When you say I would not be receiving anything, you mean on startup, right?
To me it seems like the ESP-07 is sending stuff at a different baudrate at first and then switches to 115200 baud for the last few lines. The terminal application is set to 115200 baud only.
So only the last two lines show up readable. Preceding is garbled.

Deva_Rishi:
so the unit is not receiving your command,

Right! this is exactly what happens, nothing I send seems to cause any action on the ESP

Deva_Rishi:
where do you connect the oscilloscope ?

To the breadboard where the serial adapter from my PC is connected.
Oscilloscope connected to wires inserted in breadboard where ESP pins 15 and 16 are connected.

Deva_Rishi:
no i don't think so. There must be a poor connection or a short on the rx-pin that is the only logical [quote explanation. What is your physical setup connecting the usb-com to the ESP ?

I have a USB to TTL serial adapter to match with the ESP signal levels and polarity.
TxD from adapter to ESP pin 15 (RxD0)
RxD to adapter from ESP pin 16 (TxD0)
Initially I had a voltage divider between the USB TxD signal and pin 15 since I thought it would send 5V digital signals.
But this is not the case, it sends 3.3 V signals, so I disconnected the lower resistor from ground to get the voltage level to 3.3V. Now there is only a 2K2 resistor in series with the signal to pin 15 and the level is at 3.2 V or thereabouts.

So it seems like this ESP does not read the incoming data....
Data in the other direction seems fine, as witnessed by the output (different) when the ESP boots up normally and in Flash mode.

I have used the oscilloscope to capture the startup data and it is like this:

  • first a 54 ms section of data using about 76 kbaud
  • pause for 100 ms
  • then a 20 ms section of data probably still at 76 kbaud
  • pause 32 ms
  • final data at 115200 baud

It is so infuriating that I cannot remember how I did this 9 months ago.
I believe I used Sloeber, but it might also have been the Arduino IDE. In any case once the webupdater firmware is on board I never use the serial programming anymore...

FORGOT:
When I hit reset with the flash button active then the ESP sends a single block of data at what appears to be 76 kbaud. It lasts for 6.8 ms and then nothing.

BosseB:
To me it seems like the ESP-07 is sending stuff at a different baudrate at first and then switches to 115200 baud for the last few lines. The terminal application is set to 115200 baud only.
So only the last two lines show up readable. Preceding is garbled.

that is normal that first section is not really data that is being send, consider it irrelevant. even you you upload anything onto the unit it will first output something before it actually is ready to transmit.
So the hardware setup seems ok, but still the connection to ESP unit itself is the most suspect. Re-melt the headerpin connection, move the unit a few holes on the breadboard, you are not really doing anything wrong and the unit responds normally with the exception of the RX-pin. I would still keep the voltage divider on the RX-pin it takes a logic-HIGH level from 1.8v+ (or even less) and it doesn't mind being LOW at startup. But as you have it setup it should just work, it must be a bad connection somewhere.

I made myself a breakout for the ESP-07 to fit on my breadboard deck.
ESP-07_breakout.png

Can't see any problems with soldering on pin 15...

ESP-07_breakout.png

i don't see any either, but i would reheat and melt any soldering done on the pin once more.. I've done it once with a nano, looked perfect but didn't work, and after reheating and melting it did, it's worth a go.

Deva_Rishi:
that is normal that first section is not really data that is being send, consider it irrelevant. even you you upload anything onto the unit it will first output something before it actually is ready to transmit.
So the hardware setup seems ok, but still the connection to ESP unit itself is the most suspect. Re-melt the headerpin connection, move the unit a few holes on the breadboard, you are not really doing anything wrong and the unit responds normally with the exception of the RX-pin. I would still keep the voltage divider on the RX-pin it takes a logic-HIGH level from 1.8v+ (or even less) and it doesn’t mind being LOW at startup. But as you have it setup it should just work, it must be a bad connection somewhere.

OK, I took your advice and scrutinized the breadboard I was using for this test circuit.
Turns out that the connecting springs beneath the hole where pin 15 was pushed in seems to have been damaged giving a non-connect! So tracing the Rx data was OK up until the breadboard on a free connect on the same pin. But it did not pass up the breakout board jumper pin to the ESP-07 pin 15…

So I brought ot a new breadboard and hooked up the same circuit on this board instead and lo-and-behold! The ESP responds to my commands! :slight_smile:
Now it’s too late to go back and do a firmware upload to test that functionality (and I don’t want to push my luck tonight!).
So I will postpone the final verification until tomorrow. It’s 1 AM over here now…
Thanks for your advice and suggestions!

Well glad that has been sorted out !!