question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Peripherial view does not show 8bit addressBlocks

See original GitHub issue

When trying to add AVR peripherial view support to PIO debugger by providing SVD files converted from Atmel’s atdf. PIO seems to not show anything in the peripherial view if the adressBlock is less then 4 bytes.

Consider this SVD
<?xml version="1.0" encoding="UTF-8"?>
<device>
  <vendor>Atmel</vendor>
  <name>ATmega1284P</name>
  <addressUnitBits>8</addressUnitBits>
  <size>8</size>
  <access>read-write</access>
  <resetValue>0</resetValue>
  <resetMask>0xff</resetMask>
  <peripherals>
    <peripheral>
      <name>AC</name>
      <description>Analog Comparator</description>
      <baseAddress>0x50</baseAddress>
      <addressBlock>
        <offset>0x0</offset>
        <size>0x1</size>
        <usage>registers</usage>
      </addressBlock>
      <registers>
        <register>
          <name>ACSR</name>
          <description>Analog Comparator Control And Status Register</description>
          <addressOffset>0x0</addressOffset>
          <access>read-write</access>
          <fields>
            <field>
              <name>ACIS</name>
              <description>Analog Comparator Interrupt Mode Select bits</description>
              <bitRange>[1:0]</bitRange>
              <access>read-write</access>
              <writeConstraint>
                <useEnumeratedValues>true</useEnumeratedValues>
              </writeConstraint>
              <enumeratedValues>
                <enumeratedValue>
                  <name>VAL_0x00</name>
                  <description>Interrupt on Toggle</description>
                  <value>0</value>
                </enumeratedValue>
                <enumeratedValue>
                  <name>VAL_0x01</name>
                  <description>Reserved</description>
                  <value>1</value>
                </enumeratedValue>
                <enumeratedValue>
                  <name>VAL_0x02</name>
                  <description>Interrupt on Falling Edge</description>
                  <value>2</value>
                </enumeratedValue>
                <enumeratedValue>
                  <name>VAL_0x03</name>
                  <description>Interrupt on Rising Edge</description>
                  <value>3</value>
                </enumeratedValue>
              </enumeratedValues>
            </field>
            <field>
              <name>ACIC</name>
              <description>Analog Comparator Input Capture Enable</description>
              <bitRange>[2:2]</bitRange>
              <access>read-write</access>
            </field>
            <field>
              <name>ACIE</name>
              <description>Analog Comparator Interrupt Enable</description>
              <bitRange>[3:3]</bitRange>
              <access>read-write</access>
            </field>
            <field>
              <name>ACI</name>
              <description>Analog Comparator Interrupt Flag</description>
              <bitRange>[4:4]</bitRange>
              <access>read-write</access>
            </field>
            <field>
              <name>ACO</name>
              <description>Analog Compare Output</description>
              <bitRange>[5:5]</bitRange>
              <access>read-write</access>
            </field>
            <field>
              <name>ACBG</name>
              <description>Analog Comparator Bandgap Select</description>
              <bitRange>[6:6]</bitRange>
              <access>read-write</access>
            </field>
            <field>
              <name>ACD</name>
              <description>Analog Comparator Disable</description>
              <bitRange>[7:7]</bitRange>
              <access>read-write</access>
            </field>
          </fields>
        </register>
      </registers>
    </peripheral>
  </peripherals>
</device>

Nothing gets shown in the view, but the register appears if addressBlock.size is set to 4 or more.

I’d be happy to debug, but although according to Community PIO Plus is supposed to be open source, I can not find the source of platformio-vscode-debug. Where is it published?

PS In case of a missing addressBlock, PIO fails with an extremely unhelpful “Cannot read property ‘0’ of undefined”

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
maxgerhardtcommented, Jun 10, 2021

At https://github.com/Rahix/atdf2svd/issues/25#issuecomment-858741454 I’ve posted a reference with 8-bit regsiters which works nicely per https://github.com/platformio/platform-ststm8/pull/38, see screenshots.

I’d be happy to debug, but although according to Community PIO Plus is supposed to be open source, I can not find the source of platformio-vscode-debug. Where is it published?

+1 on this. I thought I opened an issue about that long ago but I can’t find it anymore. I’ll open a separate issue for that.

0reactions
maxgerhardtcommented, Oct 9, 2021

~still valid ~

Read more comments on GitHub >

github_iconTop Results From Across the Web

7 bit 8 bit and 10 bit I2C Slave Addressing
Another way to determine if a vendor is using 8-bit addresses instead of 7-bit addresses is to see if the slave address falls...
Read more >
EMIF 8-bits access to external peripheral TL16C750E ... - TI E2E
Hello,. In our design, we interface the processor with an external TL16C750E UART peripheral. This peripheral has an 8-bits parallel bus ...
Read more >
I2C - SparkFun Learn
Messages are broken up into two types of frame: an address frame, where the controller indicates the peripheral to which the message is...
Read more >
The Peripheral ID Registers
You can see that this does not match the numerical order of the registers, ID0 to ID7. Only bits [7:0] of each Peripheral...
Read more >
9. Communicating with Hardware - Linux Device Drivers, ...
Even if the peripheral bus has a separate address space for I/O ports, not ... 8-bit and 16-bit I/O accesses by mapping them...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found