changed(pacs)!: Build PACs on demand and update PAC APIs - #1013
Draft
jbeaurivage wants to merge 15 commits into
Draft
changed(pacs)!: Build PACs on demand and update PAC APIs#1013jbeaurivage wants to merge 15 commits into
jbeaurivage wants to merge 15 commits into
Conversation
…till need SVD update
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The pre-generated PACs sitting in the repo have always been a pain point. This PR enables generating the PAC code at build-time using a build.rs scripts, which enormously reduces the number of files in the PAC crates. It also means we no longer need to run an
update-pacsscript whenever we update SVDs orsvd2rustversion, which is now a build-time dependency.Currently the
svd2rustdependency is at 0.37.1, which is the latest version.I created a new helper library,
atsamd-hal-pacs-builder, which contains the PAC generation code. It also usessvdtools, and much nicer YAML-based SVD patch templates rather than XSLT, which don't have good, pure-rust library offerings. The individualbuild.rsscripts just contain glue to call the codegen function. The PACs'lib.rsis now just this:I also updated the SVDs to the latest version provided by Microchip for SAMD21 and SAMD51 targets only. We are still waiting on Microchip to update the remaining chips we support so that the PAC APIs remain compatible.
The new SVD+svd2rust combo brings in relatively significant API changes, so this will be a breaking change for PACs and the HAL.
Notes
We are also waiting forsvd-parser released!svd-parserto make a new release. We need these changes to be released to crates.io for the new PACs to be accepted bysvd2rust. Currently I'm patching the dependency to the git version in the workspaceCargo.toml, but I don't think that's allowed if we want to releaseatsamd-hal-pacs-builderto crates.io.Checklist
svd-parserrelease > 0.14.10