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

fix(spi_attach): Unattach previously attached SPI flash (ESPTOOL-847) #66

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

radimkarnis
Copy link
Collaborator

@radimkarnis radimkarnis commented Jul 30, 2024

Fixed --spi-connection not working correctly in esp-stub-flasher (original esptool.py commit: espressif/esptool@afaa7d2)

  • Stub flasher calls spi_flash_attach automatically during boot-up, while ROM does this only when SPI_ATTACH command is sent by esptool. This means, that stub flasher essentially tries to attach a flash chip twice if --spi-connection is used.
  • It is needed to "unattach" the flash chip before attaching another one. This is now done by reconfiguring the SPI pins in the IO MUX back to function as standard GPIOs.
  • This fixes the failing test_short_flash_to_external_stub in esptool test suite.

@radimkarnis radimkarnis requested a review from dobairoland July 30, 2024 13:14
@radimkarnis radimkarnis force-pushed the main branch 2 times, most recently from b47f48c to f45f711 Compare July 30, 2024 13:26
@jessebraham
Copy link
Member

jessebraham commented Jul 30, 2024

That new lint rule is a bit annoying, you can just append this to the end of Cargo.toml to silence that:

[lints.rust]
unexpected_cfgs = "allow"

@dobairoland dobairoland changed the title fix(spi_attach): Unattach previously attached SPI flash fix(spi_attach): Unattach previously attached SPI flash (ESPTOOL-847) Jul 30, 2024
Copy link
Collaborator

@dobairoland dobairoland 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 @radimkarnis.

src/targets.rs Outdated Show resolved Hide resolved
Copy link
Member

@jessebraham jessebraham 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!

@jessebraham jessebraham merged commit 3dd973a into esp-rs:main Jul 30, 2024
22 checks passed
@radimkarnis
Copy link
Collaborator Author

@jessebraham @dobairoland thanks for the quick reviews!

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.

3 participants