for the love of god I have no idea what's broken

This commit is contained in:
Clara Dautermann 2025-07-07 19:48:24 +02:00
parent 6068827dfb
commit bfdfdc01c5
Signed by: clara
GPG key ID: 223391B52FAD4463
10 changed files with 843 additions and 729 deletions

View file

@ -1,14 +1,27 @@
[target.xtensa-esp32-none-elf]
runner = "espflash flash --monitor --chip esp32"
[env]
[build]
rustflags = [
"-C", "link-arg=-nostartfiles",
]
target = "xtensa-esp32-espidf"
target = "xtensa-esp32-none-elf"
[target.xtensa-esp32-espidf]
linker = "ldproxy"
runner = "espflash flash --monitor"
# Future - necessary for the experimental "native build" of esp-idf-sys with ESP32C3
# See also https://github.com/ivmarkov/embuild/issues/16
rustflags = ["--cfg", "espidf_time64"]
[unstable]
build-std = ["alloc", "core"]
build-std = ["std", "panic_abort"]
[env]
# Enables the esp-idf-sys "native" build feature (`cargo build --features native`) to build against ESP-IDF (v5.3.2)
ESP_IDF_VERSION = { value = "tag:v5.3.2" }
# These configurations will pick up your custom "sdkconfig.release", "sdkconfig.debug" or "sdkconfig.defaults[.*]" files
# that you might put in the root of the project
# The easiest way to generate a full "sdkconfig[.release|debug]" configuration (as opposed to manually enabling only the necessary flags via "sdkconfig.defaults[.*]"
# is by running "cargo pio espidf menuconfig" (that is, if using the pio builder)
#ESP_IDF_SDKCONFIG = { value = "./sdkconfig.release", relative = true }
#ESP_IDF_SDKCONFIG = { value = "./sdkconfig.debug", relative = true }
ESP_IDF_SDKCONFIG_DEFAULTS = { value = "./sdkconfig.defaults", relative = true }
# ESP-IDF will be installed in ~/.espressif so it can be reused across the different examples.
# See also https://github.com/esp-rs/esp-idf-sys/blob/master/BUILD-OPTIONS.md#esp_idf_tools_install_dir-esp_idf_tools_install_dir
ESP_IDF_TOOLS_INSTALL_DIR = { value = "fromenv" }

3
firmware/.gitignore vendored
View file

@ -16,3 +16,6 @@ target/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
# esp-idf
.embuild/

1405
firmware/Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,56 +1,26 @@
[package]
edition = "2021"
name = "firmware"
version = "0.1.0"
edition = "2024"
resolver = "2"
[[bin]]
name = "firmware"
path = "./src/bin/main.rs"
[dependencies]
esp-bootloader-esp-idf = "0.1.0"
esp-hal = { version = "=1.0.0-beta.1", features = ["esp32", "unstable"] }
bleps = { git = "https://github.com/bjoernQ/bleps", package = "bleps", rev = "a5148d8ae679e021b78f53fd33afb8bb35d0b62e", features = [
"async",
"macros",
] }
critical-section = "1.2.0"
embedded-io = "0.6.1"
esp-alloc = "0.8.0"
esp-wifi = { version = "0.14.1", features = [
"ble",
"builtin-scheduler",
"coex",
"esp-alloc",
"esp32",
"smoltcp",
"wifi",
] }
smoltcp = { version = "0.12.0", default-features = false, features = [
"medium-ethernet",
"multicast",
"proto-dhcpv4",
"proto-dns",
"proto-ipv4",
"socket-dns",
"socket-icmp",
"socket-raw",
"socket-tcp",
"socket-udp",
] }
[profile.dev]
# Rust debug is too slow.
# For debug builds always builds with some optimization
opt-level = "s"
harness = false # We can't use the default rust libtest harness for a crosscompile target
[profile.release]
codegen-units = 1 # LLVM can perform better optimizations using a single thread
debug = 2
debug-assertions = false
incremental = false
lto = 'fat'
opt-level = 's'
overflow-checks = false
opt-level = "s"
[profile.dev]
debug = true # Symbols are nice and they don't increase the size on Flash
opt-level = "z"
[dependencies]
anyhow = "1.0.98"
esp-idf-svc = "0.51.0"
log = "=0.4.27"
toml-cfg = "=0.2.0"
[build-dependencies]
embuild = "=0.33.0"
toml-cfg = "=0.2.0"

View file

@ -1,2 +1,3 @@
[toolchain]
channel = "esp"
channel = "esp" #nightly-2025-01-01
components = ["rust-src"]

View file

@ -1 +0,0 @@
#![no_std]

14
firmware/src/main.rs Normal file
View file

@ -0,0 +1,14 @@
use anyhow::{bail, Result};
use esp_idf_svc::eventloop::EspSystemEventLoop;
use esp_idf_svc::hal::prelude::Peripherals;
use log::info;
fn main() -> Result<()> {
esp_idf_svc::sys::link_patches();
esp_idf_svc::log::EspLogger::initialize_default();
let peripherals = Peripherals::take().unwrap();
let sysloop = EspSystemEventLoop::take()?;
info!("Hello, world!");
}

View file

@ -1,22 +0,0 @@
//! Demo test suite using embedded-test
//!
//! You can run this using `cargo test` as usual.
#![no_std]
#![no_main]
#[cfg(test)]
#[embedded_test::tests]
mod tests {
use esp_hal as _;
#[init]
fn init() {
let _ = esp_hal::init(esp_hal::Config::default());
}
#[test]
fn hello_test() {
assert_eq!(1 + 1, 2);
}
}