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

User avatar
By sueastside
#7313 My cp2102 based programmer is connected as followed: (esptool.py)
RTS = CH_PD
DTR = GPIO0
TX = RX
RX = TX
GND = common

wi07-12 is connected like:
GPIO15 = GND
GPIO2 = vcc
GPIO0 = DTR
TX = RX
RX = TX

AMS1117 3V3 connected to an 5v 1a usb charger, so plenty of power right?


Just trying to talk to it doesn't seem to work on any baud rate, just prints some garbage when toggling CH_PD...

So try flashing the blinky example....

Code: Select allesptool.py --port /dev/ttyUSB0 write_flash 0x00000 firmware/0x00000.bin 0x40000 firmware/0x40000.bin
Connecting...
Erasing flash...
Traceback (most recent call last):
  File "/opt/Espressif/esptool-py/esptool.py", line 449, in <module>
    esp.flash_begin(blocks*esp.ESP_FLASH_BLOCK, address)
  File "/opt/Espressif/esptool-py/esptool.py", line 190, in flash_begin
    struct.pack('<IIII', size, num_blocks, ESPROM.ESP_FLASH_BLOCK, offset))[1] != "\0\0":
  File "/opt/Espressif/esptool-py/esptool.py", line 108, in command
    raise Exception('Invalid head of packet')
Exception: Invalid head of packet


Fails, but esptool.py read_mac or load_ram, dump_mem, ... work except flash_id, run and flash_Write.

So connecting, syncing and the above operations work, but when sending the ESPROM.ESP_FLASH_BEGIN command no response is received and it times out... (expects \0\0)


esptool.py dump_mem 0x40000000 65536 iram0.bin seems to indicate something is on there, near the end of that dump bless shows stuff like

Code: Select all--snip--
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/s %s,rst cause:%d, boot mode:(%d,%d)
Jan  8 2013reset
--snip--



Any insights on what to try next? Are there more pins to be pulled high or low on this chip?
What needs to be connected for regular running operation? Anyone else has this version?

thank you :)
User avatar
By Tomer
#7422 I have the exact same problem as you do, not sure how to proceed with this.
anyone else managed to solve this issue?

P.S - i didnt buy mine from electrodragon.. bought it from aliexpress.
User avatar
By gwizz
#7424 I don't (yet) understand the workings of the DTR and CTS pins of these programmers - but I have managed to use and flash several esp modules.

In general, you need CH_PD high and GPIO15 low to boot in any mode, GPIO0 low enters flash programming mode and GPIO0 high (usually floats high) for normal boot. You also should make sure GPIO2 is floating or explicitly tied high to make sure you only go between the flash programming mode and normal mode, without triggering SDcard boot mode.

I would like to know how to use the CTS and DTR signals - presumably one would go to GPIO0 to control the boot mode, the other wiggles reset at the beginning and end of programming?

Oh and you need to tie the grounds together if the power isn't coming from (referenced to) the device with the usb-serial adaptor in.
User avatar
By sueastside
#7440
gwizz wrote:I would like to know how to use the CTS and DTR signals - presumably one would go to GPIO0 to control the boot mode, the other wiggles reset at the beginning and end of programming?


The esptool.py source https://github.com/themadinventor/espto ... ol.py#L133
Code: Select all        # RTS = CH_PD (i.e reset)
        # DTR = GPIO0
        self._port.setRTS(True)
        self._port.setDTR(True)
        self._port.setRTS(False)
        time.sleep(0.1)
        self._port.setDTR(False)


So it's toggling CH_PD and GPIO0 to enter flash mode, with GPIO2 high and GPIO15 to GND it connects, but then fails to flash.
I also tried making CH_PD high and connecting RTS to REST(i'm assuming this is RESET on the ESP-12) but then it can't connect...

What is your process to do this manually? Do you toggle anything or just connect CH_PD high, GPIO0 low, GPIO2 high, GPIO15 low and it works for you? I think I tried that, but then it fails to connect...

Grounds are connected.