Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

scootermon
Copy link

I have an SVD file with two instances of a peripheral. The second peripheral contains the same registers, but instead of 128 it only has 64. The SVD file uses derivedFrom in the second peripheral to inherit these registers but overrides the <dim> element. To my surprise, svd2rust generated arrays with the same number of elements for both instances.
Well, after following the trail I ended up here and the reason wasn't hard to find.

I saw #283 and the follow up #286, but there's little to no reasoning attached to these PRs.

Looking at the spec here I really don't see a reason why the fields from dimElementGroup shouldn't also be overridden.
The derivedFrom description reads

Specify the register name from which to inherit data. Elements specified subsequently override inherited values.

I can't see a statement about the dimElementGroup elements somehow being exempt.

@scootermon scootermon requested a review from a team as a code owner September 14, 2025 21:39
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.

1 participant