-
Notifications
You must be signed in to change notification settings - Fork 69
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 mass-erase trigger on "small" devices. #210
Conversation
The list of specifically enumerated "large" devices has the correct set of register operations to start a mass erase, setting the mer1 and mer2 bits. But the "small-devices" alternative does not; it clears the mer bit instead of setting it. Looking at history, this was changed from set to clear in the PR that added support for "large" devices. It appears to have been accidental.
The CI tests are failing due to the nightly compiler change to reject all references to mutable statics, not due to this change. |
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 see, thanks!
Could you add an entry to the changelog about this?
Could you also add the couple of addr_of_mut!
calls so that the nightly compiler is happy? (this does not need a changelog entry)
This is mostly a workaround, because Pin<> requires a reference, not a pointer, but the rust compiler change wants users to use pointers (via addr_of_mut!()), not references. In this particular case, we don't actually *need* Pin<>, because the static mut won't be moved anyway, but we can't prove that to the DMA API without it. So deref the addr_of_mut!() pointer, and make a ref to it, rather than restructuring the DMA API to work on raw pointers (and somehow enforce the Pin<> guarantees on the pointed-to data).
Missed these in the previous commit because I did not test locally with the `rt` feature enabled.
Done.
Also done. Thanks! |
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.
Great, thank you!
The list of specifically enumerated "large" devices has the correct set of register operations to start a mass erase, setting the mer1 and mer2 bits. But the "small-devices" alternative does not; it clears the mer bit instead of setting it.
Looking at history, this was changed from set to clear in the PR that added support for "large" devices. It appears to have been accidental.