Page 1 of 1

flashing from windows machine

Posted: Sun Dec 18, 2016 9:19 pm
by ry1234

This is a novice question, but I can't seem to figure it out. I followed the Windows tool chain setup instructions and built a sample application. I am now ready to flash it to the DevC Kit board. When connected to my laptop, it shows up as COM27. In 'make menuconfig' I thus set the serial port to /dev/ttyS26 (Which is the device I see in MSYS32/dev when the board is plugged in).

However when I try to flash to the device, I get this error:

$ make flash
esp32/esp-idf/make/ Deprecated feature: No longer necessary to include from esp-idf/components/bt/
Flashing binaries to serial port /dev/ttyS26 (app at offset 0x10000)... v2.0-dev
Traceback (most recent call last):
File "esp32/esp-idf/components/esptool_py/esptool/", line 2016, in <module>
File "esp32/esp-idf/components/esptool_py/esptool/", line 1841, in main
esp = chip_constructor_fun(args.port, initial_baud)
File "esp32/esp-idf/components/esptool_py/esptool/", line 155, in __init__
self._port = serial.Serial(port)
File "C:/msys32/mingw32/lib/python2.7/site-packages/serial/", line 31, in __init__
super(Serial, self).__init__(*args, **kwargs)
File "C:/msys32/mingw32/lib/python2.7/site-packages/serial/", line 182, in __init__
File "C:/msys32/mingw32/lib/python2.7/site-packages/serial/", line 62, in open
raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))
serial.serialutil.SerialException: could not open port '/??/COM27': WindowsError(123, 'The filename, directory name, or volume label syntax is incorrect.')
make: *** [esp32/esp-idf/components/esptool_py/Makefile.projbuild:48: flash] Error 1

Any ideas?


Re: flashing from windows machine

Posted: Mon Dec 19, 2016 3:28 am
by ESP_Angus
Hi ry1234,

Short/simple answer: You should be able to specify COM27 in the menuconfig (or running "make flash ESPPORT=COM27" on the command line and it should flash correctly.

Long/MSYS-is-tricky answer: The default Python installation (including pyserial) runs in pure mingw32 mode rather than MSYS2 mode. This was specifically so that COM ports could be used by their normal names, because I wasn't sure how well pyserial would run when compiled in MSYS mode, and because the precompiled binary package on pypi used this compilation mode also. It's interesting that it seems to have resolved /dev/ttyS26 to the correct COM even though it can't follow through with opening it. I can't explain that!