Closed skrapi closed 1 month ago
Seems like #1753 might have caused the difference
and then copied the text from the embassy_hello_world.rs example. I added the missing imports
Copy the example from the repo at the version you have used. There are often breaking changes between a released version and what's in the main
branch.
good point, I tried that, solved my issue, but led to a separate one:
new src/main.rs
//! Blinks an LED
//!
//! This assumes that a LED is connected to the pin assigned to `led`. (GPIO0)
//% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3
#![no_std]
#![no_main]
use esp_backtrace as _;
use esp_hal::{
clock::ClockControl,
delay::Delay,
gpio::{Io, Level, Output},
peripherals::Peripherals,
prelude::*,
system::SystemControl,
};
#[entry]
fn main() -> ! {
let peripherals = Peripherals::take();
let system = SystemControl::new(peripherals.SYSTEM);
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();
// Set GPIO0 as an output, and set its state high initially.
let io = Io::new(peripherals.GPIO, peripherals.IO_MUX);
let mut led = Output::new(io.pins.gpio7, Level::High);
let delay = Delay::new(&clocks);
loop {
led.toggle();
delay.delay_millis(500);
led.toggle();
// or using `fugit` duration
delay.delay(2.secs());
}
}
new error:
cargo b --release
Compiling embedded-controller v0.1.0 (/home/skrapi/dev/treadmill/embedded-controller)
error: linking with `rust-lld` failed: exit status: 1
|
= note: LC_ALL="C" PATH="/home/skrapi/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/home/skrapi/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/home/skrapi/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/home/skrapi/.local/bin:/home/skrapi/.local/bin:/home/skrapi/.juliaup/bin:/home/skrapi/.nvm/versions/node/v20.9.0/bin:/home/skrapi/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin" VSLANG="1033" "rust-lld" "-flavor" "gnu" "/tmp/rustcyGGzsb/symbols.o" "/home/skrapi/dev/treadmill/embedded-controller/target/riscv32imc-unknown-none-elf/release/deps/embedded_controller-66ae9f1b14e2f9a4.embedded_controller.bfe8676fdc08d2b8-cgu.0.rcgu.o" "--as-needed" "-L" "/home/skrapi/dev/treadmill/embedded-controller/target/riscv32imc-unknown-none-elf/release/deps" "-L" "/home/skrapi/dev/treadmill/embedded-controller/target/release/deps" "-L" "/home/skrapi/dev/treadmill/embedded-controller/target/riscv32imc-unknown-none-elf/release/build/esp-hal-fb7671c3d3905182/out" "-L" "/home/skrapi/dev/treadmill/embedded-controller/target/riscv32imc-unknown-none-elf/release/build/esp32c3-e800466241b30004/out" "-L" "/home/skrapi/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/riscv32imc-unknown-none-elf/lib" "-Bstatic" "/home/skrapi/dev/treadmill/embedded-controller/target/riscv32imc-unknown-none-elf/release/deps/libcompiler_builtins-055f71e45e4d2fb5.rlib" "-Bdynamic" "-z" "noexecstack" "-L" "/home/skrapi/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/riscv32imc-unknown-none-elf/lib" "-o" "/home/skrapi/dev/treadmill/embedded-controller/target/riscv32imc-unknown-none-elf/release/deps/embedded_controller-66ae9f1b14e2f9a4" "--gc-sections" "-Tlinkall.x"
= note: rust-lld: error: undefined symbol: _embassy_time_schedule_wake
>>> referenced by mod.rs:1785 (/home/skrapi/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:1785)
>>> /home/skrapi/dev/treadmill/embedded-controller/target/riscv32imc-unknown-none-elf/release/deps/embedded_controller-66ae9f1b14e2f9a4.embedded_controller.bfe8676fdc08d2b8-cgu.0.rcgu.o:(_$LT$embassy_time..timer..Timer$u20$as$u20$core..future..future..Future$GT$::poll::hb20fcfd3bfb6b57b)
error: could not compile `embedded-controller` (bin "embedded-controller") due to 1 previous error
Anyway will close this issue soon, because the original error is not a real issue.
The linker error can probably get resolved by using the feature generic-queue-8
on embassy-time
or integrated-timers
on esp-hal-embassy
That worked, thanks folks
Hi,
I am trying to use esp-hal for the esp32c3 on the ESP Rustboard. I generated the project from
and then copied the text from the embassy_hello_world.rs example. I added the missing imports
src/main.rs
but I keep getting:
I have scoured https://docs.esp-rs.org/esp-hal/esp-hal/0.18.0/esp32c3/esp_hal/
but don't see the option to include ErasedTimer.
Any help would be appreciated.