Skip to content
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

Configurable chip erase timeout #111

Closed
wants to merge 4 commits into from

Conversation

breiler
Copy link

@breiler breiler commented Sep 16, 2023

I have a device where the flash erase takes around 12 seconds and will intermittently fail when the timeout is reached.

A simple fix would be to increase the default 12 second timeout, but I decided to make it configurable instead making it possible to override it.

I know that the ESPLoader.CHIP_ERASE_TIMEOUT can be overrided by accessing it directly. But considering its naming pattern with upper case I assume that it should be considered a constant.

@balloob
Copy link
Contributor

balloob commented Oct 30, 2023

How does esptool.py define this value? It seems weird that we would expect users to come up with a value. Should we define a default per chip?

@breiler
Copy link
Author

breiler commented Oct 30, 2023

I have boards with the same specs but from different vendors, and they behave differently...

To have the user not needing to care about this would be great, but I think that it will be hard to find one optimal setting for each chip?

Looks like esptool has one default setting with the option to override it:
https://github.com/search?q=repo%3Aespressif%2Fesptool%20chip_erase_timeout&type=code

@balloob
Copy link
Contributor

balloob commented Oct 30, 2023

Ha, their timeout is 120s!

Since the goal of esptool.js is to stay in sync with the Python version, I suggest we adopt that timeout instead.

@breiler
Copy link
Author

breiler commented Oct 30, 2023

Lol, I lazily read 12:ish something and thought that it was 12 seconds... 🤦🏻‍♂️
Well that will be enough to fix our use case.

I can close this PR if you don't see the value of adding the option to override the timeout as well (like they have in esptool.py).

@breiler breiler closed this Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants