rust-embedded / svd2rust

Generate Rust register maps (`struct`s) from SVD files
Apache License 2.0
675 stars 147 forks source link

Doesn't support `read/clear` register access type. #707

Closed deng-yongsheng closed 1 year ago

deng-yongsheng commented 1 year ago

Hi,

I am using a CH32V307 risc-v chip, trying to generate a HAL from the official svd file: CH32V307xx.svd

[INFO  svd2rust] Parsing device from SVD file
[ERROR svd2rust] Error parsing SVD XML file

    Caused by:
        0: In device `CH32V30xxx`
        1: In peripheral `ETHERNET_DMA`
        2: In register `DMASR`
        3: In field `TS`
        4: Parsing unknown access at 15756:15
        5: unknown access variant 'read/clear' found
<register>
          <name>DMASR</name>
          <displayName>DMASR</displayName>
          <description>Ethernet DMA status register</description>
          <addressOffset>0x14</addressOffset>
          <size>0x20</size>
          <resetValue>0x00000000</resetValue>
          <fields>
            <field>
              <name>TS</name>
              <description>Transmit status</description>
              <bitOffset>0</bitOffset>
              <bitWidth>1</bitWidth>
              <access>read/clear</access>
            </field>
            <field>
              <name>TPSS</name>
              <description>Transmit process stopped
              status</description>
              <bitOffset>1</bitOffset>
              <bitWidth>1</bitWidth>
              <access>read/clear</access>
            </field>
burrbull commented 1 year ago

read/clear is incorrect access type. use access: read-write with modifiedWriteValues: clear or access: read with readAction: clear depending on what read/clear means

deng-yongsheng commented 1 year ago

read/clear is incorrect access type. use access: read-write with modifiedWriteValues: clear or access: read with readAction: clear depending on what read/clear means

Okay, thank you.