rp2040-pac icon indicating copy to clipboard operation
rp2040-pac copied to clipboard

update svdtools

Open burrbull opened this issue 3 years ago • 2 comments
trafficstars

burrbull avatar Aug 21 '22 15:08 burrbull

Switching from _derive to _copy does not work correctly with the other patches we make.

Specifically:

DMA:
  CH0_AL1_CTRL:
    _modify:
      "CHAIN_TO":
        description: "When this channel completes, it will trigger the channel indicated by CHAIN_TO. Disable by setting CHAIN_TO = _(this channel)_. \\n
        Reset value is 0, which means for channels 1 and above the default will be to chain to channel 0 - set this field to avoid this behaviour."
  CH0_AL2_CTRL:
    _modify:
      "CHAIN_TO":
        description: "When this channel completes, it will trigger the channel indicated by CHAIN_TO. Disable by setting CHAIN_TO = _(this channel)_. \\n
        Reset value is 0, which means for channels 1 and above the default will be to chain to channel 0 - set this field to avoid this behaviour."
  CH0_AL3_CTRL:
    _modify:
      "CHAIN_TO":
        description: "When this channel completes, it will trigger the channel indicated by CHAIN_TO. Disable by setting CHAIN_TO = _(this channel)_. \\n
        Reset value is 0, which means for channels 1 and above the default will be to chain to channel 0 - set this field to avoid this behaviour."

fails with

svdtools.patch.MissingRegisterError: Could not find DMA:CH0_AL1_CTRL

and

DMA:
  _cluster:
    "CH%s":
      "CH?_READ_ADDR,CH??_READ_ADDR": {}
      "CH?_WRITE_ADDR,CH??_WRITE_ADDR": {}
      "CH?_TRANS_COUNT,CH??_TRANS_COUNT": {}
      "CH?_CTRL_TRIG,CH??_CTRL_TRIG": {}
      "CH?_AL1_CTRL,CH??_AL1_CTRL": {}
      "CH?_AL1_READ_ADDR,CH??_AL1_READ_ADDR": {}
      "CH?_AL1_WRITE_ADDR,CH??_AL1_WRITE_ADDR": {}
      "CH?_AL1_TRANS_COUNT_TRIG,CH??_AL1_TRANS_COUNT_TRIG": {}
      "CH?_AL2_CTRL,CH??_AL2_CTRL": {}
      "CH?_AL2_TRANS_COUNT,CH??_AL2_TRANS_COUNT": {}
      "CH?_AL2_READ_ADDR,CH??_AL2_READ_ADDR": {}
      "CH?_AL2_WRITE_ADDR_TRIG,CH??_AL2_WRITE_ADDR_TRIG": {}
      "CH?_AL3_CTRL,CH??_AL3_CTRL": {}
      "CH?_AL3_WRITE_ADDR,CH??_AL3_WRITE_ADDR": {}
      "CH?_AL3_TRANS_COUNT,CH??_AL3_TRANS_COUNT": {}
      "CH?_AL3_READ_ADDR_TRIG,CH??_AL3_READ_ADDR_TRIG": {}

fails with

svdtools.patch.SvdPatchError: DMA: registers cannot be collected into CH%s cluster

9names avatar Sep 17 '22 08:09 9names

You have used _delete incorrect. Now both rust and python svdtools should work.

burrbull avatar Sep 17 '22 10:09 burrbull

I tried to upgrade rp2040-hal to a pac generated with this pull request. But I got some problems regarding the ADC CS register, which has a bit START_ONCE which is annotated as <modifiedWriteValues>clear</modifiedWriteValues> in the svd file. I guess it's because the version of svd2rust used in this PR does not yet contain https://github.com/rust-embedded/svd2rust/pull/673

jannic avatar Jul 22 '23 21:07 jannic

Clippy fails because the merge request doesn't yet contain updated, generated sources. I intentionally left them out to make the review easier. But I'll add them now, the commits are small enough to review them one by one if the changes to src/ are too confusing.

jannic avatar Jul 23 '23 12:07 jannic

Updating src/ was a bad idea, as it causes merge conflicts. → undone Let's merge it first and then update the sources in a separate merge request.

jannic avatar Jul 23 '23 12:07 jannic

Seems like @jannic feedbacks have been applied already. Merging.

ithinuel avatar Jul 23 '23 16:07 ithinuel