Move the nxp-pac crate to a folder.#31
Conversation
|
Could you explain why you think this change is necessary? |
|
I guess it isn't necessary. I think this change simplifies the nxp-pac crate by not including unnecessary context in the crate's directory. However, definitely not strictly necessary. I just think it makes the structure of the different concerns a little more clear. I think it also give a nice space to document anything that crosses concerns between the different crates and other directories. |
|
And FWIW, I should probably move the transforms directory out of the nxp-pac directory. Maybe that should move to the data directory or even the generator directory. |
|
I think it helps with making the Cargo.toml in crate root less packed (seperate library from workspace). |
|
Alright, fair enough |
|
So long as you tell me you tested the build.rs and it still works, you have the green light from me. |
|
I did test the generation (and using the results with my lpc55s16 changes). However, please let me move the transforms directory to a better location before you land it. |
|
Also, the only diffs on the pacs after running this are the version number of chiptool since I am using a different version than what they were originally generated with. |
f35f8ea to
7b221fc
Compare
|
Okay, I got it done. Also, here's an example diff that I excluded from the change since it wasn't functional: diff --git a/nxp-pac/src/chips/lpc55s69_cm33_core0/mod.rs b/nxp-pac/src/chips/lpc55s69_cm33_core0/mod.rs
index 5a401be..f93702c 100644
--- a/nxp-pac/src/chips/lpc55s69_cm33_core0/mod.rs
+++ b/nxp-pac/src/chips/lpc55s69_cm33_core0/mod.rs
@@ -1,6 +1,6 @@
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
-#![doc = "Peripheral access API (generated using chiptool v0.1.0 (0b476f2 2026-01-01))"]
+#![doc = "Peripheral access API (generated using chiptool v0.1.0 (6a8c2aa 2026-01-27))"]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Interrupt {As a related aside, we should probably standardize which version of chiptool is being used to generate the code to prevent diffs like this. As it stands, we currently have different board pac code that was generated by different versions of chiptool. That probably isn't ideal. |
|
And just to make this crystal clear. This is ready to land. It has been tested. |
I'm not sure there is a simple solution to this. Inherently if chiptool updates its very much possible to have a breaking change in generation, so every chiptool should be checked. So if, for example, you want to make an update to a pac and use a newer version of chiptool, you should first make a commit where you just run the updated chiptool and another one that has your changes. Thats the trivial solution to this. |
eva-cosma
left a comment
There was a problem hiding this comment.
A handful of comments regarding the contents of the README
edc96ce to
7cc1d57
Compare
I think that the simplest thing we could do is declare the git commit of the chiptool binary we are using and make sure all pac code is generated from that version. This is not a problem to be handled in this change. |
nxp-pac/README.md
Outdated
|
|
||
| This is a [Peripheral Access Crate](https://rust-embedded.github.io/book/start/registers.html) for NXP microcontrollers. | ||
|
|
||
| This crate has been automatically generated from the SVD files in [nrfx](https://github.com/NordicSemiconductor/nrfx), using [chiptool](https://github.com/embassy-rs/chiptool/). Fixes are added to the SVD file to make the |
There was a problem hiding this comment.
nxp-pac has nothing to do with nrf chips
There was a problem hiding this comment.
That was probably leftover from some of my copy paste
There was a problem hiding this comment.
That was commented in the original README. I fixed the README to have info about NXP instead.
|
Ok. LGTM. @i509VCB I'll let you merge this one when you think its' reasonable to do so, since it will break every other PR here.
|
No description provided.