Skip to content

WWDG prescaler fix for H7 #502

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 5 commits into from
Feb 19, 2021
Merged

Conversation

diondokter
Copy link
Contributor

Fixes #501

  • Renamed the G4 wwdg to wwdg_v2
  • Created patch for the bit width
  • Added the patch to the H7 devices (I checked the datasheets and they all have the bigger prescaler)

@diondokter
Copy link
Contributor Author

svdtools.patch.MissingPeripheralError: Could not find WWDG
How do I solve this?

@adamgreig
Copy link
Member

adamgreig commented Feb 19, 2021

Ah, looks like it's CFR not CFG, a typo in my suggestion earlier. https://stm32-rs.github.io/stm32-rs/STM32H7x5_CM7.html#WWDG1:CFR

edit: Also, it can be WWDG or WWDG1 or WWDG2, so better use the same selector as the g4 patch to catch them all.

@diondokter
Copy link
Contributor Author

Ah, I should have caught that. The G4 doesn't have a patch for this, so I guess the SVD was already correct in that regard.

@diondokter
Copy link
Contributor Author

diondokter commented Feb 19, 2021

Strange... The original svd file says this:

...
    <peripheral>
      <name>WWDG</name>
      <description>WWDG</description>
      <groupName>WWDG</groupName>
      <baseAddress>0x50003000</baseAddress>
      <addressBlock>
        <offset>0x0</offset>
        <size>0x400</size>
        <usage>registers</usage>
      </addressBlock>
...

Is it renamed somewhere?

Edit: Ah, I see, some of the H7's have WWDG and some have WWDG1

@github-actions
Copy link

Memory map comparison

@adamgreig
Copy link
Member

I think you should be able to just have a single h7_wwdg.yaml and write it like:

"WWDG,WWDG?":
    ...

(which is what the G4 WWDG file does:

)

@diondokter
Copy link
Contributor Author

I think you should be able to just have a single h7_wwdg.yaml and write it like:

"WWDG,WWDG?":
    ...

(which is what the G4 WWDG file does:


)

But will that change the bitWidth property as well? That seems important to change...

@adamgreig
Copy link
Member

I mean, in the devices/common_patches/h7_wwdg.yaml, which changes the bitWidth, you can match against all spellings of WWDG, rather than having h7_wwdg.yaml and a separate h7_wwdg1.yaml, and that way also match on WWDG2 (which some H7s have).

@github-actions
Copy link

Memory map comparison

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.

Looks good, thanks!

bors merge

@diondokter
Copy link
Contributor Author

diondokter commented Feb 19, 2021

Awesome! Thanks for your patience and help :)

@bors bors bot merged commit c1c971d into stm32-rs:master Feb 19, 2021
bors bot added a commit to stm32-rs/stm32h7xx-hal that referenced this pull request Feb 21, 2021
185: Update stm32h7 r=richardeoin a=mattico

stm32h7 should have a release soon. Preparing for that.

192: Added interrupt for wwdg r=richardeoin a=diondokter

Tested it and it works. It follows the same interrupt pattern and names as the RTC.

It took me a while to test because the PAC/SVD has an error it where it says there are only 2 prescaler bits. I was wondering why the timeout came so quickly... :P
I'm fixing that here: stm32-rs/stm32-rs#502

Co-authored-by: Matt Ickstadt <mattico8@gmail.com>
Co-authored-by: Richard Meadows <962920+richardeoin@users.noreply.github.com>
Co-authored-by: Dion Dokter <diondokter@gmail.com>
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

Successfully merging this pull request may close these issues.

STM32H753 has 3 bits of wwdg prescaler while only 2 are in the pac
2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy