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

Implement new USB Serial JTAG reset strategy #779

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

JurajSadel
Copy link
Contributor

This is mostly experimental, so opening as a draft.

I've been playing with (cc cc #691) and I was able to reproduce the issue with espflash AND esptool as well, following the same steps as mentioned here
I looked into esptool and specifically to this commit. esptool not using this fix as default for SERIAL_JTAG, it can be used manually with:
--after reset_watchdog

The reasons (from esptool perspective) it's not on by default are:

  1. The RTC WDT hack is not available on all devices (e.g., the H2 doesn't have it).
  2. On Linux, it causes the port to re-enumerate, meaning that instead of /dev/ttyUSB0, a new /dev/ttyUSB1 appears. This can cause the monitor to disconnect and not reconnect automatically.
  3. On the C6 and H2 USB-Serial/JTAG controller, there is a bug that causes the port to disappear after a system reset and not reappear until a power cycle is performed. The RTC WDT reset is a system reset, so this issue occurs. So they left it by default only for USB-OTG and is optional for SERIAL_JTAG. On C6 it is NOT SUPPORTTED at all in esptool.

@JurajSadel JurajSadel marked this pull request as ready for review February 24, 2025 10:21
@JurajSadel
Copy link
Contributor Author

Should I add a P4 here as well?

Copy link
Member

@SergioGasquez SergioGasquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments that build on top of cleanups of #795

@jessebraham
Copy link
Member

I think this still needs a fair bit of work, let me play around with it a bit tomorrow and I will try to give some more concrete feedback.

@jessebraham jessebraham changed the title Add watchdog reset experiment Implement new USB Serial JTAG reset strategy Mar 11, 2025
@jessebraham
Copy link
Member

Still not 100% happy with this, but I think it's in much better shape now at least. Remaining concerns are fairly minor, can be handled at another time (or just ignored 😁).

Copy link
Member

@SergioGasquez SergioGasquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks

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.

4 participants