From 6a9712f33f6d12cd5e7d17132f84bb1d205d7d49 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 5 Feb 2025 11:35:52 +0100 Subject: [PATCH] update project files --- {esp-hal-buzzer/.cargo => .cargo}/config.toml | 9 ++++++++- README.md | 11 +++++++++++ esp-hal-smartled/.cargo/config.toml | 16 ---------------- esp-hal-smartled/.gitignore | 2 ++ rust-toolchain-risc-v.toml | 4 ++++ rust-toolchain-xtensa.toml | 2 ++ 6 files changed, 27 insertions(+), 17 deletions(-) rename {esp-hal-buzzer/.cargo => .cargo}/config.toml (81%) delete mode 100644 esp-hal-smartled/.cargo/config.toml create mode 100644 esp-hal-smartled/.gitignore create mode 100644 rust-toolchain-risc-v.toml create mode 100644 rust-toolchain-xtensa.toml diff --git a/esp-hal-buzzer/.cargo/config.toml b/.cargo/config.toml similarity index 81% rename from esp-hal-buzzer/.cargo/config.toml rename to .cargo/config.toml index eda6cee..e54768c 100644 --- a/esp-hal-buzzer/.cargo/config.toml +++ b/.cargo/config.toml @@ -7,6 +7,13 @@ esp32h2 = "run --release --features=esp32h2 --target=riscv32imac-unknown-none-el esp32s2 = "run --release --features=esp32s2 --target=xtensa-esp32s2-none-elf" esp32s3 = "run --release --features=esp32s3 --target=xtensa-esp32s3-none-elf" +[build] +target = "riscv32imac-unknown-none-elf" +# target = "riscv32imc-unknown-none-elf" +# target = "xtensa-esp32s2-none-elf" +# target = "xtensa-esp32s3-none-elf" +# target = "xtensa-esp32-none-elf" + [target.'cfg(target_arch = "riscv32")'] runner = "espflash flash --monitor" rustflags = [ @@ -27,4 +34,4 @@ rustflags = [ ] [unstable] -build-std = ["core"] +build-std = ["alloc", "core"] diff --git a/README.md b/README.md index 579d7a9..b0c8f08 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,17 @@ A collection of crates for use alongside [esp-hal], but which are maintained by [esp-hal]: https://github.com/esp-rs/esp-hal/ +## Examples + +To run the examples for either crate, either open the project at the sub-crate level or change directory: + +```bash +# cd into crate directory for smartled or buzzer +cd esp-hal-smartled +# cargo --example +cargo esp32c3 --example hello_rgb # or other chip +``` + ## Contributing a Crate If you have a crate which depends on `esp-hal` and provides some additional functionality, we encourage you to contribute it to this repository! diff --git a/esp-hal-smartled/.cargo/config.toml b/esp-hal-smartled/.cargo/config.toml deleted file mode 100644 index 444af9a..0000000 --- a/esp-hal-smartled/.cargo/config.toml +++ /dev/null @@ -1,16 +0,0 @@ -[target.'cfg(target_arch = "riscv32")'] -rustflags = [ - "-C", "link-arg=-Tlinkall.x", - "-C", "force-frame-pointers", -] - -[target.'cfg(target_arch = "xtensa")'] -rustflags = [ - # GNU LD - "-C", "link-arg=-Wl,-Tlinkall.x", - "-C", "link-arg=-nostartfiles", - - # LLD - # "-C", "link-arg=-Tlinkall.x", - # "-C", "linker=rust-lld", -] diff --git a/esp-hal-smartled/.gitignore b/esp-hal-smartled/.gitignore new file mode 100644 index 0000000..586597d --- /dev/null +++ b/esp-hal-smartled/.gitignore @@ -0,0 +1,2 @@ +# Ignore file because it will be different based on test target. +/rust-toolchain.toml diff --git a/rust-toolchain-risc-v.toml b/rust-toolchain-risc-v.toml new file mode 100644 index 0000000..14c7c83 --- /dev/null +++ b/rust-toolchain-risc-v.toml @@ -0,0 +1,4 @@ +[toolchain] +channel = "stable" +components = ["rust-src"] +targets = ["riscv32imac-unknown-none-elf", "riscv32imac-unknown-none-elf"] diff --git a/rust-toolchain-xtensa.toml b/rust-toolchain-xtensa.toml new file mode 100644 index 0000000..a2f5ab5 --- /dev/null +++ b/rust-toolchain-xtensa.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "esp"