Skip to content

Added some new enumerations for G4's RCC #528

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 3 commits into from
Jul 3, 2021
Merged

Conversation

timblakely
Copy link
Contributor

Heya!

Adding a few new enum fields to the G4 RCC. Let me know if there's a better place to organize/put these.

Note: I only have access to the STM32G474, but I suspect that these enumerations are common across the G4 family seeing as the only differences appear to be RAM/ROM; they all share the same max frequency AFAICT.

@github-actions
Copy link

Memory map comparison

@adamgreig
Copy link
Member

Hi, thanks for the PR!

Your changes look good, but we try to keep describing field variants (this sort of change) to the peripherals/ directory, rather than inside common_patches. In fact, it looks like all/most of the existing rcc_v3 (and rcc_v3_pll) might apply although it was originally written for the H7. It looks like you might have a few extra things not covered there, though. Perhaps you could add those (to a new file if necessary) and then include the rcc_v3 in the existing stm32g4*.yaml devices? Or if they don't quite merge, you could create a new peripherals/rcc/rcc_g4.yaml with just your changes from this PR so far, but hopefully they're similar enough that we can mostly share one definition.

Please shout if anything doesn't make sense, I know it's not the easiest thing to understand from scratch.

@timblakely
Copy link
Contributor Author

Gotcha; understood about the division of field variants vs field fixes (kinda sad that ST makes us fix so much, ya? :). Though I haven't gone through the H7 reference manual just yet, I did check the clock config on the STM32CubeMX and compared it to the G4's. It seems like there's enough difference - particularly in the PLL domain - that I'd be concerned with me breaking any existing H7 users by changing field names and/or APIs (divisor enums vs ranges, etc) if I were to modify the rcc_v3(_pll)? files.

I've moved the changes into a new rcc_g4.yaml file under peripherals/. Since the RCC is common to all g4 chips it's now include:'d it from the common_patches/g4_rcc.yaml file, though do let me know if that's not the right place to include it!

@github-actions
Copy link

github-actions bot commented Apr 1, 2021

Memory map comparison

@adamgreig
Copy link
Member

Thanks! Ok, fair enough on the H7 one, no problem having a new rcc_g4.yaml.

I'll try to get this fully reviewed at the weekend, but in the meantime could you move the include to be done from each device file instead of from the common_patches file? It just helps make it easier to find out where files are being included if there aren't too many layers of indirection, especially across the "patch"/"peripheral" split.

@timblakely
Copy link
Contributor Author

Sounds good! No hurry on the review; just have it workin' in my own local repo so I figured I'd share it with the rest of the community :)

@github-actions
Copy link

github-actions bot commented Apr 2, 2021

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.

Thanks again for the PR! I've fully reviewed it and it basically all looks good to me, I just had three minor comments then we're good to merge:

@timblakely
Copy link
Contributor Author

timblakely commented Jun 7, 2021

Oof, sorry for the delay, been a nutty spring. I think I got all the requested changes, but please do double-check; was trying out the VSCode Pull Request extension and things went sideways in a hurry 😅

@github-actions
Copy link

github-actions bot commented Jun 7, 2021

Memory map comparison

@timblakely
Copy link
Contributor Author

I've got a few more sequential updates to other various G4 peripherals. Do you prefer submitting those as individual PRs, or is one larger update better/easier to review? No preference either way :)

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.

Oops, sorry, I missed the earlier commit. I'll merge these now and then let's put the new changes in a separate PR.

bors merge

@bors bors bot merged commit 11f023b into stm32-rs:master Jul 3, 2021
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.

2 participants