Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Microcontrollers) Is it possible to utilize .svd file to view target registers? #430

Open
retif opened this issue Jun 6, 2024 · 3 comments

Comments

@retif
Copy link

retif commented Jun 6, 2024

SVD file defines named register addresses for every peripheral available on microcontroller. Is it possible to use this debugger with SVD file attached to a launch configuration?

@GitMensch
Copy link
Collaborator

How does an SVD file looks like? Does it "somehow work" with GDB?

@retif
Copy link
Author

retif commented Jun 6, 2024

The manufacturer provides SVD(System View Description) file for every microcontroller, the insides are looks like this(snippet)

   <peripheral>
      <name>HRTIM_Master</name>
      <description>High Resolution Timer: Master
      Timers</description>
      <groupName>HRTIM</groupName>
      <baseAddress>0x40017400</baseAddress>
      <addressBlock>
        <offset>0x0</offset>
        <size>0x80</size>
        <usage>registers</usage>
      </addressBlock>
      <registers>
        <register>
          <name>MCR</name>
          <displayName>MCR</displayName>
          <description>Master Timer Control Register</description>
          <addressOffset>0x0</addressOffset>
          <size>0x20</size>
          <access>read-write</access>
          <resetValue>0x00000000</resetValue>
          <fields>
            <field>
              <name>BRSTDMA</name>
              <description>Burst DMA Update</description>
              <bitOffset>30</bitOffset>
              <bitWidth>2</bitWidth>
            </field>
          </fields>
        </register>
      </registers>
   </peripheral>

There many more of them in .SVD file. And they provide description of every peripheral register address, name, description and every field name, description offset. This allows when we are in debug session to navigate over this list rendered as a tree of names and view/set the value of them, for debug purposes, this can save time of reading datasheet or .svd file to find out the needed address. Its could be not easy, because for every bit field you need to sum the offset with baseAddress of register to see/change its value

@retif retif changed the title Is it possible to utilize .svd file to view target registers? (Microcontrollers) Is it possible to utilize .svd file to view target registers? Jun 6, 2024
@GitMensch
Copy link
Collaborator

To answer the initial question. Yes it is possible. And to possibly also answer it: someone would need to implement a configuration for reading this file and loading the registers in the already available register view. Maybe that someone could be you or someone you know?

Side note: There's a good debug extension specialized on debugging microcontrollers and it already has SVD support: Cortex Debug (and no, we sadly cannot copy any of its part as it has an incompatible license [you cannot take MIT-code and put it in a Public Domain code if you don't want to switch to MIT]).

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

No branches or pull requests

2 participants