-
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
esptool via python code - Failed to enter Flash download mode. Only got 2 byte status response. (ESPTOOL-945) #1022
Comments
Duplicate here: https://esp32.com/viewtopic.php?f=13&t=42469 |
When you initialize the ESP32-S3 ROM sends 4 status bytes in a response (read here), but the stub flasher sends only 2 bytes.
If you inspect how |
Search for Btw, in the next release, we plan to make esptool easier to use as a Python module. Feel free to share more of your experience with writing a custom script using esptool. We'll take this as a feedback of the current state. |
@radimkarnis thank you for the quick reply. Happy to help provide feedback on flashing via code, if at least providing a concise example of how to flash through this effort here 👍 I'm getting further; I took you advise and I'm executing the commands via the stub.
I'm seeing the stub loader raising this error
I think I was getting this from an old example, possibly for an older version of esptool. Where would I look for an example of how to flash a region? |
Update, I think I have it working: Please advise if I'm doing it correctly, especially around if last block is handled correctly, since it will not be a whole block size:
|
In theory, this looks good, except for the last block handling. Esptool pads the last block with I would advise you to study the |
Operating System
Linux
Esptool Version
4.8.1
Python Version
3.11.9
Full Esptool Command Line that Was Run
N/A
Esptool Output
I'm trying to flash an ESP32-S3 within my python program. using esptool (4.8.1) I can successfully flash using the command line version of esptool.py:
However, my sample code (using the same esptool version) generates an error when calling esp.flash_begin():
Failed to enter Flash download mode. Only got 2 byte status response.
failing sample code
It works up until the flash_begin command:
I'm assuming there might be additional setup / configuration within the code, or there is a bug in esptool.
I have tested it successfully with this approach. However, I need to use a progress callback, so calling esptool.main() with args is not an option.
The text was updated successfully, but these errors were encountered: