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

Windows USB serial workaround: set DTR after RTS #554

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions espflash/src/connection/reset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,24 +92,24 @@ impl ResetStrategy for ClassicReset {
"Using Classic reset strategy with delay of {}ms",
self.delay
);
self.set_dtr(interface, false)?;
self.set_rts(interface, false)?;
self.set_dtr(interface, false)?;

self.set_dtr(interface, true)?;
self.set_rts(interface, true)?;
self.set_dtr(interface, true)?;

self.set_dtr(interface, false)?; // IO0 = HIGH
self.set_rts(interface, true)?; // EN = LOW, chip in reset
self.set_dtr(interface, false)?; // IO0 = HIGH

sleep(Duration::from_millis(100));

self.set_dtr(interface, true)?; // IO0 = LOW
self.set_rts(interface, false)?; // EN = HIGH, chip out of reset
self.set_dtr(interface, true)?; // IO0 = LOW

sleep(Duration::from_millis(self.delay));

self.set_dtr(interface, false)?; // IO0 = HIGH, done
self.set_rts(interface, false)?;
self.set_dtr(interface, false)?; // IO0 = HIGH, done

Ok(())
}
Expand Down