-
Notifications
You must be signed in to change notification settings - Fork 13.3k
a single esptool command for erasing and flashing #6765
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
Conversation
(and update to esptool-2.8)
@ChazTuna @janzieg @s0170071 @f5soh |
esptool v2.8 looks good, tested basic programmer without dtr and Nodemcu v0.9 : full erase, partial erase and only sketch A little improvement will be output scrolling while writing.
|
That, I thought it was only an effect on my setup (linux, xcfe) but it appears to be true even on windows. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor tweaks. I still need to run it to verify but it seems good.
I think it's all on the IDE here (as in we can't do anything on our end), but maybe if we disabled any buffering on stdout/stderr in the Python before calling esptool it might do something? Adding |
Just tested it, and |
is the upload.py still necessary? can't esptool command line be directly configured in platform.txt? |
Not the way it's being done here. We simulate the erase_region bit by writing 0xffs (i.e. erased) to the block, and need to generate a file to make that happen (hence the Python code above) |
Espressif recommends blank.bin |
Previous esptool.exe was using \n instead of \r |
@JAndrassy our temp file is filled with 0xff just like espressif's blank.bin is. |
Ah, it might make sense to put a PR in esptool.py repo to check if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @JAndrassy might have a point about just using esptool directly now, but given we need to convert 921k to 460k anyway I don't see how we can avoid having the separate script (which originally was only there because we needed 2 calls to esptool and Arduino doesn't support numbered .upload.2.xxx recipes.)
But looks workable now and avoids multiple resets, so I'm for merging it.
It will be easier when/if we have another |
When esptool is run from the Arduino IDE, the output window doesn't scroll because of the \rs used to make the console update status on a single line. To avoid this, don't attempt to output everything on a single line when scripted (i.e. not running on a TTY) by replacing \r with \n. See esp8266/Arduino#6765 for some discussion.
When esptool is run from the Arduino IDE, the output window doesn't scroll because of the \rs used to make the console update status on a single line. To avoid this, don't attempt to output everything on a single line when scripted (i.e. not running on a TTY) by replacing \r with \n. See esp8266/Arduino#6765 for some discussion.
PR esp8266#6765 introduced an incompatibility with the existing Java uploaders for SPIFFS and LittleFS, breaking them because of the upload.py parameter format change to support single stage erase/upload. Add in patch to silently eat the single --end and to parse the write address and filename properly as generated by calls from the plugins, while retaining compatibility with the current IDE changes.
* Make upload.py compatible with existing FS upload PR #6765 introduced an incompatibility with the existing Java uploaders for SPIFFS and LittleFS, breaking them because of the upload.py parameter format change to support single stage erase/upload. Add in patch to silently eat the single --end and to parse the write address and filename properly as generated by calls from the plugins, while retaining compatibility with the current IDE changes. * Clean upload.py, make platform use write_flash Make upload.py more concise and pythonic. Use the "write_flash" argument in platform.txt for uploads instead of assuming anything that is a file is the bin to upload.
Per #6755 (comment)
(thanks @projectgus for the hints)
esptool:
fixes #6755