-
Notifications
You must be signed in to change notification settings - Fork 198
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
Completely remove atomic emulation #985
Conversation
FYI smartled is checked with the CI host as target, that causes the portable-atomic madness (can't enable |
I opened rust-lang/futures-rs#2805 to add esp32s2 target to the no cas list. This was important as embassy-sync depends on futures-util. As @bugadani mentioned we need everything to move to heapless 0.8, this requires a release of embassy-sync at a minimum, but for esp-wifi we know we'll need more. |
Well, so much for that 😅 |
f9f76ed
to
ea1c891
Compare
I found a way around it, though we should eventually fix it upstream. The last step is to remove the patched embassy_sync with a new release. |
fd7d28d
to
cbedcd1
Compare
With heapless 0.7.17 released we can punt the embassy upgrades to a different PR. This is now ready for review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you for resolving this 🙏🏻
Handling this in #994 |
cbedcd1
to
ff5c5d7
Compare
esp32c6 = ["riscv", "esp32c6/rt", "procmacros/esp32c6"] | ||
esp32h2 = ["riscv", "esp32h2/rt", "procmacros/esp32h2"] | ||
esp32s2 = ["xtensa", "esp32s2/rt", "procmacros/esp32s2", "xtensa-lx/esp32s2", "xtensa-lx-rt/esp32s2", "usb-otg", "portable-atomic?/unsafe-assume-single-core"] | ||
esp32s2 = ["xtensa", "esp32s2/rt", "procmacros/esp32s2", "xtensa-lx/esp32s2", "xtensa-lx-rt/esp32s2", "usb-otg", "portable-atomic/critical-section"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently we shouldn't enable these in a library:
critical-section
...
Note:
...
It is usually not recommended to always enable this feature in dependencies of the library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I read that too, however, I feel that although esp-hal is a library, its also not a platform-agnostic library, we know exactly what the intended target is capable of. If it causes problems in the future we can revert this.
Was this tested on esp32c6? I just tried to compile a project that runs on the c6 with embassy and it failed with
I noticed that |
Yes, this works as intended. The C6 did not use the atomic emulation mechanism at all. Don't enable Could you share your project? |
Interesting. Thanks! In case anyone else has the same problem and comes across this thread. It turns out that I had converted a project from c3 to c6 and missed updating the target string. |
This PR completely removes atomic emulation. Now that the
+forced-atomics
feature is enabled on-a
RISCV targets, the trap is less useful. Most crates in the embedded ecosystem that need cas will opt to use portable-atomic to support targets without cas.Must
errors
orwarnings
.cargo fmt
was run.CHANGELOG.md
in the proper section.Nice to have