-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Support for ESP32-C3 #148
Comments
Currently, unsafe_assume_single_core cannot be enabled on targets that support atomic CAS. I would expect to get this error if the v2 resolver is not enabled or if there are dependencies that have this feature enabled by mistake. (We can loosen this check as it will be ignored even if you enable that feature, but I believe that if you get this error, it indicates that the dependency or build configuration may be incorrect.) Could you tell me specifically how to reproduce this problem? |
I have uploaded my current little project here: https://github.com/makepaddev/rc_radio then you should be able to call cargo build to see the errors |
Thanks. CAS is enabled in your configuration, and the esp32c3 feature of the esp-hal enables unsafe_assume_single_core. One way around the error here is to stop enabling CAS in the configuration. Like esp-rs/esp-wifi-sys#337 (comment). |
If i comment out the CAS flags in my configuration it gives the exact same compiler error |
I cloned the reproduction and built it, but it seems that the line that enables the
And, at least the following changes appear to have fixed the error from portable-atomic. diff --git a/.cargo/config.toml b/.cargo/config.toml
index c23f0e2..ac3dcba 100644
--- a/.cargo/config.toml
+++ b/.cargo/config.toml
@@ -12,7 +12,7 @@ rustflags = [
# comment the cfgs below if you do _not_ wish to emulate atomics.
# enable the atomic codegen option for RISCV
- "-C", "target-feature=+a",
+# "-C", "target-feature=+a",
# tell the core library have atomics even though it's not specified in the target definition
"--cfg", "target_has_atomic_load_store",
"--cfg", 'target_has_atomic_load_store="8"',
@@ -20,11 +20,11 @@ rustflags = [
"--cfg", 'target_has_atomic_load_store="32"',
"--cfg", 'target_has_atomic_load_store="ptr"',
# enable cas
- "--cfg", "target_has_atomic",
- "--cfg", 'target_has_atomic="8"',
- "--cfg", 'target_has_atomic="16"',
- "--cfg", 'target_has_atomic="32"',
- "--cfg", 'target_has_atomic="ptr"',
+# "--cfg", "target_has_atomic",
+# "--cfg", 'target_has_atomic="8"',
+# "--cfg", 'target_has_atomic="16"',
+# "--cfg", 'target_has_atomic="32"',
+# "--cfg", 'target_has_atomic="ptr"',
]
I think you may encountered a cargo problem where the rustflags change in config does not trigger a rebuild, try cleaning build artifacts by |
Ah yea that fixed it, the atomic thing. Now i get an error with 'interrupt not found' but thats not your problem. Ok thanks! |
Hi,
I'm trying to compile esp-wifi 0.3.0 which depends on portable-atomic (since 0.2.0). However portable atomic doesn't want to compile:
The CPU is the ESP32-C3 (32 bit RiscV afaik)
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 | | );
| |_^
Issue in esp-wifi:
esp-rs/esp-wifi-sys#426
The text was updated successfully, but these errors were encountered: