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

ATxmega128A1 support #28

Open
bidinzky opened this issue Jul 24, 2020 · 9 comments
Open

ATxmega128A1 support #28

bidinzky opened this issue Jul 24, 2020 · 9 comments
Labels
help wanted Extra attention is needed mcu-support Support for a new microcontroller

Comments

@bidinzky
Copy link

Hello,

I tried to add support for the ATxmega128A1, but the ATxmega128A1.atdf I get errors while I execute make.
e.g. size not found on <register-group name="CH0" name-in-module="DMA_CH"...
Am I missing something?

@Rahix
Copy link
Owner

Rahix commented Jul 25, 2020

Can you paste the full error log please?

@Rahix
Copy link
Owner

Rahix commented Jul 25, 2020

Okay, from a quick glance it looks like this chip will need a few changed in atdf2svd ... There's some differences in the XML compared to the other files we've been working with so far.

@bidinzky
Copy link
Author

Can you paste the full error log please?

This is the first error when i try with the shipped Atxmega128A1.atdf.
SVD2RUST ATxmega128A1 thread 'main' panicked at 'called Result::unwrap()on anErrvalue: Malformed XML. 1:1 Unexpected end of stream: no root element found', C:\Users\binde\.cargo\registry\src\github.com-1ecc6299db9ec823\svd2rust-0.17.0\src/main.rs:96:34 note: run withRUST_BACKTRACE=1environment variable to display a backtrace make: *** [Makefile:35: src/devices/ATxmega128A1/mod.full.rs] Error 101

If i format the XML i get the Error:
ATDF2SVD ATxmega128A1 Error: Missing attribute "caption" on <instance name="GPIO" ...> make: *** [Makefile:19: svd/ATxmega128A1.bare.svd] Error 1

@Rahix
Copy link
Owner

Rahix commented Jul 25, 2020

The missing "caption" error should be easy to fix. The size not found ones are a bit more difficult. It looks like the structure in your ATDF file is different from what I've seen so far; the current code does not know how to handle that correctly. If I understood the file correctly, the peripheral 'modules' are split into multiple XML elements which we somehow need to recombine in atdf2svd. We'll have to take a closer look what exactly needs to be done ...

@bidinzky
Copy link
Author

Îs there any kind of definition for the atdf and what is needed for svd? If so i can maybe try add it myself.

@Rahix
Copy link
Owner

Rahix commented Jul 25, 2020

Not that I know of :/ We worked backwards from the files and guessed how things are supposed to fit together.

If you want to take a stab at adding support for your file to atdf2svd, I would suggest cross-referencing the code with a working file (e.g. ATmega32U4) and then see where the differences are in your file. The goal is to fill the structs in chip.rs with values from the atdf file.

I would suggest we open a tracking issue in atdf2svd and I'll also take a look and post there if I have ideas.

@Rahix
Copy link
Owner

Rahix commented Jul 25, 2020

I think I found (at least one) culprit: Rahix/atdf2svd#4

@Rahix
Copy link
Owner

Rahix commented Jul 25, 2020

I've pushed some commits to atfd2svd which should now at least allow building something. But most of that is workarounds which means that the generated SVD files is missing some register definitions and, for your case, also doesn't contain interrupt definitions.

@bidinzky
Copy link
Author

Not that I know of :/ We worked backwards from the files and guessed how things are supposed to fit together.

If you want to take a stab at adding support for your file to atdf2svd, I would suggest cross-referencing the code with a working file (e.g. ATmega32U4) and then see where the differences are in your file. The goal is to fill the structs in chip.rs with values from the atdf file.

I would suggest we open a tracking issue in atdf2svd and I'll also take a look and post there if I have ideas.

I will look into it when i have some spare time maybe i can help.
But i guess the progress should be tracked on atdf2svd via Rahix/atdf2svd#4.

@Rahix Rahix added mcu-support Support for a new microcontroller help wanted Extra attention is needed labels Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed mcu-support Support for a new microcontroller
Projects
None yet
Development

No branches or pull requests

2 participants