-
Notifications
You must be signed in to change notification settings - Fork 244
Add patches and descriptions for STM32WLE5xx #559
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
Conversation
Added some more peripherals today, hopefully will finish by the end of the week. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a quick check over everything with the reference manual; looks good!
I also tested it with a nucleo dev board and my half-baked HAL, and it works for what is currently implemented.Thanks for the monumental amount of effort here @jorgeig-space !
One request I have is that adding patches only for the
stm32wle
does make this difficult to use with other STM32WL MCUs (lots of warnings because some fields no longer require unsafe). It would be nice to add thestm32wl5x_cm0p.yaml
and thestm32wl5x_cm4.yaml
at the same time (provided below); but this is scope creep and I am happy to make the contribution after the fact if you do not want to make this PR any larger.Click to expand...
Amazing, thank you for the review and the new work!
We are in the same situation: using the Nucleo board to develop but having the WLE in production (although we might switch given the single-core version shortage!!). I was planning on adding the dual-core versions soon, but since you've taken the time to do that, I'll add it to the PR.
Let me get through your suggestions this week and then I think it'll be ready to merge.
Re the split fields,
Changing the svd2rust output isn't really an option so I think you will just have to keep CHMOD2 and document it, as with the timer fields. It's annoying, but there's no method in the SVD file format to represent this situation, so it's not an easy thing to add to svd2rust or even annotate here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found out svd2rust
0.19.0 has additional validation, I used that to find a few more bugs, I left the fixes as suggestions.
All patched. Many thanks for the review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this PR @jorgeig-space and all the work that went into it, and thanks @newAM for reviewing it so carefully too.
All I've got is some suggestions on variant names to better match the rest of the convention (camel case for variants where possible, and counters like Bits128). Note that svd2rust will generate Rust-appropriate method and variant names including underscores automatically when the input follows this convention, so for example NormalPinBuffer
will get a normal_pin_buffer()
method.
The one thing I didn't leave a comment on is the ADC resolution which is currently like EightBit
. Most of the ADCs in stm32-rs follow this because it predates using Bits8
etc everywhere, though some of the newer v3 ADCs use Bits8
instead. I don't mind if you'd rather keep it as EightBit
or move to Bits8
.
Let me know what you think about these suggestions, if you have a particular reason in any specific case for it to be like it then it can stay.
Other than that, looks good to merge.
Thanks for the review. I agree with your suggestions. I've changed the ADC resolution fields plus some other typos I found too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks, let's merge this!
bors merge
This PR adds patches and field descriptions for the STM32WLE5xx (single-core) chips. Most of it is probably applicable to STM32WL55xx (dual-core), and the non-LoRa versions (WLE4 and WL54) although that will only be considered after all peripherals are implemented.
As this is our first contribution, we are looking for feedback from the maintainers and the community.
The following peripherals are implemented (as listed in the ref. manual):