This repository contains Training Material for learning to use Embedded Rust with no_std
with the Espressif ESP32-C3.
We suggest you start by reading the book.
Getting-started guide on using the Rust with Espressif SoCs using no_std.
Home Page: https://esp-rs.github.io/no_std-training/
License: Apache License 2.0
This repository contains Training Material for learning to use Embedded Rust with no_std
with the Espressif ESP32-C3.
We suggest you start by reading the book.
Context: I have a reasonable Rust experience, but zero experience with ESP32. I got the ESP32-C3-RUST dev board and followed the https://esp-rs.github.io/no_std-training/ up until the http client example.
The example requires you to configure the clocks, but that's a bit of an abrupt departure. There's no link to the documentation for this.
Only when using Visual Code Studio can I find the hal crate, but it doesn't really make it clear how to proceed from here. By grepping around deep inside .cargo I finally find examples-util/src/lib.rs that suggests I should use ClockControl::configure(system.clock_control, CpuClock::Clock160MHz).freeze();
but I'm at a loss at how I was supposed to have known that.
I imagine I'm not the only to be confused at this point.
ADD: this is apparently only the beginning of the trouble. Hopefully there is documentation that I'm just missing.
I've tried following https://esp-rs.github.io/no_std-training/ but had troubles compiling the http-client
example.
Steps to reproduce (running on NixOS):
$ rustup toolchain install nightly-2023-06-25 --component rust-src --target riscv32imc-unknown-none-elf
$ rustup --version
rustup 1.26.0 (1980-01-01)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.72.0-nightly (f7ca9df69 2023-06-24)`
$ git clone https://github.com/esp-rs/no_std-training
$ cd no_std-training/intro/http-client/
$ cargo run --release --example http-client
I have attached the build output: http-client.txt.
I'm not very familiar with Rust, but it looks like dependencies embedded-io
and linked_list_allocator
failed to build.
I was able to build the hello world, per https://esp-rs.github.io/no_std-training/02_4_hello_world.html .
Proposed change to the format of the examples:
Currently the repo is setup to use the example format:
cargo run --release --example http-client
to run each example.
I find this difficult for a number of reasons:
1.) Multiple apparent versions of the example source exist in the repo:
diff intro/http-client/src/main.rs intro/http-client/examples/http-client.rs
Having 2 different apparent source files for the same example in the repo could cause some unnecessary confusion.
2.) If you want to start a project based on that example, you're left with the very confusing process of trying to figure out how to integrate a new cargo generate folder with the example folder.
It would seem so much easier to just create each example as a matching set of a complete cargo generated project that can be a starting point. (Minus the git, vscode, wokwi integrations.)
The challenge:
The main challenge I see to this is that git/wokwi/vscode etc integrations that exists in the cargo generated project. I would suggest completely stripping them from the suggested examples.
Here are some ideas for additional content in no particular order
Currently, http client example is not built in CI
Since the last esp-hal release we can get rid of the code disabling the watchdog.
It might be better to use https://rust-lang.github.io/mdBook/format/mdbook.html#including-portions-of-a-file (especially with anchors) instead of copy-pasting code.
That way we could make sure that what is written in the book is always in sync with the actual code and we can make sure the code snippets are correct (since we check them in CI).
Only drawback I see when doing this: the ANCHOR comments in Rust source files might look a bit confusing - but we could explain that in the introduction
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.