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

Duplicate Types Building STM32U575 from svd #850

Open
JacobBeningo opened this issue Jun 14, 2024 · 3 comments
Open

Duplicate Types Building STM32U575 from svd #850

JacobBeningo opened this issue Jun 14, 2024 · 3 comments

Comments

@JacobBeningo
Copy link

When attempting to build the converted STM32U575.svd file into a PAC, I'm getting build errors related to duplicate types.

I'm using:

I did find that the enum size for the following fields needed to be adjusted:
TIM1:TIM1_SMCR:SMS1
TIM1:TIM1_SMCR:TS1
TIM1:TIM1_SMCR:SMS2
TIM1:TIM1_SMCR:TS2

I've notified ST about the issue.

The main errors popping up appear to be:

  1. error[E0004]: non-exhaustive patterns: &gpdma_c13tr1::Pam::B0x0 and &gpdma_c13tr1::Pam::B0x1 not covered
    --> src/gpdma1/gpdma_c13tr1.rs:158:23
    |
    158 | #[derive(Clone, Copy, Debug, PartialEq, Eq)]
    | ^^^^^ patterns &gpdma_c13tr1::Pam::B0x0 and &gpdma_c13tr1::Pam::B0x1 not covered

  2. error[E0592]: duplicate definitions with name b_0x0
    --> src/gpdma1/gpdma_c14tr1.rs:236:5
    |
    226 | pub fn b_0x0(self) -> &'a mut crate::W {
    | ------------------------------------------- other definition for b_0x0
    ...
    236 | pub fn b_0x0(self) -> &'a mut crate::W {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ duplicate definitions for b_0x0

@burrbull
Copy link
Member

Enums generated by ST are broken and have no sense. So we just delete them before pass to svd2rust.
https://github.com/stm32-rs/stm32-rs/blob/e84479900343fef5f3a4f21a990dcc90a2462565/devices/stm32u575.yaml#L3

You can find generated crates here: https://github.com/stm32-rs/stm32-rs-nightlies/tree/master/stm32u5

@burrbull
Copy link
Member

Also there is some unmerged pathches: stm32-rs/stm32-rs#974

@JacobBeningo
Copy link
Author

Awesome! Thanks for the quick reply.

I've done this with many other chips without any issues, including the L475, so it threw me for a loop!

I'll go this route! Thanks again!

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