-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
- Operating system: Linux
- Python version: 2.7
- ESP hardware in use: WeMos Mini D1 (ESP8266 + ch341 serial chip)
Full esptool.py command line as run:
esptool.py --chip esp8266 --port /dev/ttyUSB0 --baud 921600 write_flash 0x0 images/fifty_kb.bin
(as run by test_esptool.py)
Full output from esptool.py (please copy and paste all lines of output)
esptool.py v2.7-dev
Serial port /dev/ttyUSB0
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: dc:4f:22:1d:87:df
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
A fatal error occurred: Invalid head of packet (0xE0)
What is the expected behaviour?
As noted in the Arduino ESP8266 repo, flashing this board with 921600bps works in esptool-ck:
$ ./esptool -cd nodemcu -cb 921600 -v -cp /dev/ttyUSB0 -cf ~/esp/esptool-py/test/images/fifty_kb.bin
esptool v0.4.13 - (c) 2014 Ch. Klippel <[email protected]>
opening port /dev/ttyUSB0 at 921600
opening bootloader
resetting board
trying to connect
trying to connect
Uploading 51200 bytes from /home/gus/esp/esptool-py/test/images/fifty_kb.bin to flash at 0x00000000
.................................................. [ 100% ]
starting app without reboot
closing bootloader
And using 460800bps serial works fine in esptool.py as well.
Do you have any other information from investigating this?
- esptool-ck uses the auto-baud feature of the ESP8266 to establish a link at 921600 and then keeps using that rate.
- esptool.py establishes the link at 115200bps and then switches serial to a higher rate based on the multiplier that is being used for 115200bps. This is more reliable for at least some hardware where auto-bauding at high rates sometimes results in baud mismatch. It also aims to account for any clock skew between the serial device and the ESP device's crystal.
Probably the "switch to new baud rate" has a bug, or actually works less well on some devices (or with some drivers?).
Further investigation needed. This is not high priority, as @earlephilhower notes at the linked PR esptool.py is still faster here due to the compressed upload feature (beyond a certain point, the limiting factor becomes flash erase & write times rather than serial transfer times.)
Metadata
Metadata
Assignees
Labels
No labels