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

Fix clear-on-write fields that aren't actually clear-on-write #69

Open
9names opened this issue Oct 23, 2022 · 0 comments
Open

Fix clear-on-write fields that aren't actually clear-on-write #69

9names opened this issue Oct 23, 2022 · 0 comments
Labels
upstream This issue affects the upstream SVD file.

Comments

@9names
Copy link
Member

9names commented Oct 23, 2022

I wrote this out in matrix a week ago. I've updated it to remove some inaccuracy, and am recording it here so we don't forget to fix it.

I've tested out using the Rust svdtools generated PAC - looks like we might need some changes around some registers.
Specifically, the SVD describes some fields as modifiedWriteValues: clear
from the SVD reference:
svd1
an example of one of these fields from the rp2040 reference manual
svd2

we were previously using .set_bit() on these fields, but in svd2rust this is removed for modifiedWriteValues: clear (since as far as it's concerned, any operation will clear the bit)

the accessor still has a .bit(value:bool) associated function, so we could change all of our calls on these frields from .set_bit() to .bit(true) and it should work for both old and new versions of the PAC

I feel like the SVD has probably got it wrong - at least in the case above. the write doesn't clear the bitfield. it sets the bit, and then you have to poll it until it's clear before moving on - it's a later hardware event that clears the bitfield.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream This issue affects the upstream SVD file.
Projects
None yet
Development

No branches or pull requests

2 participants