Skip to content

Rework Getting Started chapter #202

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

Open
wants to merge 8 commits into
base: esp-hal@1
Choose a base branch
from
Open

Conversation

bjoernQ
Copy link
Contributor

@bjoernQ bjoernQ commented Jul 7, 2025

This is a rewrite of the "Getting Started" chapter based on the inputs from #177

Details about espflash and probe-rs are mostly removed ("We shouldn't be explaining what the flashing tools do and how to use them here in the getting started section.")

This way we get people to the point running their first lines of Rust code on ESP32 quicker without confusing them.

Before, we explained a lot of things which esp-generate takes care of. Also mentioning "espflash can be used as a library" is not useful at this stage. We don't mention cargo-espflash,cargo-embed etc. anymore - users won't need them so why bothering them with this

The toolchain installation needs rework (basically untouched here) once we explain things like RISC-V vs Xtensa in the previous chapters.

I added some comments here where I assume things need more discussion

@bjoernQ bjoernQ force-pushed the rework-getting-started branch from 13b9ce2 to 564c866 Compare July 8, 2025 08:01
@bjoernQ bjoernQ force-pushed the rework-getting-started branch from 29a3372 to 87fe2d5 Compare July 9, 2025 10:48
@@ -0,0 +1,52 @@
# Using `esp-generate`

With all the necessary tools installed, you're ready to create your first Rust project for ESP32.
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick: "ESP32" migth be confusing, even though if they read the book until here they should already know that we support "all" the esp32 variants


[cargo-binstall]: https://github.com/cargo-bins/cargo-binstall
[releases]: https://github.com/esp-rs/espflash/releases
[espflash]: https://github.com/esp-rs/espflash/tree/main/espflash/
Copy link
Member

@SergioGasquez SergioGasquez Jul 10, 2025

Choose a reason for hiding this comment

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

We have already defined [espflash] above, hence both links point to https://github.com/esp-rs/espflash

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing this out 👍

(BTW I really dislike having links defined all over the place instead of in one place at the end of the document)

esp-generate --chip esp32c3 your-project-name
```

<!-- 0.4.0 doesn't include the full interactive mode, yet --->
Copy link
Member

Choose a reason for hiding this comment

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

0.5.0 is released now, we can remove this comment

Make sure to replace the chip type and project name as needed. You can also leave them out and `esp-generate` will prompt you for them.

<!---
I think a screenshot would make all this look a bit more interesting - but the drawback is it will "always" be outdated.
Copy link
Member

Choose a reason for hiding this comment

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

I SC will be handy, whilst more options might come (and some might go), the general structure is likely to stay the same for a long while. Let's add a SC.

I think a screenshot would make all this look a bit more interesting - but the drawback is it will "always" be outdated.
--->

> 💡 **Hint**: Prefer a non-interactive setup? You can specify configuration options directly using the `-o/--options` flag.
Copy link
Member

Choose a reason for hiding this comment

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

Eh, I feel like beyond us using it in CI, this isn't worth writing about.

<!---
TODO: This needs some rework based on https://github.com/esp-rs/espup/issues/498

In general in previous chapters we need to explain RISC-V vs Xtensa etc.
Copy link
Member

Choose a reason for hiding this comment

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

## Toolchain Installation

<!---
TODO: This needs some rework based on https://github.com/esp-rs/espup/issues/498
Copy link
Member

Choose a reason for hiding this comment

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

It's really annoying that build-std isn't stable. If it were, I'd recommend that over any "rustup toolchain add" bits. Regardless of the outcome of that issue, we still need to document installing esp toolchain for xtensa chips. I would assume riscv as the happy path, and then follow on to mention xtensa for the esp32,esp32s2 and esp32s3

@@ -94,9 +91,3 @@ The forked compiler can coexist with the standard Rust compiler, allowing both t
[llvm-github-fork]: https://github.com/espressif/llvm-project
[gcc-toolchain-github-fork]: https://github.com/espressif/crosstool-NG/
[rustup-overrides]: https://rust-lang.github.io/rustup/overrides.html

#### Building the Rust Compiler with Xtensa Support from Source
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Given this is a "getting started" guide we should not even mention this IMHO

(We might or might not add something about this to a future advanced section - but even then we should tell people why they might consider this)

Copy link
Member

Choose a reason for hiding this comment

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

I agree, no one should ever build this compiler (except for me I guess :D)

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