-
Notifications
You must be signed in to change notification settings - Fork 215
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
stm32c0 field naming preference #858
Comments
The 2 main use cases of SVD are codegen and debugging. Also we widely use clusters/arrays which you can find not fully consistent to RM. Although I understand why ST renamed these fields. As |
Yeah, the renaming makes sense to me as well -- it's merely inconvenient if you're trying for portability. I've got the GPIO renamed to the point where |
You could copy full peripheral from other SVD with |
@cbiffle FYI the Naming of registers there is already consistent across chips. Policy is "consistency across chips first, matching the RM second". ( |
yeah, exactly! :) it was born out of the frustration with the patches... |
Hi! I'm attempting to get your stm32c0 support working, with the hopes of submitting a PR. Ran into a question pretty early.
ST's changed the names of all the GPIO fields on stm32c0. The bits in e.g. PUPDR have historically been named PUPDR0-15, which always seemed weird and duplicative, but it's what the reference manuals say.
In the C0 reference manual, they've renamed them to remove the R. So, PUPD0-15.
So I've got two options:
Normally, I feel like matching the reference manual is the right thing to do. In this particular case I'm torn: the firmware I'm working on also supports g0, and the renaming of things willy-nilly makes supporting both ... verbose. So that has me kind of inclined to match the historical bit names, in defiance of the reference manual. If it were something like changing a field called
LOCK
toDONUT
I wouldn't even consider it, but this is dropping a superfluous R that I often forgot to write anyway, until reminded by rust-analyzer.What do y'all think? Do you have a policy on this when the reference manual deviates in unexpected ways? (I remember the H7A3 reference manual making some arbitrary power domain register naming changes in a point release, for instance, but I don't remember what y'all did in response.)
Edit: ha, just to complicate things, I took a look at the G0 reference manual (rev 3) and C0 (rev 3) side by side and ... the G0 reference manual contains the same renaming as the C0, but the ST-provided G0 SVD uses the legacy names (the C0 SVD uses the changed names). So the SVD (and stm32-rs) don't match the reference manual already, suggesting that not matching on the C0 wouldn't be horrible.
So please comment here if you think otherwise, but barring input I'm going to work on a PR using the historical names (PUPDRx instead of PUPDx).
The text was updated successfully, but these errors were encountered: