Good Day!
I hope all of you are doing good and Safe.
We have designed our own board using ESP8266EX, I have attached the schematic of the same in this post. Today we have received the assembled board when we were trying to flash the test program to our board using Arduino IDE and via PL2303 - PL2303HX USB to TTL Serial UART Converter Module.
Connection between USB to TTL and Customized board,
When we flash the example program we are getting serial port error (Attached screenshot). Our doubt is, should we need to flash the bootloader first to the ESP8266 or we can flash the test program? If we need to flash the bootloader first how to flash the bootloader on the new customized board.
No there is no bootloader to be flashed as far as i know, so the test program is all.
Can you show me the link of this USB to TTL ? Is it an 'original' prolific module or a clone ?
Do what do you have pin32 (EXT_RSTB) connected ? It needs to be pulled 'HIGH' for the ESP not to be reset.
Oh and please copy the error message next time as text and paste it within </> code-tags, That makes it a lot easier to read than a screenshot. It timed out this time after a successful compile, but it was not easy to see.
We are not sure how to check whether the USB to TTL is original or cloned, we have bought it from a local store here in India and most probably it is a clone.
We are able to connect the ESP development board with the USB to TTL, so we assume the USB to TTL is okay.
Executable segment sizes:
ICACHE : 32768 - flash instruction cache
IROM : 231500 - code in flash (default or ICACHE_FLASH_ATTR)
IRAM : 26217 / 32768 - code in IRAM (IRAM_ATTR, ISRs...)
DATA : 1496 ) - initialized variables (global, static) in RAM/HEAP
RODATA : 876 ) / 81920 - constants (global, static) in RAM/HEAP
BSS : 25520 ) - zeroed variables (global, static) in RAM/HEAP
Sketch uses 260089 bytes (27%) of program storage space. Maximum is 958448 bytes.
Global variables use 27892 bytes (34%) of dynamic memory, leaving 54028 bytes for local variables. Maximum is 81920 bytes.
esptool.py v3.0
Serial port /dev/cu.usbserial-1410
Connecting........_____....._____....._____....._____....._____....._____.....____Traceback (most recent call last):
File "/Users/viknesh/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/upload.py", line 66, in <module>
esptool.main(cmdline)
File "/Users/viknesh/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/esptool/esptool.py", line 3552, in main
esp.connect(args.before, args.connect_attempts)
File "/Users/viknesh/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/esptool/esptool.py", line 529, in connect
raise FatalError('Failed to connect to %s: %s' % (self.CHIP_NAME, last_error))
esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header
_
the selected serial port _
does not exist or your board is not connected```
In that case. Yes if it works for the one, it should work for the other, but just to make sure that it is working properly, check the device manager (on windows, dunno where to look on Mac) The issue is that the more recent drivers for a PL2303 check the chip id and only work with genuine prolific chips.
But again, if it works with the one...
Another thing, i am pretty sure that it is a 5v device, using 5v logic, but it does have 3.3v available for power. Which means that you should protect the ESP's RX-pin using either a voltage divider or a level shifter.
What kind of ESP dev board have you been using ?
i saw that. There is a pullup resistor internally on that pin according to some, but i am not convinced there is.
That means that either the connections are wrong or the ESP is not in the proper boot mode.
(for which there should not be any reason, the GPIO pins seem not to be pulled "LOW" when they shouldn't be)
There is still the possibility for the flash to be the cause, but i think that in that case, the upload actually would be successful according to the IDE.
We are still encountering the same error `serial.serialutil.SerialException: could not open port 'COM6': OSError(22, 'A device which does not exist was specified.', None, 433)'
We have eliminated USB to TTL from our suspected cause since the development boards are able to communicate.
We have tried to flash using a different baud rate but not helped.
We suspected the computer port might be faulty so tried in differnt computer but still encountering the same error.('COM6': OSError(22, 'A device which does not exist was specified.', None, 433)'
We also checked ,
Voltages to ESP8266EX and Flash IC W25Q128JVSIQ and found all are okay(3.28V).
Checked Oscillator input and output frequency using the oscilloscope, no issues found (Getting 26MHz).
After assembly, we have connected our board with the computer using USB to TTL connector and tried to upload the test program but till now no success due to COM Port open error.
Is there anything we are missing or doing wrongly, please guide us...
You have not answered my questions regarding both of these items. Also you have not responded to me pointing out that the the USB to TTL device uses 5v logic.
That may still indicate a driver error or even something as simple as a program that is using that COM port. It could be that you still have the Serial Monitor open for instance.
Isn't this just for the automated reset / boot-flash mode ? There is no such thing on an ESP-01 and just making sure that GPIO is pulled LOW when powering up (or resetting) sets the proper mode. You have me doubting though, so i thought to ask @Juraj for another expert opinion.
And that is what the OP is doing, (note GPIO0 connected to GND), mind you, leaving RST free-floating is probably not right, although even there i found online documentation about an internal pullup present.
My sincere apologies for skipping the 5V logic question.
I have just checked voltages on USB to TTL TX & RX pin and found it is 5V(Please refer to the attached picture) and we have connected USB to TTL TX & RX to our board RX and TX without level shifter/voltage divider, so the same 5V is going to our board TX & RX pins as well .
So probably we have damaged the ESP8266, Am I correct?
If you could guide us on how to use level shifter / voltage divider here to connect with Rx & Tx it would be a great help.
Possibly yes.
The ESPs TX line will work without modification, but i use
USB_TTL-TX => 1K => ESP-RX => 1k => 1K => GND
As a voltage divider and that has worked for years for me.
I have no idea why they added those to the nodeMCU boards, but they are not needed if you GND out GPIO 0 & Reset the board. I think that it is more a matter of convenience than necessity. nodeMCU is a dev board created by a manufacturer that has bought ESP's from Expressif. As stated before, ESP-01's don't have them and you can upload to those just as well. You can also upload to a nodeMCU using just the TX & RX pins (not using the USB port) using the exact same method, without providing DTR & RST to the board.
As per the datasheet GPIO 0 should be pulled low(0). So in our circuit, we have made arrangements to connect GPIO 0 with GND to enter into programming mode.
For programming mode. How do you get out of it and boot the module after programming? Your schematic shows GPIO0 to be permanently pulled down through R9 (which is on the high side in terms of value, but OK).
The way you've designed this you should be able to upload code to the module, but it'll never run it.
Ok just looking into the RST matter a bit more thoroughly i found The design guide and that actually leaves EXT_RSTB open, so that should be OK, they do recommend a 499R (i guess i'd put 470R) resistor in line on the TX-line though.
Ok, I didn't check the ESP datasheets on this (they're exactly not a joy to navigate, being as fragmented as they are), but that would require the pin to be (weakly) pulled up internally. I believe it is...
Anyway, I'd be very much inclined to solder some jumper wires to this board and attaching some external buttons and resistors to this to make it easier to manipulate GPIO0 + RST.
As to the 5V mishap: in my experience ESP's are fairly robust, but no guarantees on them surviving 5V to TX or RX. I wouldn't be surprised if the module still lives, but it's another uncertainty which you really can't use in this situation.