Skip to content
This repository was archived by the owner on Aug 1, 2024. It is now read-only.

Commit 359bc82

Browse files
committed
Upgrade to latest crates; fix compilation issues
1 parent e223792 commit 359bc82

File tree

4 files changed

+242
-195
lines changed

4 files changed

+242
-195
lines changed

.cargo/config.toml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,28 @@ target = "xtensa-esp32-espidf"
88

99
[target.xtensa-esp32-espidf]
1010
linker = "ldproxy"
11-
# Uncomment for ESP-IDF 5 and later. Don't forget to also uncomment the `ESP_IDF_VERSION = "release/v5.0"`parameter in the `[env]` section below
12-
#rustflags = ["--cfg", "espidf_time64"]
11+
# Comment the line below for ESP IDF 4. Don't forget to also uncomment the `ESP_IDF_VERSION = "v4.4.6"` parameter in the `[env]` section below
12+
rustflags = ["--cfg", "espidf_time64"]
1313

1414
[target.xtensa-esp32s2-espidf]
1515
linker = "ldproxy"
16-
# Uncomment for ESP-IDF 5 and later. Don't forget to also uncomment the `ESP_IDF_VERSION = "release/v5.0"`parameter in the `[env]` section below
17-
#rustflags = ["--cfg", "espidf_time64"]
16+
# Comment the line below for ESP IDF 4. Don't forget to also uncomment the `ESP_IDF_VERSION = "v4.4.6"` parameter in the `[env]` section below
17+
rustflags = ["--cfg", "espidf_time64"]
1818

1919
[target.xtensa-esp32s3-espidf]
2020
linker = "ldproxy"
21-
# Uncomment for ESP-IDF 5 and later. Don't forget to also uncomment the `ESP_IDF_VERSION = "release/v5.0"`parameter in the `[env]` section below
22-
#rustflags = ["--cfg", "espidf_time64"]
21+
# Comment the line below for ESP IDF 4. Don't forget to also uncomment the `ESP_IDF_VERSION = "v4.4.6"` parameter in the `[env]` section below
22+
rustflags = ["--cfg", "espidf_time64"]
2323

2424
[target.riscv32imc-esp-espidf]
2525
linker = "ldproxy"
26-
# TODO: Is `["-C", "default-linker-libraries"]` still necessary? See https://github.com/ivmarkov/embuild/issues/16
27-
# Uncomment for ESP-IDF 5 and later. Don't forget to also uncomment the `ESP_IDF_VERSION = "release/v5.0"`parameter in the `[env]` section below
28-
#rustflags = ["--cfg", "espidf_time64"]
26+
# Comment the line below for ESP IDF 4. Don't forget to also uncomment the `ESP_IDF_VERSION = "v4.4.6"` parameter in the `[env]` section below
27+
rustflags = ["--cfg", "espidf_time64"]
2928

3029
[target.riscv32imac-esp-espidf]
3130
linker = "ldproxy"
32-
# Uncomment for ESP-IDF 5 and later. Don't forget to also uncomment the `ESP_IDF_VERSION = "release/v5.0"`parameter in the `[env]` section below
33-
#rustflags = ["--cfg", "espidf_time64"]
31+
# Comment the line below for ESP IDF 4. Don't forget to also uncomment the `ESP_IDF_VERSION = "v4.4.6"` parameter in the `[env]` section below
32+
rustflags = ["--cfg", "espidf_time64"]
3433

3534
[unstable]
3635
build-std = ["std", "panic_abort"]
@@ -47,15 +46,15 @@ build-std = ["std", "panic_abort"]
4746
#
4847
# Uncomment this to build against ESP-IDF 5.0
4948
# Don't forget to uncomment also the `rustflags` parameter in your "target" section above
50-
#ESP_IDF_VERSION = "release/v5.0"
49+
#ESP_IDF_VERSION = "v5.0.4"
5150
#
5251
# Uncomment this to build against ESP-IDF 5.1
5352
# Don't forget to uncomment also the `rustflags` parameter in your "target" section above
54-
#ESP_IDF_VERSION = "release/v5.1"
53+
#ESP_IDF_VERSION = "v5.1.1"
5554
#
5655
# Comment out this when using the PlatformIO build, i.e. `cargo build --features pio` (it only supports `v4.3.2`)
57-
ESP_IDF_VERSION = "release/v4.4"
58-
#ESP_IDF_VERSION = "master"
56+
#ESP_IDF_VERSION = "v4.4.6"
57+
ESP_IDF_VERSION = "v5.1.1"
5958

6059
# These configurations will pick up your custom "sdkconfig.release", "sdkconfig.debug" or "sdkconfig.defaults[.*]" files
6160
# that you might put in the root of the project

Cargo.toml

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,6 @@ repository = "https://github.com/ivmarkov/rust-esp32-std-demo"
1010
license = "MIT OR Apache-2.0"
1111
readme = "README.md"
1212

13-
[patch.crates-io]
14-
smol = { git = "https://github.com/esp-rs-compat/smol" }
15-
polling = { git = "https://github.com/esp-rs-compat/polling" }
16-
socket2 = { git = "https://github.com/esp-rs-compat/socket2" }
17-
#getrandom = { version = "0.2", git = "https://github.com/esp-rs-compat/getrandom.git" }
18-
#getrandom1 = { version = "0.1", git = "https://github.com/esp-rs-compat/getrandom.git", package = "getrandom", branch = "0.1" }
19-
esp-idf-sys = { git = "https://github.com/esp-rs/esp-idf-sys" }
20-
2113
[profile.release]
2214
opt-level = "s"
2315

@@ -29,7 +21,7 @@ opt-level = "z"
2921
default = []
3022

3123
# Enable this feature for the build to use the PlatformIO tooling instead of the native ESP-IDF tooling under the hood
32-
pio = ["esp-idf-sys/pio"]
24+
pio = ["esp-idf-svc/pio"]
3325

3426
# Enable this feature if you are building for QEMU
3527
qemu = []
@@ -64,23 +56,19 @@ w5500 = []
6456
anyhow = {version = "1", features = ["backtrace"]}
6557
log = "0.4"
6658
url = "2"
67-
esp-idf-sys = { version = "0.33", features = ["binstart"] }
68-
esp-idf-svc = "0.46"
69-
esp-idf-hal = "0.41"
70-
embedded-svc = "0.25"
71-
embedded-hal = "0.2"
59+
esp-idf-svc = { version = "0.47", features = ["nightly"] }
7260
embedded-graphics = "0.7"
7361
display-interface = "0.4"
7462
display-interface-spi = "0.4"
7563
mipidsi = "0.5"
7664
ssd1306 = "0.7"
7765
epd-waveshare = "0.5.0"
78-
smol = "1.2"
79-
async-io = "=1.12"
66+
async-io = "2"
67+
async-executor = "1"
68+
futures-lite = "1"
8069

8170
[build-dependencies]
82-
embuild = { version = "0.31.2", features = ["elf"] }
83-
anyhow = "1"
71+
embuild = { version = "0.31.3", features = ["elf"] }
8472

8573
# Future; might be possible once https://github.com/rust-lang/cargo/issues/9096 hits Cargo nightly:
8674
#rust-esp32-ulp-blink = { git = "https://github.com/ivmarkov/rust-esp32-ulp-blink", artifact = "bin" }

build.rs

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
use std::path::PathBuf;
22

3-
use embuild::{
4-
self, bingen,
5-
build::{CfgArgs, LinkArgs},
6-
cargo, symgen,
7-
};
3+
use embuild::{self, bingen, cargo, symgen};
84

9-
fn main() -> anyhow::Result<()> {
10-
// Necessary because of this issue: https://github.com/rust-lang/cargo/issues/9641
11-
LinkArgs::output_propagated("ESP_IDF")?;
12-
13-
let cfg = CfgArgs::try_from_env("ESP_IDF")?;
5+
fn main() {
6+
embuild::espidf::sysenv::output();
147

8+
let cfg = embuild::espidf::sysenv::cfg_args().unwrap();
159
if cfg.get("esp32s2").is_some() {
1610
// Future; might be possible once https://github.com/rust-lang/cargo/issues/9096 hits Cargo nightly:
1711
//let ulp_elf = PathBuf::from(env::var_os("CARGO_BIN_FILE_RUST_ESP32_ULP_BLINK_rust_esp32_ulp_blink").unwrap());
@@ -20,14 +14,12 @@ fn main() -> anyhow::Result<()> {
2014
cargo::track_file(&ulp_elf);
2115

2216
// This is where the RTC Slow Mem is mapped within the ESP32-S2 memory space
23-
let ulp_bin = symgen::Symgen::new(&ulp_elf, 0x5000_0000_u64).run()?;
17+
let ulp_bin = symgen::Symgen::new(&ulp_elf, 0x5000_0000_u64)
18+
.run()
19+
.unwrap();
2420
cargo::track_file(ulp_bin);
2521

26-
let ulp_sym = bingen::Bingen::new(ulp_elf).run()?;
22+
let ulp_sym = bingen::Bingen::new(ulp_elf).run().unwrap();
2723
cargo::track_file(ulp_sym);
2824
}
29-
30-
cfg.output();
31-
32-
Ok(())
3325
}

0 commit comments

Comments
 (0)