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

Breaking changes from stm32-rs nightlies to be expected #61

Open
FerdinandvHagen opened this issue Oct 17, 2022 · 2 comments
Open

Breaking changes from stm32-rs nightlies to be expected #61

FerdinandvHagen opened this issue Oct 17, 2022 · 2 comments

Comments

@FerdinandvHagen
Copy link

Current stm32-rs nightlies introduce breaking changes (especially to DFSDM).
Before, each register in a cluster was a dedicated field, now it's encapsulated into arrays.
See also this issue on svd2rust: rust-embedded/svd2rust#578

This obviously breaks the crate:

Example file:
https://github.com/stm32-rs/stm32-rs-nightlies/blob/master/stm32h7/src/stm32h735/dfsdm.rs

Example error (there are about 67 in the dfsdm file which are all similar):

error[E0609]: no field `flt2` on type `R`
    --> src/dfsdm.rs:1392:46
     |
201  | impl<R> Dfsdm<R>
     |      - type parameter 'R' declared here
...
1392 |                         let cr2 = &self.regs.flt2.cr2;

As a fix those parameters will need to be changed to use array indexing instead.

@David-OConnor
Copy link
Owner

David-OConnor commented Oct 17, 2022

Thanks for the heads-up. This will take some work, but ultimately this is a good change; will make that module (and any other it affects) much more concise.

Will make the change after the PACs are updated on crates.io.

Is this across all stm32 variants?

@FerdinandvHagen
Copy link
Author

As this is a change in the upstream svd2rust crate (so in the generator and not in how the patches are done to the svds in stm32-rs) I'm expecting this to happen across all variants that use clustering for registers (not all do).

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

No branches or pull requests

2 participants