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

Return code 1 for the " can not exit the download mode over USB" warning confuses external processes (ESPTOOL-728) #912

Closed
EternityForest opened this issue Aug 23, 2023 · 3 comments

Comments

@EternityForest
Copy link

Is your feature request related to a problem?

When a manual reset is required, the flasher process exits with return code 1, causing scripts that call it to think there was a failure.

Describe the solution you'd like

I think it would be helpful to either change it to return 0 unless there is a true error, or better yet reserve and document a specific error code just for indicating that a manual reset is required, so that automated tools can correctly interpret things.

I'm not that familiar with the tool in general, but I think having some well defined way to access the status would be helpful.

Describe alternatives you've considered

No response

Additional context

No response

@github-actions github-actions bot changed the title Return code 1 for the " can not exit the download mode over USB" warning confuses external processes Return code 1 for the " can not exit the download mode over USB" warning confuses external processes (ESPTOOL-728) Aug 23, 2023
@radimkarnis
Copy link
Collaborator

Hello @EternityForest,

the reset behavior can be changed with the --after option. If --after no_reset is used, then the error message is not printed and esptool exits with return code 0.

--after hard_reset is set by default, resulting in the error if USB-OTG mode is used (other modes don't require manual reset).

I believe the correct fix is for the automated tools to correctly configure esptool and set the --after option accordingly if USB-OTG is used to prevent the failure.

@EternityForest
Copy link
Author

It would be nice to keep the message so the user knows what to do, and still try to reset if it's possible to do so. I suppose you could keep a list on the tool side of which boards should get which option, but that seems not very DRY.

Maybe an --after auto_reset option could be added to do it?

@radimkarnis
Copy link
Collaborator

I suppose you could keep a list on the tool side

This should be done by the framework and esptool configured accordingly to this. e.g. the user selects a USB32-S2 board, and chooses the USB-OTG mode -> the framework should automatically add the --after no_reset option to the esptool command.

I am sorry, but we try to not add any new options or argument choices if not absolutely necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants