-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Timed out waiting for packet header" on kernel 5.13.10 (only for CH340 + ESP8266) [fixed in kernels 5.14 & 5.13.14] (ESPTOOL-291) #653
Comments
Hello @jypma, can you see any output from the chip (e.g. ESP8266 boot log) if you connect with a terminal application (e.g. miniterm)? Please, try baud rates 74880 and 115200. You also may want to press the reset button a few times for anything to appear. Radim |
Yes, e.g. on the NodeMCU when I hold "flash" and then press "reset", I get (on 74880 baud)
(that's on kernel 5.13.10-arch1-1) |
Great! That means the USB-UART communication is working, but there might be a problem with the timing of the DTR and RTS signals. Now, if you put the chip into download mode manually (as you just did by holding "flash" and then pressing "reset") OR if you hold the "flash" button and try |
No change trying holding down flash, nor holding flash and pressing reset. Though, if I mash "flash" and then "reset" repeatedly while |
I do have a logic analyzer. Would it help if I try to capture a timing diagram? I could try to grab RX, TX and RST (and perhaps GPIO15?), and see what that brings. If I find the time :) |
Hi! |
@k4r4c Thanks for chiming in! What happens for you if you boot from the |
Thank you @jypma for looking into this. @k4r4c thanks for the confirmation. can you please specify which USB to serial chip are you using? |
If I compare the two, it looks like the incoming request to to handshake (on RX) comes too early after the initial boot message (on TX), in the non-working case. This is probably related to the GPIO2 "jiggling" starting ~25ms later in the newest kernel. |
@jypma On linux-lts 5.10.56, with esptool.py v3.2-dev, the problem is gone. I successfully connect and flash the esp. |
I can confirm this issue up to linux-5.14-rc5. No flashing possible until I downgrade kernel to 5.10.52. @jypma I attached your images to the bug report. Sorry for stealing. |
@pauledd Thanks a lot for forwarding the bug, and no problem :-) |
I have the same problem. Is the bug already fixed? i tried
So it seems that i already habe the latest esptool.py Version installed, haven't I? But when i upload a sketch in Arduino IDE it still shows "esptool.py v3.0" Thank you for your help. Daniel |
Hello @basementmedia2, Your upload problems are probably caused by something else. I recommend going through the troubleshooting guide. Radim |
Thank you everyone for your help with investigating this issue! The bug has been identified to be in the kernel. It should be already reverted and backported. There will be no action taken from the side of esptool. I will leave this issue open until someone confirms this. |
I have just re-compiled my VoidLinux Kernel 5.13 using xbps-src and the patch provided by Johan Hovold and it fixed the problem with my USB ch341 and esptool. It may take some time until this patch is available for the various Linux distros out there, but the fix itself works. |
Sound great ! |
Thank you @ufud-org for the confirmation. Closing this issue, feel free to reopen if you feel like further discussion is needed. |
Do we know in which version did this got fixed? We could update the issue title for future reference. |
Link below is tagged 5.14-rc8 but backport to stable is also being mentioned: https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial.git/tag/?h=usb-serial-5.14-rc8 |
Hi, i am a Linux beginner and use Manjaro 21.1.0. Sorry for this maybe stupid beginner querstions ;-( |
Hey thanks for the question but installing Linux kernels is out of scope for the esptool issue queue. You will get a good answer if you go to the Manjaro forums (https://forum.manjaro.org/), there you can find people who are experts on installing Linux kernels. I can also recommend to read the official Manjaro documentation page (https://wiki.manjaro.org/index.php/Manjaro_Kernels) that explains how to install new kernel versions and choose between them. Good luck! |
I can confirm that this has been fixed in kernel According to changelogs, the fix is in 5.13.14 already as well. |
Thanks @ttencate! |
Yes, great. Just updated the kernel and it works ;-) |
I hit this bug by upgrading to the latest Ubuntu 20.04.3 LTS kernel yesterday:
Downgrading to the previous kernel version fixes the problem:
|
FYI: For Ubuntu 21.04, Kernel 5.11.0-36 works fine, while 5.11.0-37 is affected. |
For me, the painless solution was to use "Advanced boot options" (or similar) at boot and select an older kernel. No other mods required. |
It's not quite painless on some of recent Ubuntu versions which don't bother showing a boot prompt. There are tons of obsolete search results to sift through to find out how to display that boot prompt. The biggest challenge, though, is knowing enough to even suspect that this is a Linux kernel issue. It took me about 8 hours of trial and error, to eliminate all other potential problems, before I somehow did a search for a kernel bug. |
downgrading kernel now work |
I also encountered a similar problem. Here's some information from my OS: Python 3.9.5 esp-idf: e8bdaf91986a41678adc6be13888fc037b1acb68 lewin@mint0:~/workspace/micropython/ports/esp32$ /home/lewin/.espressif/python_env/idf4.4_py3.9_env/bin/python ../../../../esp/esp-idf/components/esptool_py/esptool/esptool.py -p /dev/ttyACM0 -b 115200 --before default_reset --after no_reset --chip esp32s3 write_flash --flash_mode dio --flash_size 16MB --flash_freq 80m 0x0 build-LILYGO_T5-4.7-PLUS/bootloader/bootloader.bin 0x8000 build-LILYGO_T5-4.7-PLUS/partition_table/partition-table.bin 0x10000 build-LILYGO_T5-4.7-PLUS/micropython.bin
esptool.py v3.3.2
Serial port /dev/ttyACM0
Connecting...
Chip is ESP32-S3
Features: WiFi, BLE
Crystal is 40MHz
MAC: 68:b6:b3:21:35:04
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00006fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x00010000 to 0x00173fff...
Compressed 25280 bytes to 15122...
Wrote 25280 bytes (15122 compressed) at 0x00000000 in 0.5 seconds (effective 433.6 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 117...
Wrote 3072 bytes (117 compressed) at 0x00008000 in 0.0 seconds (effective 523.2 kbit/s)...
Hash of data verified.
Compressed 1455232 bytes to 986726...
Wrote 1455232 bytes (986726 compressed) at 0x00010000 in 16.8 seconds (effective 691.7 kbit/s)...
A fatal error occurred: Packet content transfer stopped (received 25 bytes) Any suggestions are welcome! ! ! |
Hi @lbuque, |
I tried it and it still fails. lewin@mint0:~/workspace/micropython/ports/esp32$ esptool.py -p /dev/ttyACM0 -b 115200 --before default_reset --after no_reset --chip esp32s3 write_flash --flash_mode dio --flash_size 16MB --flash_freq 80m 0x0 build-LILYGO_T5-4.7-PLUS/bootloader/bootloader.bin 0x8000 build-LILYGO_T5-4.7-PLUS/partition_table/partition-table.bin 0x10000 build-LILYGO_T5-4.7-PLUS/micropython.bin
esptool.py v4.5
Serial port /dev/ttyACM0
Connecting...
Chip is ESP32-S3 (revision v0.1)
Features: WiFi, BLE
Crystal is 40MHz
MAC: 68:b6:b3:21:35:04
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00006fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x00010000 to 0x00173fff...
Compressed 25280 bytes to 15122...
Wrote 25280 bytes (15122 compressed) at 0x00000000 in 0.3 seconds (effective 644.2 kbit/s)...
A fatal error occurred: Packet content transfer stopped (received 25 bytes) |
I've recently been having problems trying to flash any ESP8266 board that has a CH340 USB on Linux, with kernel 5.13.10. Flashing with kernel 5.10.56-1-lts works fine with the same boards. Flashing using a different USB-to-serial (e.g. cp210x) works fine with the latest kernel, as does flashing an ESP32.
Only an ESP8266 with CH340 doesn't work, which includes my NodeMCU and D1 mini boards.
Operating system
Arch Linux, kernel 5.13.10-arch1-1
Python version
3.9.6
What Chip
ESP8266
What development board or other hardware is the chip attached to
Tried a NodeMCU and a D1 mini (both have CH340 for USB)
Is anything else attached to the development board, except for the serial flasher connections?
Bare boards.
Are you running esptool.py from an IDE such as Arduino or Eclipse?
No IDE
Full esptool.py command line that was run:
Full output from esptool.py (on kernel 5.13.10-arch1-1)
I've ran esptool once more with trace information, in case that should be of any help (``):
Full output from esptool.py (on kernel 5.10.56-1-lts)
As you can see, on the LTS kernel connectivity is fine.
The text was updated successfully, but these errors were encountered: