-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SVD for s32k344 leads to uncompilable output due to many duplicated methods #263
Comments
Broken SVD leads to broken code. As expected. |
Ah OK, so the SVD needs to be edited in this case? The biggest offender is this pattern: <field>
<name>LK2</name>
<description>Lock</description>
<bitOffset>29</bitOffset>
<bitWidth>2</bitWidth>
<access>read-write</access>
<enumeratedValues>
<enumeratedValue>
<name>ENTIRE</name>
<description>Both words can be written to</description>
<value>0</value>
</enumeratedValue>
<enumeratedValue>
<name>ENTIRE</name>
<description>Both words can be written to</description>
<value>0x1</value>
</enumeratedValue>
<enumeratedValue>
<name>DXACP</name>
<description>Domain d can update only its associated DdACP field-all other fields are read-only</description>
<value>0x2</value>
</enumeratedValue>
<enumeratedValue>
<name>LOCKED</name>
<description>Locks (both words are read-only)</description>
<value>0x3</value>
</enumeratedValue>
</enumeratedValues>
</field> This is in hundreds of places in the file. :( |
In one As I understand in both examples there are ranges of values leading to same behavior. <enumeratedValues>
<enumeratedValue>
<name>ENTIRE</name>
<description>Both words can be written to</description>
<isDefault>true</isDefault>
</enumeratedValue>
<enumeratedValue>
<name>DXACP</name>
<description>Domain d can update only its associated DdACP field-all other fields are read-only</description>
<value>0x2</value>
</enumeratedValue>
<enumeratedValue>
<name>LOCKED</name>
<description>Locks (both words are read-only)</description>
<value>0x3</value>
</enumeratedValue>
</enumeratedValues> as |
Thanks for explaining. I think it's worth closing this issue, unless there is a reason to discuss a way for svd2rust to catch these cases and report warnings? |
It is better to catch this in svd parser. |
Hi!
I'm new to embedded rust, and I probably just don't understand the cli options to svd2rust and how to get working output.
An example from the SVD I'm using that leads to many duplicated functions:
Leads to code like:
This is one example of many in the generated output. Am I holding this wrong? There isn't any output from svd2rust to indicate that I might be doing something wrong.
Here is the command I'm running:
svd2rust -i S32K344_M7.svd -o src --target cortex-m -s --atomics --keep-list
The text was updated successfully, but these errors were encountered: