Skip to content

Implement accessing FPSCR #220

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

Merged
merged 17 commits into from
Jun 11, 2020
Merged

Implement accessing FPSCR #220

merged 17 commits into from
Jun 11, 2020

Conversation

bugadani
Copy link
Contributor

On the nRF52, sometimes it is necessary to manipulate the FPSCR register, otherwise the device wakes up immediately from sleep. (At least on this device) the FPSCR is only available through vmrs instructions.

I've implemented reading the register, parsing its bits and writing a raw value to the register, but let me know if I should also implement manipulation of the named bits.

I would also like to request some assistance to get this to actually build, it's not clear to me how .s files are compiled in this library. I'm also not certain where the actual place for this would be - in the registers, or in the fpu module.

@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.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-cortex-m labels May 27, 2020
@adamgreig
Copy link
Member

At first glance this looks like a great addition, thanks! I think it's fine in registers as it's not part of the FPU memory-mapped space, it's a CPU register.

For building the assembly file, we do that manually to include the object file in the commit, and the CI system does it again to verify that the object file matches the assembly source. That's done in check_blobs.py and you should be able to follow that to build it yourself too.

As for manipulation of named bits, I think just having the ability to read them and write raw values is a good start and adds a feature we don't support at the moment, but if you did want to implement setting bits it could be done similar to the current control register.

@bugadani bugadani marked this pull request as ready for review May 27, 2020 22:39
@bugadani bugadani requested a review from a team as a code owner May 27, 2020 22:39
@bugadani
Copy link
Contributor Author

bugadani commented Jun 6, 2020

Well, it's probably 15 commits more than it should have been, but why hide my mistakes. I believe this is ready for review, however, I'm not able to test this on armv8.

Copy link
Member

@adamgreig adamgreig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this all looks fine to me except this minor query on the update to assemble.sh:

Co-authored-by: Adam Greig <[email protected]>
Copy link
Member

@adamgreig adamgreig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

bors merge

@bors
Copy link
Contributor

bors bot commented Jun 11, 2020

Build succeeded:

@bors bors bot merged commit 5e75716 into rust-embedded:master Jun 11, 2020
@bugadani bugadani deleted the feature/fpscr branch June 11, 2020 10:22
@bugadani bugadani restored the feature/fpscr branch June 11, 2020 10:24
@adamgreig adamgreig mentioned this pull request Jul 20, 2020
bors bot added a commit that referenced this pull request Jul 20, 2020
249: More v0.6.3 backports r=jonas-schievink a=adamgreig

I think this includes the remainder of the non-breaking changes since v0.6.2, with a couple of exceptions:

* #240 seemed low-impact but had loads of separate commits to cherry-pick
* #220 is I think non-breaking but was quite a substantial change, perhaps I could still include it

~~I did include #226 which adds a new field to `Peripherals`, but as I understand it that should be a non-breaking change since it's non-exhaustive.~~

I've updated the CHANGELOG with all the changes from this PR and the previous #248.

Co-authored-by: Cliff L. Biffle <[email protected]>
Co-authored-by: Peter Taylor <[email protected]>
Co-authored-by: Hugues de Valon <[email protected]>
Co-authored-by: Jonas Schievink <[email protected]>
Co-authored-by: Adam Greig <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-cortex-m
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants