From 112bcf7d6141b14652dfb670537ec16cc964fc6b Mon Sep 17 00:00:00 2001 From: Luca Date: Mon, 8 Jan 2024 13:52:39 +0100 Subject: [PATCH] feat(firmware): add project skeleton --- firmware/.cargo/config.toml | 12 ++++++++++++ firmware/.gitignore | 14 ++++++++++++++ firmware/Cargo.toml | 11 +++++++++++ firmware/src/main.rs | 11 +++++++++++ 4 files changed, 48 insertions(+) create mode 100644 firmware/.cargo/config.toml create mode 100644 firmware/.gitignore create mode 100644 firmware/Cargo.toml create mode 100644 firmware/src/main.rs diff --git a/firmware/.cargo/config.toml b/firmware/.cargo/config.toml new file mode 100644 index 0000000..2000fa9 --- /dev/null +++ b/firmware/.cargo/config.toml @@ -0,0 +1,12 @@ +[build] +target = "riscv32ec-unknown-none-elf" + +[target.riscv32ec-unknown-none-elf] +runner = "wlink -v flash" +rustflags = [ + "-C", "link-arg=-Tlink.x", + "-C", "opt-level=s", +] + +[unstable] +build-std = ["core", "compiler_builtins"] diff --git a/firmware/.gitignore b/firmware/.gitignore new file mode 100644 index 0000000..6985cf1 --- /dev/null +++ b/firmware/.gitignore @@ -0,0 +1,14 @@ +# Generated by Cargo +# will have compiled files and executables +debug/ +target/ + +# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html +Cargo.lock + +# These are backup files generated by rustfmt +**/*.rs.bk + +# MSVC Windows builds of rustc generate these, which store debugging information +*.pdb diff --git a/firmware/Cargo.toml b/firmware/Cargo.toml new file mode 100644 index 0000000..e1c5ff2 --- /dev/null +++ b/firmware/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "fosmometer-firmware" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +ch32v00x-hal = { git = "https://github.com/lujoga/ch32v00x-hal.git", branch = "qingke-rt", features = ["ch32v003", "rt"] } +panic-halt = "0.2.0" +qingke-rt = "0.1.7" diff --git a/firmware/src/main.rs b/firmware/src/main.rs new file mode 100644 index 0000000..d03a242 --- /dev/null +++ b/firmware/src/main.rs @@ -0,0 +1,11 @@ +#![no_std] +#![no_main] + +use ch32v00x_hal as hal; + +use panic_halt as _; + +#[qingke_rt::entry] +fn main() -> ! { + loop {} +}