Skip to content

Add nrf softdevice feature #55

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

Closed

Conversation

nospam2678
Copy link

As has attempted to be described in the commit message, this is intended to address using this crate with Nordic Semiconductor's SoCs by adding a feature for acting slightly different with them. Since it adds a dependency on embassy, which is not yet distributed through crates.io, this is a draft pull request until the required crates have been stabilized.

There are likely improvements to be made to the details, but the main question should likely be; Could this addition stand a chance to get merged once the eco-system matures, or would doing this in some other way be considered a more
appropriate solution?

Problem as well as solution is documented in the [README][github] for
embassy's nrf-softdevice crate. Please refer to the content there for
details.

In short; The application code is sharing the cpu with the vendor
provided part of the firmware when using a nrf-softdevice. In order to
keep radio communications and such working, the three interrupts the
softdevice relies upon need not be blocked.

Section for a draft pull-request description
--------------------------------------------
In case there is disagreement on whether this is the correct crate for
this or not, it might be worth at least being more explicit in the README
about how this crate works by blocking all interrupts. Maybe one might
wish to also extend the API documentation mentioning this? We're open
for a conversation on how to best make this easy-to-overlook fact more
visible.

[github]: https://github.com/embassy-rs/nrf-softdevice#critical-sections
This relies on versions of embassy not yet published to crates.io, yet
available from git. Deferring merge of the pull-request until there are
proper releases might be reasonable.
@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @adamgreig (or someone else) soon.

Please see the contribution instructions for more information.

@Dirbaio
Copy link
Member

Dirbaio commented Aug 12, 2022

I think the right fix is to use critical-section. nrf-softdevice provides a critical section implementation suitable for the weird softdevice interrupt handling (currently for CS 0.2, this PR updates it to 1.0).

This way this crate works with all kinds of CS implementations without having to add them here.

See #56

@nospam2678
Copy link
Author

#56 sure looks like the better solution. I'm closing this attempt.

@nospam2678 nospam2678 closed this Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants