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

Esp8266 baud rate ignored with Flasher::connect #472

Closed
loucass003 opened this issue Sep 14, 2023 · 4 comments
Closed

Esp8266 baud rate ignored with Flasher::connect #472

loucass003 opened this issue Sep 14, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@loucass003
Copy link

I am trying to flash an esp8266 board with a speed of 921600

but the flasher baud is ignored in the connect function

// Now that we have established a connection and detected the chip and flash
        // size, we can set the baud rate of the connection to the configured value.
        if let Some(baud) = speed {
            match flasher.chip {
                Chip::Esp8266 => (), // Not available
                _ => {
                    if baud > 115_200 {
                        warn!("Setting baud rate higher than 115,200 can cause issues");
                        flasher.change_baud(baud)?;
                    }
                }
            }
        }

this does not seem right as I am in fact able to call the function after using connect and the flashing does complete without issue.

   let mut flasher = Flasher::connect(interface, info.clone(), Some(921600), true).expect("unable to connect");
   flasher.change_baud(921600).unwrap();

is there a particular reason on why the esp8266 is ignored and not simply prompting the warning like the others?

@jessebraham jessebraham added the bug Something isn't working label Sep 14, 2023
@jessebraham
Copy link
Member

I don't know that there's any specific reason for this. Seems to have been this way since 2020 when it was added.

Looking at esptool it doesn't look like they support setting the baud rate for the ESP8266 either, unless I've missed something. It's been so long since I've used that chip I frankly don't remember much about it, sorry.

@loucass003
Copy link
Author

loucass003 commented Sep 15, 2023

from esptool code
https://github.com/espressif/esptool/blob/master/esptool/loader.py#L1084-L1085
could it be that the STUB loader allows for the baud rate to be changed ?

Edit:

it looks like there is not even a check at all
https://github.com/espressif/esptool/blob/master/esptool/loader.py#L313
as you can set the baudrate directly from the aguments

@loucass003
Copy link
Author

Ok so after investigating a bit more on this, it looks like you can set the baudrate higher than 115200 after loading the stub.

So initially you shoud:

  • Open the connection at 115200
  • Upload the stub if supported
  • after the stub is loaded you can set the baudrate higher like 921600

@jessebraham
Copy link
Member

We've decided to drop support for the ESP8266 (see #576), so closing this issue.

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
Archived in project
Development

No branches or pull requests

2 participants