-
hi, i following exmample rang embassy hello world get error, i was checking many times code,and change config.toml but still not working, seems helloword.rs comment was out of date //! embassy hello world
//!
//! This is an example of running the embassy executor with multiple tasks
//! concurrently.
//% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3
//% FEATURES: embassy esp-hal-embassy/integrated-timers esp-hal/unstable
#![no_std]
#![no_main]
use embassy_executor::Spawner;
use embassy_time::{Duration, Timer};
use esp_hal::timer::timg::TimerGroup;
#[embassy_executor::task]
async fn run() {
loop {
Timer::after(Duration::from_millis(1_000)).await;
}
}
#[esp_hal_embassy::main]
async fn main(spawner: Spawner) {
let peripherals = esp_hal::init(esp_hal::Config::default());
let timg0 = TimerGroup::new(peripherals.TIMG0);
esp_hal_embassy::init(timg0.timer0);
spawner.spawn(run()).ok();
loop {
Timer::after(Duration::from_millis(5_000)).await;
}
} [package]
name = "test"
version = "0.1.0"
authors = ["never"]
edition = "2021"
resolver = "2"
rust-version = "1.77"
[[bin]]
name = "test"
harness = false # do not use the built in cargo test harness -> resolve rust-analyzer errors
[profile.release]
opt-level = "s"
[profile.dev]
debug = true # Symbols are nice and they don't increase the size on Flash
opt-level = "z"
[features]
default = []
experimental = ["esp-idf-svc/experimental"]
[dependencies]
log = "0.4"
esp-idf-svc = { version = "0.49", features = [
"embassy-time-driver",
"embassy-sync",
] }
embassy-time = "0.3.2"
esp-hal = { version = "0.22.0", features = ["esp32s3"] }
esp-hal-embassy = { version = "0.5.0", features = [
"esp32s3",
"integrated-timers",
] }
embassy-executor = { version = "0.6.3", features = ["task-arena-size-20480"] }
critical-section = { version = "1.1.3", features = ["restore-state-u32"] }
[build-dependencies]
embuild = "0.32.0"
cc = "=1.1.30" # Version "1.1.30" necessary until a new version of `esp-idf-sys` is released
|
Beta Was this translation helpful? Give feedback.
Answered by
bugadani
Dec 14, 2024
Replies: 1 comment
-
Please don't mix esp-idf crates into esp-hal projects. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
joebnb
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please don't mix esp-idf crates into esp-hal projects.