rust-embedded / rust-embedded/svd2rust

Possible regression: register array inference

Open
#938 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
857
Forks
164
PR merge metrics
No merged PRs in 30d

Description

Using svd2rust 0.36.1, some registers which were previously inferred as arrays now explicitly list all registers.

Ie, from

pmux1_0: [Pmux1_; 16],
...

to

pmux1_0: Pmux1_0,
pmux1_1: Pmux1_1,
pmux1_2: Pmux1_2,
...

Since this issue does not appear in svd2rust 0.36.0, I suspect #930 to be the culprit.
For example, this SVD is affected -- specifically, the PMUX0 and PINCFG0 fields of the PORT peripheral.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the regression with the ATSAMD21E18.svd input, focusing on the PORT peripheral's PMUX0 and PINCFG0 fields. Compare generated output from svd2rust 0.36.0 and 0.36.1, then inspect the changes in #930. Done means these registers are inferred as arrays again rather than emitted individually.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
embedded-iot, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.