-
Notifications
You must be signed in to change notification settings - Fork 152
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
Build Errors in Code Generated from Renesas RA6M3 SVD #852
Comments
It looks like 2 main issues here: 1st was introduced in #692. Looks like:
There should be <register derivedFrom="P100PFS">
<dim>10</dim>
<dimIncrement>0x4</dimIncrement>
<dimIndex>0-9</dimIndex>
<name>P40%sPFS</name>
<description>P40%s Pin Function Control Register</description>
<addressOffset>0x100</addressOffset>
<size>32</size>
<access>read-write</access>
<resetValue>0x00000000</resetValue>
<resetMask>0xFFFFFFFD</resetMask>
</register> 2nd is related to special case not covered in #767. <field>
<name>GAIN01</name>
<description>Gain value of area 1Unsigned 11-bit fixed point</description>
<lsb>0</lsb>
<msb>10</msb>
<access>read-write</access>
<enumeratedValues>
<enumeratedValue>
<name>GAIN01</name>
<description>GAIN01/1024</description>
<isDefault>true</isDefault>
</enumeratedValue>
</enumeratedValues>
</field> |
cc @n8tlarsen |
as per ra-rs/ra#6 n8tlarsen isn't active with ra-rs any more. |
A debug build of svd2rust panics on this input with
Changing the row in question (row 553 of peripheral.rs) into:
generates rows like this in the RegisterBlock of pfs.rs
The 0x9999 sizes comes directly after a explicitly named array with a truncated type name. This looks like a feature of register arrays, defined with dim attributes, but only when the first dimIndex is 0. This is the same feature that causes the second compile Error E0592 above by generating multiple functions with same names. A simple way to disable this feature is to force
After that the panic, the explicitly named arrays with a truncated type names, and the conflicting functions are all gone. But, there is another issue with arrays defined with dim attributes. They all have the same offset, and not only when the first dimIndex is 0.
In the last else clause of the Error E0412 is about the truncated type names. They are not imported. This can be done by removing the name change in the There is a similar rename in the Keeping the rename in the
gives long type names that are also correctly imported. The first Error E0592 above, about the duplication of I can finally compile the files generated by svd2rust, but will probably go for the vendor C HAL instead for now. |
Hello, I am seeing many errors when attempting to build a PAC from a Renesas RA6M3 SVD file. I've already fixed some errors that I found in the Renesas provided file. I've attached the modified file below.
R7FA6M3AH.svd.txt
Here is a sample of the errors that I'm seeing:
Error E0412
Error E0592
Error E0599
Here is the full log:
cargo_check.txt
I've tested this SVD file with several versions of svd2rust. I found that version 0.30.x works without error, but I begin to have trouble starting with version 0.31.x and up. These error logs are from the latest tagged version, v 0.33.4.
Here is my PAC that I'm working on:
ra6m3-pac.zip
Please let me know if I can offer up any more detail or assist with debugging. Thanks.
The text was updated successfully, but these errors were encountered: