Skip to content

Move the nxp-pac crate to a folder.#31

Merged
i509VCB merged 1 commit intoembassy-rs:mainfrom
wt:mv_pac_to_folder
Feb 21, 2026
Merged

Move the nxp-pac crate to a folder.#31
i509VCB merged 1 commit intoembassy-rs:mainfrom
wt:mv_pac_to_folder

Conversation

@wt
Copy link
Contributor

@wt wt commented Feb 13, 2026

No description provided.

@wt wt force-pushed the mv_pac_to_folder branch from 568be4f to 98af03c Compare February 13, 2026 05:54
@eva-cosma
Copy link
Collaborator

Could you explain why you think this change is necessary?

@wt
Copy link
Contributor Author

wt commented Feb 13, 2026

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.

@wt
Copy link
Contributor Author

wt commented Feb 13, 2026

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.

@wt wt force-pushed the mv_pac_to_folder branch from 98af03c to b6c2cdc Compare February 13, 2026 20:39
@i509VCB
Copy link
Member

i509VCB commented Feb 13, 2026

I think it helps with making the Cargo.toml in crate root less packed (seperate library from workspace).

@eva-cosma
Copy link
Collaborator

Alright, fair enough

@eva-cosma
Copy link
Collaborator

So long as you tell me you tested the build.rs and it still works, you have the green light from me.

@wt
Copy link
Contributor Author

wt commented Feb 14, 2026

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.

@wt
Copy link
Contributor Author

wt commented Feb 14, 2026

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.

@wt wt force-pushed the mv_pac_to_folder branch 2 times, most recently from f35f8ea to 7b221fc Compare February 14, 2026 07:29
@wt
Copy link
Contributor Author

wt commented Feb 14, 2026

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.

@wt
Copy link
Contributor Author

wt commented Feb 14, 2026

And just to make this crystal clear. This is ready to land. It has been tested.

@eva-cosma eva-cosma self-requested a review February 14, 2026 08:29
@eva-cosma
Copy link
Collaborator

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.

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.

Copy link
Collaborator

@eva-cosma eva-cosma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A handful of comments regarding the contents of the README

@wt wt force-pushed the mv_pac_to_folder branch 5 times, most recently from edc96ce to 7cc1d57 Compare February 17, 2026 05:54
@wt
Copy link
Contributor Author

wt commented Feb 17, 2026

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.

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.

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.


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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nxp-pac has nothing to do with nrf chips

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was probably leftover from some of my copy paste

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was commented in the original README. I fixed the README to have info about NXP instead.

@wt wt force-pushed the mv_pac_to_folder branch from 7cc1d57 to 807a518 Compare February 21, 2026 00:37
@wt wt force-pushed the mv_pac_to_folder branch from 807a518 to 471918c Compare February 21, 2026 00:41
@eva-cosma
Copy link
Collaborator

eva-cosma commented Feb 21, 2026

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.

(I can't explicitly approve since the change is so big that github webpage breaks 😄 ) NVM got it working by switching back to the old diff checker

@i509VCB i509VCB merged commit aa874c9 into embassy-rs:main Feb 21, 2026
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.

3 participants