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/JTAG-SERIAL Issues #153

Closed
bjoernQ opened this issue Apr 7, 2022 · 3 comments · Fixed by #157
Closed

Windows/JTAG-SERIAL Issues #153

bjoernQ opened this issue Apr 7, 2022 · 3 comments · Fixed by #157
Labels
bug Something isn't working

Comments

@bjoernQ
Copy link
Contributor

bjoernQ commented Apr 7, 2022

Flashing on Windows (11) via JTAG-SERIAL has some issues

  • the chip is not reset after flashing
  • monitoring doesn't start after flashing if invoked with the --monitor option (most probably because it "hangs" in an attempt to reset the chip?)

Manually pushing the reset button and using "espmonitor" works however.

Windows Version: Microsoft Windows [Version 10.0.22000.556]

Used the ESP-Rust board, also a vanilla ESP32C3 shows the same behavior

@MabezDev
Copy link
Member

@JurajSadel I believe you ran into this at one point? Any ideas?

@bjoernQ
Copy link
Contributor Author

bjoernQ commented Apr 11, 2022

I can make it locally work for me with replacing reset in connection.rs with this

pub fn reset(&mut self) -> Result<(), Error> {
        sleep(Duration::from_millis(100));

        if self.port_info.pid == USB_SERIAL_JTAG_PID {
            self.serial.write_data_terminal_ready(false)?;
            self.serial.write_request_to_send(false)?;

            sleep(Duration::from_millis(100));

            self.serial.write_data_terminal_ready(false)?;
            self.serial.write_request_to_send(false)?;

            sleep(Duration::from_millis(100));

            self.serial.write_request_to_send(true)?;
            self.serial.write_data_terminal_ready(false)?;
            self.serial.write_request_to_send(true)?;

            sleep(Duration::from_millis(100));

            self.serial.write_data_terminal_ready(false)?;
            self.serial.write_request_to_send(false)?; 
    
        } else {
            self.serial.write_data_terminal_ready(false)?;
            self.serial.write_request_to_send(true)?;
    
            sleep(Duration::from_millis(100));
    
            self.serial.write_request_to_send(false)?;    
        }

        Ok(())
    }

Probably even less code would do ... just copied and adapted the code from reset_to_flash - CTRL+R still doesn't work then since there we have similar code duplicated (so changing it there should do the trick) - however I'm wondering why it's apparently just me and why it's only on Windows

@JurajSadel
Copy link
Contributor

@MabezDev For some reason, the SW reset or write_requet_to_send() is not working correctly on Windows, when the chip (with USB-serial-JTAG) is in download mode. Unfortunately, I don't know the root cause of this, yet - if it's in serialport or in a deeper layer like the driver, for example, and I'm not sure, how to debug it. I'm sorry I didn't bring anything new to this issue.

@bjoernQ you're not alone, I do have the same issues on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants