Skip to content

fix: esp32c3 direct boot#358

Merged
jessebraham merged 3 commits into
esp-rs:mainfrom
rustbox:fix/esp32c3-direct-boot
Mar 8, 2023
Merged

fix: esp32c3 direct boot#358
jessebraham merged 3 commits into
esp-rs:mainfrom
rustbox:fix/esp32c3-direct-boot

Conversation

@sethp

@sethp sethp commented Mar 1, 2023

Copy link
Copy Markdown
Contributor

Prior to this change, attempting to espflash flash with the --format direct-boot argument targeting an esp32c3 would fail, reporting:

Error: espflash::unsupported_image_format

  × Image format direct-boot is not supported by the esp32c3 revision v0.3
  help: The esp32c3 only supports direct-boot starting with revision 3

However, direct-boot on this board was working prior to the changes in
b25af06, and looking at the docs it seems that the
mapping that was chosen for the c3 specifically was v0.REVISION:

ECO Revision (Major.Minor)
ECO1 v0.1
ECO2 v0.2
ECO3 v0.3
ECO4 v0.4

Additionally, this PR contains a small cleanup change (f0ab4dd) and a proposal for moving/updating the error message emitted above.

sethp added 3 commits March 1, 2023 15:37
Prior to this change, attempting to `espflash flash` with the `--format
direct-boot` argument targeting an esp32c3 would fail, reporting:

```
Error: espflash::unsupported_image_format

  × Image format direct-boot is not supported by the esp32c3 revision v0.3
  help: The esp32c3 only supports direct-boot starting with revision 3
```

However, direct-boot on this board was working prior to the changes in
b25af06, and looking at the [docs][esp32c3 revisions] it seems that the
mapping that was chosen for the `c3` specifically was `v0.REVISION`:

> ECO  | Revision (Major.Minor)
> -----------------------------
> ECO1 | v0.1
> ECO2 | v0.2
> ECO3 | v0.3
> ECO4 | v0.4

[esp32c3 revisions]: https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/api-reference/system/chip_revision.html#revisions
This change rewords the error message from "revision 3" to "revision 3
(v0.3)" in an effort to clarify the mapping between hardware revisions
and major/minor version numbers.

Additionally, it moves the esp32c3-specific error closer to the actual
version check to make it easier to keep both in sync.
Previously, `cargo check --all-targets` reported this import as unused.
Since it's just `const u16`, the import is probably side-effect free and
indeed safe to remove.

@jessebraham jessebraham left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry for taking so long to get to this, thanks for the fix!

@jessebraham jessebraham merged commit 7a67c41 into esp-rs:main Mar 8, 2023
@sethp sethp deleted the fix/esp32c3-direct-boot branch March 8, 2023 17:10
@sethp

sethp commented Mar 8, 2023

Copy link
Copy Markdown
Contributor Author

Not a problem, 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.

2 participants