derivedFrom for field enumerations produces error
Nobody has claimed this yet.
- Dominant language
- Ada
- Stars
- 71
- Forks
- 41
- PR merge metrics
- No merged PRs in 30d
Description
When trying to use the derivedFrom attribute on an enumeration an error is thrown
svd2ada --boolean --gen-uint-always --no-vfa-on-types --gen-uint-always -o STM32 -p STM32_SVD STM32F439x.svd
raised CONSTRAINT_ERROR : enumerate 'derivedFrom' is not known: MODER15.MODEREnumVals
svd2ada --boolean --gen-uint-always --no-vfa-on-types --gen-uint-always -o STM32 -p STM32_SVD STM32F439x.svd
raised CONSTRAINT_ERROR : enumerate 'derivedFrom' is not known: MODER.MODER15.MODEREnumVals
svd2ada --boolean --gen-uint-always --no-vfa-on-types --gen-uint-always -o STM32 -p STM32_SVD STM32F439x.svd
raised CONSTRAINT_ERROR : enumerate 'derivedFrom' is not known: GPIOK.MODER.MODER15.MODEREnumVals
svd2ada --boolean --gen-uint-always --no-vfa-on-types --gen-uint-always -o STM32 -p STM32_SVD STM32F439x.svd
raised CONSTRAINT_ERROR : enumerate 'derivedFrom' is not known: MODEREnumVals
an example derivedFrom attribute for the last error the is as follows
<enumeratedValues derivedFrom="MODEREnumVals">
example enumerated value
<enumeratedValues>
<name>MODEREnumVals</name>
<enumeratedValue>
<name>Input</name>
<description>Input (reset state)</description>
<value>0</value>
</enumeratedValue>
<enumeratedValue>
<name>GP_Output_Mode</name>
<description>General purpose output mode</description>
<value>1</value>
</enumeratedValue>
<enumeratedValue>
<name>Alternate_Function_Mode</name>
<description>Alternate function mode</description>
<value>2</value>
</enumeratedValue>
<enumeratedValue>
<name>Analog_Mode</name>
<description>Analog mode</description>
<value>3</value>
</enumeratedValue>
</enumeratedValues>
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure with the supplied svd2ada command and STM32F439x.svd input. Trace handling of enumeratedValues elements with derivedFrom values such as MODEREnumVals and the qualified names shown in the error. Done means these inputs no longer raise the unknown-derivedFrom constraint error and generation completes successfully.
Written by the indexing model from the issue text.
Assessment
- Domain
- embedded-iot, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100