Hi All,
I'm trying to compile my Rust project for the ESP32-C3, but keep encountering the following error related to the portable-atomic
crate.
/ compile_error!(
"`portable_atomic_unsafe_assume_single_core` cfg (`unsafe-ass...
does not compatible with target that supports atomic CAS;\n\
see also <https://github.com/taiki-e/portable-atomic/issues/...
);
It seems that the esp-hal
and other dependencies are enabling the unsafe_assume_single_core
feature, which is incompatible with my target.
I would appreciate any insights on how to resolve this issue. Do I need to adjust any dependencies in my Cargo.toml
or change any feature flags?
Here is my Cargo.toml
for reference:
[package]
name = "esp32-mqtt"
version = "0.1.0"
authors = [""]
[dependencies]
logger = { path = "../logger" }
esp-backtrace = { version = "0.14.2", features = [
"esp32c3",
"exception-handler",
"panic-handler",
"println",
] }
esp-hal = { version = "0.18.0", features = [ "esp32c3","async" ] }
esp-hal-embassy = { version = "0.1.0", features = [
"time-timg0", # Compatible with all chips
"esp32c3"
] }
embassy-time = "0.3"
embassy-executor = { version = "0.5", features = ["integrated-timers","executor-thread","task-arena-size-10240"] }
esp-println = { version = "0.12.0", features = ["esp32c3", "log"] }
log = { version = "0.4.21" }
esp-alloc = { version = "0.4.0" }
embedded-svc = { version = "0.26.1", default-features = false, features = [] }
embedded-io = "0.6.1"
esp-wifi = { version = "0.6.0", features = [
"esp32c3",
"phy-enable-usb",
"utils",
"wifi",
"embassy-net",
] }
heapless = { version = "0.8.0", default-features = false }
smoltcp = { version = "0.11.0", default-features = false, features = [
"medium-ethernet",
"proto-dhcpv4",
"proto-igmp",
"proto-ipv4",
"socket-dhcpv4",
"socket-icmp",
"socket-raw",
"socket-tcp",
"socket-udp",
] }
embassy-net = { version = "0.4.0", features = ["dns", "tcp", "medium-ethernet", "dhcpv4-hostname"] }
embassy-futures = "0.1.1"
embassy-sync = "0.6.0"
embedded-nal-async = "0.7.1"
rust-mqtt = {version="0.3.0", default-features = false}
[profile.dev]
# Rust debug is too slow.
# For debug builds always builds with some optimization
opt-level = "s"
[profile.release]
codegen-units = 1 # LLVM can perform better optimizations using a single thread
debug = 2
debug-assertions = false
incremental = false
lto = 'fat'
opt-level = 's'
overflow-checks = false