Skip to content

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

Open

Description

@retif

Given that an SVD file provides named register addresses for all microcontroller peripherals, does this debugger support attaching an SVD file to the launch configuration?

Activity

  1. GitMensch commented on Jun 6, 2024

    @GitMensch
    Collaborator

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

  2. retif commented on Jun 6, 2024

    @retif
    Author

    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

  3. 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?[/+] on Jun 6, 2024
  4. GitMensch commented on Sep 13, 2024

    @GitMensch
    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]).

  5. ChrisIdema commented on Jul 15, 2026

    @ChrisIdema

    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]).

    I don't think this is correct. The license explicitly allows modifying and sub-licensing:
    https://github.com/Marus/cortex-debug?tab=MIT-1-ov-file
    You can put the copied code and license in a separate folder. The license does not apply to other code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions