Esp8266 serial not working & can't flash firmware

Hi there. Hope you could help me on the problem. I've been troubled by this problem for weeks :cry:

Old post: Esp8266 serial not working
I think I should add something so I post this

What I want to build:

I am trying to make an air conditioning infrared remote control with brightness detection and temperature detection .

The Problem

  • Pull down BOOT and power it on, can see that I have successfully entered the firmware flash mode .
    ets Jan  8 2013,rst cause:2, boot mode:(1,1)
    
  • Received "timed out waiting for packet header" from esp flashing tool when upload the firmware.
    esptool.py v3.0
    Serial port COM11
    Connecting........_____....._____....._____....._____....._____....._____....._____
    
    A fatal error occurred: Failed to connect to ESP8266: Timed out waiting for packet header
    
  • Have a initial firmware which may blink the built-in led when recieve serial data, but didn't blink when I send data from computer. So I can assume that the ESP8266 did not receive serial data.

What I first tried

  1. Pull RXD to GND using tweezers, the built-in led blink
  2. Send serial data from NodeMCU, the built-in led blink
  3. Oscilloscope image on RXD when 8266 connect to ch340 module
  4. Change the jumper from 3v3 to 5v on ch340 module and send serial data, the built-in led blink. I also tried to download firmware, for the most time it shows "Failed to write to target RAM", but success several times.

    I heard from Reddit that the IO can withstand 5V

  5. Use another CH340 module, everything was the same.
  6. @Wawa told me regulators can oscillate with the wrong type of capacitors. So I tried to use 1uf capacitors instead of 10uf. The test results are presented in the following section. And here is the oscilloscope image
  7. I ordered a similar pcb but without photoresists and infrared light emitting diodes. I tried it and everything was the same.

What I also tried

I'm trying to combine the following items:

  1. another adapter board with esp8266 stick on breadboard
    image
  2. ams1117 module stick on breadboard
    image
  3. my pcb but only esp8266 and 10k resistors was soldered
  4. my pcb but only ht7333 and the capacitors was soldered
Power by Where is 8266 Worked?
2 1 Always
4 1 Sometimes
2 3 Never
4 3 Never

"Sometimes" meens that with 10uf capasitors, it can't work.
And with 1uf capasitors, I tried welding it several times, and sometimes it can work but sometimes it can't work.

Detailes

  • TypeC is for power supply, but I fogot some resistors
  • GH1.25 is used to connect to ch340 module during flashing firmware
    image


image
image
image
The link below contain the details of the pcb, but registration is requied.

Gerber file can be downloaded here
Gerber_PCB_12F-Temperature-IRremote-DC-test_2023-03-28.zip (35.6 KB)

ID Name Designator Footprint Quantity
1 220uF C4 CAP-SMD_L3.5-W2.8-R-RD 1
2 51k R5 R0603 1
3 120k R6 R0603 1
4 S8050_C181158 Q1 SOT-23-3_L2.9-W1.6-P1.90-LS2.8-BR 1
5 IR204C-A-L U3 TH-2P 1
6 1*2 BOOT,RST TH-2P 2
7 10uF C1,C2 C0603 2
8 0.1u C3 C0603 1
9 GH125-S04DCA-00 CN2 CONN-SMD_4P-P1.27_GH125-S04DCA-00 1
10 10K R1,R2,R3 R0603 3
11 GL5516 R4 RES-TH_L5.1-W4.3-P3.40-D0.5 1
12 10k R7,R8 R0603 2
13 ESP-12F(ESP8266MOD) U0 WIFIM-SMD_ESP-12F-ESP8266MOD 1
14 HT7333-A_C347191 U1 SOT-89-3_L4.5-W2.5-P1.50-LS4.2-BR 1
15 SHT30-DIS U2 DFN-8-2.52.50.9_JX 1
16 U262-061N-4BVC10 USB1 TYPE-C-SMD_TYPE-C-31-M-16 1

Notes

  • I should have connected TX and RX correctly
  • I havesuccessfully entered the firmware flash mode.
  • I tried using resistors on IO2 and IO15, but there was no difference. Besides, built-in led on IO2 could pull IO2 up. I found an official explanation for this, but a guy on reddit said that wiki sucks wind
    Boot Mode Selection - ESP8266 - — esptool.py latest documentation
  • I am a novice in hardware, so next time I will pay attention to not wiring under the wifi antenna and add resistor to the light emitting diode

I use it just like in the drawing below.
Press "S2" and hold, then press "S1".
Release "S1" and then release "S2".
Then send it to upload.

Write_Flash

" * Directly connecting a pin to VCC or GND is not a substitute for a PullUp or PullDown resistor, doing this can break upload management and the serial console, instability has also been noted in some cases.
https://arduino-esp8266.readthedocs.io/en/3.1.2/boards.html#generic-esp8266-module

I would leave GPIO16 disconnected
It is not clear from your schematic how exactly the usb adapter is connected.

so just to be clear, at boot, GPIO 0 is pulled LOW, GPIO 1 & GPIO 2 aren't pulled LOW in any way and GPIO 15 is pulled LOW.
(this is at the moment that VCC , RST & CH_PD are all connected to 3.3v )

That is not true ! Not that the ports will break straight away usually, but eventually they do in most cases. There is no need to use 5v, so don't ! it is a 3.3v MCU.

that's fine, actually it does, there is a builtin led on gpio 2 on an ESP-12f.

In that case i suggest from now on you first built a prototype before you start ordering PCBs.
That is actually still the best you can do.
I always make sure that before i start creating a PCB, i first have it working on a breadboard, and then a soldered prototype.

Eh... S1 is not connected the way you have it now, pretty sure of that.

Yeah, i won't do that, but just from looking at the gerbers, the onboard regulator has no heatsink to speak of, you connected the copper-fill to GND, when the regulator has the heatsink on Vout.
Again, if you make a prototype and just use a to-220 package for the regulator it will be fine, but with the current PCB, it doesn't matter if you even manage to upload a new sketch because chances are you will never be able to connect to WiFi anyway due to lack of power.

1 Like

I have tried to disconnect IO16, but everything was the same. It refuses to work.
image

Maybe you should reset this one?

To perform a full reset of ESP8266, you can follow these steps

  1. Press and hold FLASH (S2) Button.
  2. Press and release RESET (S1) button while S2 is in pressed condition.
  3. Release FLASH (S2) button after device reset.

These steps put ESP8266 in serial programming mode.

If you want to erase the ESP8266 flash memory (factory reset), you can follow these steps

  1. Connect the ESP8266 board to your computer.
  2. Open a Terminal window on your computer.
  3. Hold the ESP8266 BOOT/FLASH button.
  4. Copy the following command to your terminal window and press Enter (continue holding the FLASH/BOOT button):
esptool.py --port /dev/ttyUSB0 erase_flash
  1. Wait for the process to complete.

I hope this helps! Let me know if you have any other questions.

I wonder why the HT7333 can't provide enough power?
The datasheet said it can provide 250ma. There are a large number of posts on the internet said that ht7333 is enough for esp8266.

How about a reset?

I have successfully entered the firmware flash mode .

1 Like

It can if you give it enough heatsink.

The 5v tolerance has been retracted from the datasheet as far as i know, but you can burn the board if you like.

1 Like

The esp 8266 used a current of about 80 ma most of the time with my sketch, while the ht7333 only felt a bit warm, so I don't think it was a big problem. But I'll pay attention to this next time.

So, do you have any other ideas about the serial not working?

Well no not really, i mean 'Serial' is working at least for the TX line or you wouldn't be getting the boot messages.

Eh yes, but while the selected boot-mode is 'upload' , that sketch isn't running. Also i suspect that the baud-rate is relevant, anyway that isn't proof.

Well the result of that test would direct me towards keeping the AMS module as power, and look for differences between the breadboard unit and the PCB. Even though there aren't any looking at the schematic, that may mean that there is a short somewhere from your soldering or something. Anyway i'd start with the PCB and elevate the ESP while connecting the soldring points to make sure that there isn't some flux making connection somewhere, and solder first just the TX - RX to the PCB and solder the other required parts with wires towards the breadboard. If that works, move parts over to the PCB one by one.

Update:
I borrowed a more expensive CMSIS-DAP debugger with a serial port and tried to use its serial to flash firmware for esp8266. It can work very smoothly! There is no problem. I am not allowed to open this debugger, so I do not know what chip is used inside

So the question then is whether there is an incompatibility between ch340 and esp8266? They work well in my previous projects.

I bought some WeMos D1Mini that have them. They work, but I bought them with my guard down ("How did I not see that??).

My NodeMCU with CH340C can also work pretty well, but it does not work on my PCB mentioned above.
Very strange.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.