-->
Page 1 of 1

Solving espcomm_sync failed / esptool board selection

PostPosted: Sun Nov 01, 2015 8:14 am
by 0rphu
Using Arduino IDE 1.6.5
esp8266 1.6.5-1160-gef26c5f set to Generic ESP8266 Module
on xubuntu 15.10
with ESP-01
and some obscure serial to TTL cable bought to use with Siemens C55 cellphone a deceade ago - it only has RX/TX/GND pins.

I've been dealing with the sync and open issues for almost two days, pulling all possible pins high and low to no avail, the only possibility to flash was using the ESP FLASH DOWNLOAD TOOL 1.2 under wine, which surprisingly worked very well.
Now I stumbled upon something I passed by a dozen times since yesterday.
When uploading the firmware from Arduino IDE, the esptool command always uses
Code: Select all-cd ck
command line switch:
Code: Select allesptool -vv -cd ck -cb 115200 -cp /dev/ttyUSB0 -ca 0x00000 -cf /tmp/build1360514603800965995.tmp/WiFiClient.cpp.bin

But when using this simple cable, the only(?) option is to enter the bootloader manually by pulling the GPIO0 low. I tried running the esptool with
Code: Select all-ck none
manually and it flashed successfully!
Code: Select allesptool -vv -cd none -cb 115200 -cp /dev/ttyUSB0 -ca 0x00000 -cf /tmp/build1360514603800965995.tmp/WiFiClient.cpp.bin

So my question - is the -cd option user selectable from a menu/config file or is it hardcoded? If it is hardcoded, I'd consider it a bug of sorts...

Thanks!

Re: Solving espcomm_sync failed / esptool board selection

PostPosted: Sun Nov 01, 2015 2:09 pm
by martinayotte
The esptool command line is located in platform.txt, it is passing "-cd {upload.resetmethod}".
The "upload.resetmethod" is defined in the boards.txt, so you can define you own board definition with "upload.resetmethod=none" .

Re: Solving espcomm_sync failed / esptool board selection

PostPosted: Sun Nov 01, 2015 2:21 pm
by igrr
That's a neat observation. It's quite unexpected that manipulating unconnected DTR/RTS pins could somehow upset the communication. I made 'ck' method default one under assumption that if the flow control lines were not used, it wouldn't hurt.

That said, I can't reproduce the issue as you have described. I've tried FTDI and CP2103 on OS X and Linux, with flow control pins unconnected, putting the board into bootloader mode manually.

Re: Solving espcomm_sync failed / esptool board selection

PostPosted: Mon Nov 02, 2015 9:10 am
by 0rphu
@martinayotte, thanks for the pointer, I was able to find and change it, upload from arduino IDE is working fine now!

@igrr, maybe my cable is special somehow :) - it could actually be the case, because it is a Siemens cellphone service cable. It could have some connections made internally and only the tx/rx/gnd on the wires. Or the breadboard and connections I made are not that good and I'm picking up some kind of noise. Anyway, it's one other thing to try when your upload isn't getting through and it could help the others.