Skip to content
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

Does not handle attiny412 TCA0 possibly due to split mode #30

Closed
APan55555 opened this issue Aug 17, 2022 · 4 comments · Fixed by #48
Closed

Does not handle attiny412 TCA0 possibly due to split mode #30

APan55555 opened this issue Aug 17, 2022 · 4 comments · Fixed by #48

Comments

@APan55555
Copy link

When I run atdf2svd for the attiny412, the following warnings appear:

Warning: Unhandled register node: "<register-group name-in-module=\"TCA_SINGLE\" offset=\"0\" name=\"SINGLE\" union-tag-value=\"0\" ...>"
Warning: Unhandled register node: "<register-group union-tag-value=\"1\" name-in-module=\"TCA_SPLIT\" name=\"SPLIT\" offset=\"0\" ...>"
Warning: Merging interrupt TCA0_LUNF and TCA0_OVF to TCA0_LUNF_OVF
Warning: Merging interrupt TCA0_LCMP0 and TCA0_CMP0 to TCA0_LCMP0_CMP0
Warning: Merging interrupt TCA0_CMP1 and TCA0_LCMP1 to TCA0_CMP1_LCMP1
Warning: Merging interrupt TCA0_CMP2 and TCA0_LCMP2 to TCA0_CMP2_LCMP2
Warning: No registers found for peripheral "TCA0"

These are omitting the ones regarding no field description. The svd file generated doesn't have the TCA0 peripheral as a result.

I suspect this is due to the split mode of the peripheral resulting in register blocks that overlap in the atdf (one for the single mode and one for the split mode) that the program doesn't know how to handle.

Adding support for this would be great!

@Rahix
Copy link
Owner

Rahix commented Aug 17, 2022

I think this was also discussed a bit in #4 already. The problem is that there isn't really a way to represent this well in SVD...

@APan55555
Copy link
Author

Ok thanks! Are there any recommended resources to see how to add code for the peripheral after running svd2rust?

@Rahix
Copy link
Owner

Rahix commented Aug 22, 2022

Are there any recommended resources to see how to add code for the peripheral after running svd2rust?

We don't do that, everything has to be emitted by svd2rust correctly... Otherwise, maintaining the PACs would be a nightmare.

So the correct course of action is:

  1. Find out how the peripheral should be presented in SVD
  2. Ensure we're not totally violating the spec with that
  3. Talk to svd2rust upstream to see what they think about the issue
  4. Implement support in svd2rust and atdf2svd

@Rahix
Copy link
Owner

Rahix commented Aug 24, 2022

As a pointer, there is an alternateRegister in the SVD standard: https://www.keil.com/pack/doc/CMSIS/SVD/html/elem_registers.html Maybe this is what we need here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants