-
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
espefuse.py show struct.error: unpack requires a buffer of 20 bytes (IDFGH-12938) (ESPTOOL-867) #982
Comments
Hello @AxelLin, I cannot reproduce this issue locally, but I expected that. There are hints of possible HW issues in your logs: The first step (erasing flash) should reset the chip after the operation is done ( In total, there should be two resets between the operations - meaning there is no chance that the stub flasher or any other code loaded to RAM would continue to run. Yet, we get a confirmation that the stub flasher is still running ( That means there is a chance the resets are not happening, and the stub flasher keeps running - that confuses esptool, because the responses from the ROM bootloader have a different length than the ones from the stub flasher. What's weird is that esptool should account for this if the stub is detected. Let's try to explore this assumption. Can you verify that the chip is resetting? How do you connect the chip (with a classic USB-to-UART bridge, or the USB-Serial/JTAG peripheral)? If it is the classic way, are the DTR and RTS lines connected properly? If you use the Thanks! |
Hi @radimkarnis I use a classic USB-to-UART bridge, the RTS line is not connected to chip_en pin. Adding --no-stub argument does not help, I got below error: |
@AxelLin, it seems like you hit a very specific case, which is not covered in esptool (it is not expected the RTS line will be disconnected). A quick workaround is to delete the Please let me know if that helped! I will try to fix this edge case in the meantime. |
Answers checklist.
IDF version.
v5.2.1-537-g9cf323d4c6
Operating System used.
Linux
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
None
What is the expected behavior?
Below commands should work:
esptool.py --chip esp32s3 -p /dev/ttyUSB0 --before default_reset --after hard_reset erase_flash --force
espefuse.py --before default_reset --chip esp32s3 --port /dev/ttyUSB0 summary
What is the actual behavior?
Steps to reproduce.
Below script can reproduce this issue:
Build or installation Logs.
No response
More Information.
Also note if I don't execute erase_flash, the espefuse.py command works fine.
The text was updated successfully, but these errors were encountered: