Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esp-wifi 0.3.0 does not compile for ESP32-C3, it depends on portable-atomic, and that doesnt build for RiscV #426

Closed
makepaddev opened this issue Jan 31, 2024 · 5 comments

Comments

@makepaddev
Copy link

I can only build esp-wifi 0.1.1 for the ESP32-C3 (riscV), so this means i can't try the newer releases.
The 0.1.1 version has significant problems on ESP32-C3 with wifi connectivity, UDP packets arrive super slowly or not at all. A quick check with the C++ stack on arduino IDE show its not a hardware issue as it works perfectly there.

Trying to compile with 0.3.0 gives this error:

error: cfg(portable_atomic_unsafe_assume_single_core) does not compatible with this target;
if you need cfg(portable_atomic_unsafe_assume_single_core) support for this target,
please submit an issue at https://github.com/taiki-e/portable-atomic
--> /Users/admin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.6.0/src/lib.rs:362:1
|
362 | / compile_error!(
363 | | "cfg(portable_atomic_unsafe_assume_single_core) does not compatible with this target;\n
364 | | if you need cfg(portable_atomic_unsafe_assume_single_core) support for this target,\n
365 | | please submit an issue at https://github.com/taiki-e/portable-atomic"
366 | | );
| |_^

@makepaddev
Copy link
Author

I was able to fix the atomic error thanks to taiki-e/portable-atomic#148, however no i get this when compiling esp-wifi 0.3.0

error[E0432]: unresolved import crate::hal::interrupt
--> /Users/admin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/esp-wifi-0.3.0/src/preempt/preempt_riscv.rs:3:17
|
3 | use crate::hal::interrupt::TrapFrame;
| ^^^^^^^^^ could not find interrupt in hal

error[E0432]: unresolved imports crate::hal::interrupt, crate::hal::macros::interrupt
--> /Users/admin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/esp-wifi-0.3.0/src/timer/timer_esp32c3.rs:5:11
|
5 | hal::{interrupt, macros::interrupt, peripherals::Interrupt},
| ^^^^^^^^^ ^^^^^^^^^^^^^^^^^ no interrupt in the root
| |
| no interrupt in the root

@bjoernQ
Copy link
Contributor

bjoernQ commented Feb 1, 2024

esp-wifi releases are tied to esp-hal releases - they need to match! e.g. for 0.3.0 the C3 hal is 0.15.0: https://crates.io/crates/esp-wifi/0.3.0/dependencies

additionally the way how atomics are handled in esp-hal changed at some point in time - for later HAL versions atomic emulation was removed so you need to remove this: https://github.com/makepaddev/rc_radio/blob/a04fd8eec7278f7d924d11488b25bf384c249050/.cargo/config.toml#L13-L27

@MabezDev
Copy link
Member

MabezDev commented Feb 1, 2024

That message about the esp32s3 is coming from ROM code, which is burned into flash at the factory - this means you have an esp32s3 board, not a esp32c3 board. Try flashing the example targetting the esp32s3.

@makepaddev
Copy link
Author

Sorry im mistaken, i had an S3 board plugged in, nevermind.

@makepaddev
Copy link
Author

Alright it works! I have a working example. Thanks. Closing.

@github-project-automation github-project-automation bot moved this from Todo to Done in esp-rs Feb 1, 2024
SFrijters added a commit to SFrijters/nix-qemu-esp32c3-rust-example that referenced this issue Jun 12, 2024
SFrijters added a commit to SFrijters/nix-qemu-esp32c3-rust-example that referenced this issue Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants