-
Notifications
You must be signed in to change notification settings - Fork 158
MSP430 Improvements #401
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
MSP430 Improvements #401
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Emilgardis (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
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.
🎉🎉🎉
This breaks svd2rust-regress, specifically, https://github.com/cr1901/svd2rust/blob/9f4b0a357f83323165a7ab29cb2e811035f2f9a8/ci/svd2rust-regress/src/svd_test.rs#L184 needs to be done for MSP430, also L176 needs to be factored out.
Going to just comment on this as I don't feel like I can say enough about MSP430, I added one of the @rust-embedded/msp430 team members to review.
//! version = "0.2.0" | ||
//! | ||
//! [features] | ||
//! rt = ["msp430-rt/device"] |
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.
Haven't tested this but I think this needs to be added to svd2rust-regress
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.
Could you elaborate on what you mean by "adding this to sv2rust-regress"?
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.
@Emilgardis Okay, I think I have a grasp on this now.
I fixed the regression tests so the msp430
test passes. As of svd2rust
17.0 plus this PR (which actually should probably be 18.0
since this is a breaking change), svd2rust
will generate a PAC that is not compatible with msp430-rt v0.1.x
. Specifically:
INTERRUPTS
array has been renamed__INTERRUPTS
; this matters to the linker script provided withmsp430-rt
.interrupts!
macro replaces with attribute macro.
Right now, it seems nothing enables the rt
feature of any PACs (lib.rs
) generated by the regression suite. Consequently, adding msp430-rt v0.1.0
as a dep still passes- it's basically a no-op. Same situation would happen if I decided to publish and use msp430-rt v0.2.0
as a prereq for this PR.
Since I'm going to be upgrading msp430
packages in lockstep very soon, and it seems that cortex-m
is also affected by not enabling the rt
feature, do you object if we hold off on adding this functionality to svd2rust-regress
for now?
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.
Fine for me 👍
@Emilgardis (X-post from IRC) How did you specifically run svd2rust-regress (command line options) to break my PR? I've never actually used the regression suite before, so I'm unsure of what to look for. |
@Emilgardis Could you please request a review from @awygle as well? We also found an issue that will prevent us from merging as-is. There appears to be a bug somewhere between what TI provides us ( I'll have to think about how to properly handle this... |
Running |
svd2rust-regress has old link in the code Here is a proper link for updated svd file: https://raw.githubusercontent.com/pftbest/msp430g2553/v0.1.3-svd/msp430g2553.svd |
After updating the SVD file, svd2rust-regress for MSP430 fails with |
I make no guarantees that I had intended all the crates ( Not sure how to proceed here. I guess I should publish |
@cr1901 I think that's fine, don't push the 0.2.0 unless it feels like it's ready. svd2rust-regress will choose whatever toolchain is being used by default, but it can also use nightly if passed |
Rebase and squash your changes instead of merge master. |
@burrbull Done. I kept the old branch locally in case it becomes necessary to use it again. |
bors try |
#[no_mangle] | ||
#[used] | ||
pub static INTERRUPTS: | ||
pub static __INTERRUPTS: |
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.
How will this affect other architectures?
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 changed the name for parity with CortexM
. It doesn't affect other architectures because the match arm only runs when the arch is Msp430
. The name should've been changed a while ago, but I only got around to it now.
tryBuild succeededAnd happy new year from bors! 🎉 |
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.
LGTM
bors r+ |
👎 Rejected by label |
bors r+ |
401: MSP430 Improvements r=therealprof a=cr1901 This PR brings MSP430 PAC generation up to parity with Cortex M PAC generation. Among other things, a `device.x` file is now generated for each MSP430 PAC, and the `interrupt!` macro has been replaced with an attribute macro from the not-yet-published `msp430-rt v0.2.0`. The remaining changes are docs and cleanups of the generated code; a number of features have become stable. Only `abi_msp430_interrupt` is not stable yet, and I have a workaround for this that I've not written yet. Switching to an `interrupt` attribute macro is a breaking change, so I incremented the "major" version number. Co-authored-by: William D. Jones <[email protected]>
Format with |
@burrbull Is it possible to add a "fast fail" attribute to the rustfmt check only? |
Build failed |
You mean stop all jobs when |
@burrbull Pushed w/ formatting changes. Github decided for me to dismiss your review- I didn't do it. |
bors r+ |
401: MSP430 Improvements r=therealprof a=cr1901 This PR brings MSP430 PAC generation up to parity with Cortex M PAC generation. Among other things, a `device.x` file is now generated for each MSP430 PAC, and the `interrupt!` macro has been replaced with an attribute macro from the not-yet-published `msp430-rt v0.2.0`. The remaining changes are docs and cleanups of the generated code; a number of features have become stable. Only `abi_msp430_interrupt` is not stable yet, and I have a workaround for this that I've not written yet. Switching to an `interrupt` attribute macro is a breaking change, so I incremented the "major" version number. Co-authored-by: William D. Jones <[email protected]>
Build succeededAnd happy new year from bors! 🎉 |
This PR brings MSP430 PAC generation up to parity with Cortex M PAC generation. Among other things, a
device.x
file is now generated for each MSP430 PAC, and theinterrupt!
macro has been replaced with an attribute macro from the not-yet-publishedmsp430-rt v0.2.0
.The remaining changes are docs and cleanups of the generated code; a number of features have become stable. Only
abi_msp430_interrupt
is not stable yet, and I have a workaround for this that I've not written yet.Switching to an
interrupt
attribute macro is a breaking change, so I incremented the "major" version number.