bloombloombloom / Bloom

A debug interface for AVR-based embedded systems development on GNU/Linux.
https://bloom.oscillate.io/
Other
64 stars 3 forks source link

Generate SVD on demand (via GDB monitor command) #52

Closed navnavnav closed 1 year ago

navnavnav commented 1 year ago

Users should be able to generate the System View Description (SVD) XML of the target currently being debugged, via a GDB monitor command.

I propose the following new GDB monitor commands:

Not sure when I'll get onto this. Will post any updates on this ticket.

navnavnav commented 1 year ago

I've come to accept that this renders the monitor target-info machine command obsolete, so I will be removing that command as part of this work.

navnavnav commented 1 year ago

Development work on this is complete.

The two monitor commands have been implemented. Have ensured that the generated XML conforms to the SVD schema, and is compatible with CLion.

Below is a sample SVD generated for the Atmega328P:

<!-- This SVD was generated by Bloom (https://bloom.oscillate.io/). Please report any issues via https://bloom.oscillate.io/report-issue -->
<!-- Base addresses in this SVD have been offset by 0x800000. This offset is required for access via avr-gdb. -->
<device schemaVersion="1.3" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="https://bloom.oscillate.io/assets/svd-schema.xsd">
 <vendor>Microchip</vendor>
 <name>ATmega328P</name>
 <!-- The version number below is that of the Bloom binary which generated this SVD. -->
 <version>0.10.0</version>
 <description>ATmega328P from Microchip</description>
 <addressUnitBits>8</addressUnitBits>
 <width>8</width>
 <size>8</size>
 <access>read-only</access>
 <peripherals>
  <peripheral>
   <name>AC</name>
   <baseAddress>0x800000</baseAddress>
   <registers>
    <register>
     <name>ACSR</name>
     <description>Analog Comparator Control And Status Register</description>
     <addressOffset>0x50</addressOffset>
     <size>8</size>
     <access>read-only</access>
    </register>
    <register>
     <name>DIDR1</name>
     <description>Digital Input Disable Register 1</description>
     <addressOffset>0x7f</addressOffset>
     <size>8</size>
     <access>read-write</access>
    </register>
   </registers>
  </peripheral>
  <peripheral>
   <name>ADC</name>
   <baseAddress>0x800000</baseAddress>
   <registers>
    <register>
     <name>ADC</name>
     <description>ADC Data Register Bytes</description>
     <addressOffset>0x78</addressOffset>
     <size>16</size>
     <access>read-write</access>
    </register>
    <register>
     <name>ADCSRA</name>
     <description>The ADC Control and Status register A</description>
     <addressOffset>0x7a</addressOffset>
     <size>8</size>
     <access>read-only</access>
    </register>
    <register>
     <name>ADCSRB</name>
     <description>The ADC Control and Status register B</description>
     <addressOffset>0x7b</addressOffset>
     <size>8</size>
     <access>read-write</access>
    </register>
    <register>
     <name>ADMUX</name>
     <description>The ADC multiplexer Selection Register</description>
     <addressOffset>0x7c</addressOffset>
     <size>8</size>
     <access>read-write</access>
    </register>
    <register>
     <name>DIDR0</name>
     <description>Digital Input Disable Register</description>
     <addressOffset>0x7e</addressOffset>
     <size>8</size>
     <access>read-write</access>
    </register>
   </registers>
  </peripheral>
<!-- ... -->
 </peripherals>
</device>

And the SVD works fine with CLion: image

These changes will be shipped with v0.11.0. Closing this now