Type: Bug Report
Describe the bug
- OS and Version: Microsoft Windows 11 pro
- VS Code Version: 1.127.0
- Extension Version: 1.9.2
- Target Device: MDR12065
- Other extensions you installed: Cortex-Debug, C/C++
- A clear and concise description of what the bug is.
Incorrect handling of the derivedFrom attribute for registers inside peripherals that also use derivedFrom.
Suppose we have a peripheral block PORTA with registers REG1 and REG2, where REG2 has the attribute derivedFrom="REG1". We also have a peripheral block PORTB declared with derivedFrom="PORTA". In this case, the extension processes the SVD file incorrectly: register REG2 in PORTB does not inherit the fields and properties of register REG1, as required by the CMSIS‑SVD specification.
In the attached test.svd file, the registers of peripherals PORTB, PORTC, and PORTD that use the derivedFrom attribute are handled incorrectly and are displayed as read‑only, even when this does not match their actual definition in the SVD file. Only PORTA registers are displayed correctly.
To Reproduce
Steps to reproduce the behavior:
- Open a project that includes test.svd.
- Start debugging with a configuration that uses test.svd.
- Expand the PERIPHERALS view.
- PORTB, PORTC, and PORTD are displayed incorrectly: the OE, ANALOG, and other registers with the derivedFrom attribute appear as read‑only and have no fields.
Expected behavior
Registers with the derivedFrom attribute inside peripherals that themselves use derivedFrom must inherit the fields, access types, and other properties of the base register in accordance with the CMSIS‑SVD specification.
Code sample and logs
Screenshots

Additional context
This issue is likely caused by shallow inheritance in the SVD parser. Peripheral nodes that use derivedFrom are merged only at the top level, without properly expanding and linking their nested registers and fields. As a result, when a register with derivedFrom is inside a peripheral that also uses derivedFrom, the parser does not resolve the base register from the original peripheral context, and the derived register fails to inherit from the base register.
Type: Bug Report
Describe the bug
Incorrect handling of the derivedFrom attribute for registers inside peripherals that also use derivedFrom.
Suppose we have a peripheral block PORTA with registers REG1 and REG2, where REG2 has the attribute derivedFrom="REG1". We also have a peripheral block PORTB declared with derivedFrom="PORTA". In this case, the extension processes the SVD file incorrectly: register REG2 in PORTB does not inherit the fields and properties of register REG1, as required by the CMSIS‑SVD specification.
In the attached test.svd file, the registers of peripherals PORTB, PORTC, and PORTD that use the derivedFrom attribute are handled incorrectly and are displayed as read‑only, even when this does not match their actual definition in the SVD file. Only PORTA registers are displayed correctly.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Registers with the derivedFrom attribute inside peripherals that themselves use derivedFrom must inherit the fields, access types, and other properties of the base register in accordance with the CMSIS‑SVD specification.
Code sample and logs
test.svdin example.zipScreenshots

Additional context
This issue is likely caused by shallow inheritance in the SVD parser. Peripheral nodes that use derivedFrom are merged only at the top level, without properly expanding and linking their nested registers and fields. As a result, when a register with derivedFrom is inside a peripheral that also uses derivedFrom, the parser does not resolve the base register from the original peripheral context, and the derived register fails to inherit from the base register.