Playground for experimentation with the esp32c3-rust board.
espflash and cargo-espflash are optional. We use the imac target with emulated atomics.
rustup target add riscv32imac-unknown-none-elf
cargo install cargo-espflash espflashWe use probe-rs for the debugging.
cargo install probe-rs --features=cliThe --features=cli is optional, adding a gdb like user interface.
For now we want to generate binaries executable from flash. This is achieved through the direct-boot build feature enabled by default (in the Cargo.toml).
The .cargo/config.toml sets the runner:
runner = 'probe-rs run --chip esp32c3'This allows you to use cargo run to flash and run your program, e.g.:
cargo run --example blinky_rttpanicusing thertt_targetandpanic_rtt_target.gpio_interrupt, using thebootpin to trigger an interrupt, theledblinks independently, software interrupts run in background.blinky_rttsimilar togpio_interrupt(but only blinking)blinky_usartblinks and traces over both RTT and usart (not validated)serial_interruptsome sort of weird serial cmd receiver (not validated)software_interrupttriggers software interrupts periodically.
The .vscode folder provides launch.json and tasks.json configuration files for using probe-rs-debugger in a seamless fashion.
The Cargo.toml and .cargo/config are now distilled to a minimum for experimentation. We rely on emulated atomics for imac target, allowing us to use the current rtt_target.