Issues with CP2102N in custom board

nicky1finn
Posts: 2
Joined: Mon Dec 05, 2016 1:20 am

Issues with CP2102N in custom board

Postby nicky1finn » Thu Jan 11, 2018 8:40 pm

Hello! I'm working on a custom board that uses the CP2102N to communicate with the ESP-WROOM-32 and am having some issues with the prototype. I followed the schematic in the attached core board document.

Differences include:
- use of the CP2102N instead of the CP2102, which is a drop-in replacement
- lack of connection of the CTS and RTS pins to the ESP32
- EXT_5V is connected to an internal 5V rail instead of the USB 5V. The board is powered from a source other than USB, and I read that there are issues if both are connected (the chip can heat up and destroy itself)
- nothing used from the SWITCH BUTTON section
- nothing used from Power Supply section, since we have our own power supply for the rest of the board

I thought the transistor network was the issue, so I bypassed them completely by directly connecting DTR to IO0 and RTS to EN. This seemed to put the ESP32 in bootloader mode, but make flash would not work:

Code: Select all

nick@ubuntu:~/esp/test$ make flash monitor
Flashing binaries to serial port /dev/ttyUSB0 (app at offset 0x10000)...
esptool.py v2.1
Connecting........
Traceback (most recent call last):
  File "/home/nick/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 2524, in <module>
    _main()
  File "/home/nick/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 2517, in _main
    main()
  File "/home/nick/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 2247, in main
    esp.connect(args.before)
  File "/home/nick/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 368, in connect
    last_error = self._connect_attempt(mode=mode, esp32r0_delay=True)
  File "/home/nick/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 329, in _connect_attempt
    self._port.setDTR(True)   # IO0=LOW
  File "/usr/lib/python2.7/dist-packages/serial/serialutil.py", line 547, in setDTR
    self.dtr = value
  File "/usr/lib/python2.7/dist-packages/serial/serialutil.py", line 411, in dtr
    self._update_dtr_state()
  File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 605, in _update_dtr_state
    fcntl.ioctl(self.fd, TIOCMBIS, TIOCM_DTR_str)
IOError: [Errno 32] Broken pipe
/home/nick/esp/esp-idf/components/esptool_py/Makefile.projbuild:54: recipe for target 'flash' failed
make: *** [flash] Error 1
nick@ubuntu:~/esp/test$ make flash monitor
Flashing binaries to serial port /dev/ttyUSB0 (app at offset 0x10000)...
esptool.py v2.1
Connecting........_____....._____....._____....._____.....
Traceback (most recent call last):
  File "/home/nick/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 2524, in <module>
    _main()
  File "/home/nick/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 2517, in _main
    main()
  File "/home/nick/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 2247, in main
    esp.connect(args.before)
  File "/home/nick/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 368, in connect
    last_error = self._connect_attempt(mode=mode, esp32r0_delay=True)
  File "/home/nick/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 330, in _connect_attempt
    self._port.setRTS(False)  # EN=HIGH, chip out of reset
  File "/usr/lib/python2.7/dist-packages/serial/serialutil.py", line 544, in setRTS
    self.rts = value
  File "/usr/lib/python2.7/dist-packages/serial/serialutil.py", line 401, in rts
    self._update_rts_state()
  File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 600, in _update_rts_state
    fcntl.ioctl(self.fd, TIOCMBIC, TIOCM_RTS_str)
IOError: [Errno 32] Broken pipe
/home/nick/esp/esp-idf/components/esptool_py/Makefile.projbuild:54: recipe for target 'flash' failed
make: *** [flash] Error 1
My setup is an Ubuntu VM on Windows 10. Drivers installed for both operating systems and the device correctly shows up in device manager, though, it occasionally shows an error stating that the device is not working properly or that it failed to start. I can successfully flash an ESP32 on a known working board without issues in this same setup, so I highly suspect that the issue is with the way the CP2102N is wired on my custom board.

Any help is greatly appreciated! I've already spent 10-15 hours attempting to debug this, hooking up a logic analyzer to check the EN and IO0 states, reworking the board to bypass transistors, etc. I wouldn't be surprised if I'm just missing something simple (like if the EXT_5V pin must be hooked up to the USB socket or if it's fine connected to a separate 5V rail). Thanks ahead of time!
Attachments
ESP32-Core-Board-V2_sch.pdf
(21.58 KiB) Downloaded 669 times

nicky1finn
Posts: 2
Joined: Mon Dec 05, 2016 1:20 am

Re: Issues with CP2102N in custom board

Postby nicky1finn » Fri Jan 12, 2018 1:50 am

I can confirm that the chip can correctly reset and place the ESP32 into bootloader mode, after using the options in make monitor. There's something up with the USB to TX/RX portion, but I have absolutely no idea what. I've checked that the pins are correct (i.e. ESP_TX to CP2102N_RX and ESP_RX to CP2102_TX) countless times.

HenryM
Posts: 15
Joined: Fri May 25, 2018 12:48 pm

Re: Issues with CP2102N in custom board

Postby HenryM » Mon Oct 01, 2018 6:17 pm

Were you able to figure out the issue? I'm in a similar position. I was able to program the board a couple of times, but I had to disconnect USB and plug it back in each time. I then programmed in some sample Ethernet code and have been unable to get it to program since.

Edit: I somehow turned off the option to put the board into reset within menuconfig.

Who is online

Users browsing this forum: No registered users and 41 guests