First commit

This commit is contained in:
2021-10-08 21:40:40 +02:00
commit 7403b5e53f
6 changed files with 78 additions and 0 deletions

15
.cargo/config Normal file
View File

@@ -0,0 +1,15 @@
[build]
target = "xtensa-esp32-espidf"
[target.xtensa-esp32-espidf]
linker = "ldproxy"
[unstable]
build-std = ["std", "panic_abort"]
build-std-features = ["panic_immediate_abort"]
configurable-env = true # No longer necessary since 1.56, as it was stabilized: https://github.com/rust-lang/cargo/blob/master/src/cargo/core/features.rs#L698
extra-link-arg = true # No longer necessary since 1.56, as it was stabilized: https://github.com/rust-lang/cargo/blob/master/src/cargo/core/features.rs#L695
[env]
ESP_IDF_SYS_GLOB_BASE = { value = ".", relative = true }

20
Cargo.toml Normal file
View File

@@ -0,0 +1,20 @@
[package]
name = "rusty-espresso"
version = "0.1.0"
edition = "2018"
[features]
bind = []
[dependencies]
anyhow = {version = "1", features = ["backtrace"]}
esp-idf-sys = { version = "0.20" }
embedded-svc = "0.8.3"
esp-idf-svc = { version = "0.20", features = ["binstart"] }
esp-idf-hal = "0.20"
[build-dependencies]
embuild = "0.24"
anyhow = "1"

26
build.rs Normal file
View File

@@ -0,0 +1,26 @@
use std::path::PathBuf;
use embuild::{
self, bingen,
build::{CfgArgs, LinkArgs},
cargo, symgen,
};
// Necessary because of this issue: https://github.com/rust-lang/cargo/issues/9641
fn main() -> anyhow::Result<()> {
LinkArgs::output_propagated("ESP_IDF")?;
let cfg = CfgArgs::try_from_env("ESP_IDF")?;
if cfg.get("esp32s2").is_some() {
let ulp_elf = PathBuf::from("ulp").join("rust-esp32-ulp-hello");
symgen::run(&ulp_elf, 0x5000_0000)?; // This is where the RTC Slow Mem is mapped within the ESP32-S2 memory space
bingen::run(&ulp_elf)?;
cargo::track_file(ulp_elf);
}
cfg.output();
Ok(())
}

7
env.sh Normal file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
export PATH=$HOME/xtensa-esp32-elf-clang/bin:$PATH
. $HOME/esp/esp-idf/export.sh
rustup default esp

6
sdkconfig.defaults Normal file
View File

@@ -0,0 +1,6 @@
CONFIG_LWIP_L2_TO_L3_COPY=y
CONFIG_LWIP_IP_FORWARD=y
CONFIG_LWIP_IPV4_NAPT=y
#CONFIG_ESP_SYSTEM_USE_EH_FRAME=y
#CONFIG_COMPILER_CXX_EXCEPTIONS=y

4
src/main.rs Normal file
View File

@@ -0,0 +1,4 @@
fn main() {
println!("Hello, world!");
}