Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

181 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESP32-C3 Rust Tutorials

Various embedded Rust tutorials using the ESP32-C3. We'll work towards making a remote data logger by first implementing peripherals we will need to build the larger project.

Each tutorial below has a YouTube video link where I will start with a blank project and implement a peripherals using the latest esp-idf-hal version.

Repo organization

  • P0-Peripheral-Tutorials: Short tutorials on using various peripherals. This is the code for the YouTube playlist
  • P0-Project-Tutorials: Longer tutorials implementing some feature that will go into our data logger project
  • WIP: Half-baked crates that may have some useful code in the future
  • docs: Various datasheets, books, and technical manuals
  • submodules: All of the submodules for this repository.
  • Data-Logger-PCB: KiCAD hardware designs for ESP32-C3 data logger PCB

Project P0: Remote Data Logger MVP

Minimum viable product project where we'll implement all the peripherals and features we need for the data logger

  • 4 ADC's
  • 16 Digital I/O
  • DHT11
  • SD card logging
  • UART CLI Shell

Peripheral Tutorials

Project Tutorials

  • p8-cli-shell: Create a simple CLI shell to interact with the device
  • p9-adc-stream: Configure ADC's to continuously read and make that data available to other parts of the application through a mutex
  • p10-log-values: Log all the values read from the ADC's
  • [p11-digital-stream(): Continuously read the SX1509 inputs and log to SD card

Project P1:

For the next part of this project (P1) we will add in features listed below:

  • Debugging
  • Logging
  • FSM/HSM
  • Wifi
  • MQTT
  • OTA
  • Pub/sub
  • Crash dumps & diagnostics

Other features I'd like to add but don't have a clear example for yet:

  • DMA
  • Timer usage
Development environment setup
  1. Install Rust and Xtensa build tools
    • Make sure to sudo chmod +x export-esp.sh
  2. Start a project using the esp-idf-template from the private repo home dir. I chose all the default options
# STD Project
cargo generate https://github.com/esp-rs/esp-idf-template cargo
# NO-STD (Bare-metal) Project
cargo generate https://github.com/esp-rs/esp-template
  1. Build the Hello World program by running cargo build in the new project dir. This will take a while to build the first time:
cd esp32-rust
cargo build
...
Finished dev [optimized + debuginfo] target(s) in 6m 40s
  1. Flash the ESP32 with the build artifact:
espflash /dev/ttyACM0 target/riscv32imc-esp-espidf/debug/project
  1. Connect to ESP32 and monitor
espmonitor /dev/ttyACM0
Misc

Singletons in Embedded Rust

Pull in code for submodules with:

git submodule update --init --recursive
Links

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages