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

Atomic polyfill #702

Closed
wants to merge 2 commits into from
Closed

Atomic polyfill #702

wants to merge 2 commits into from

Conversation

Urhengulas
Copy link
Member

@Urhengulas Urhengulas commented Oct 5, 2022

This PR replaces core::sync::atomic::* with atomic_polyfill::*.

This change makes defmt-rtt available on targets without native atomics.
Fixes #597.

There should be no negative impact on targets with atomic support, since in these cases the native atomics will be used.

@Urhengulas
Copy link
Member Author

We decided to pause this change until we do a coordinated effort to get risc-v support for defmt and probe-run. All the relevant issues will be tracked with the tag topic: risc-v.

@Urhengulas Urhengulas closed this Oct 6, 2022
@TheButlah
Copy link

TheButlah commented Oct 6, 2022

Thats unfortunate given that the change is a minor one. I'll continue to use this code in a fork and patch my dependencies, I guess

@Urhengulas
Copy link
Member Author

Urhengulas commented Oct 6, 2022

@TheButlah said:

Thats unfortunate given that the change is a minor one. I'll continue to use this code in a fork and patch my dependencies, I guess

Is defmt + defmt-rtt really usable on esp32c3 with this change? Isn't esp32c3 support anyways blocked on #693? Not even talking about probe-run which supports risc-v even less.

@TheButlah
Copy link

TheButlah commented Oct 7, 2022

Yes, this PR fully fixes demt on the esp32c3 when compiled for -imc. I have been successfully using defmt for a while, albeit on the -imac target (I had to change because the atomic trap handler was broken). I have switched to -imc due to performance reasons and because of a bug in the atomic trap handler (the esp32c3 doesn't natively support atomics)

The linker script works fine for direct-boot mode, which is what most people using esp-hal use anyway. Pretty sure it would work for booloader mode too, but no one bothered to try it.

probe-run doesn't work, but cargo embed and the other probe-rs tooling does.

Also this PR isn't really about riscv, its more about supporting targets that don't have atomics

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for targets without native atomics
2 participants