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

Translate ATDF series and architecture into SVD fields. #32

Merged
merged 3 commits into from
Oct 11, 2022

Conversation

jeandudey
Copy link
Contributor

No description provided.

Copy link
Owner

@Rahix Rahix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for the PR. This looks like a good idea. I'll run a regression test against our devices to make sure it doesn't affect them. I would be surprised if it does, though.

src/svd/chip.rs Outdated Show resolved Hide resolved
src/svd/chip.rs Show resolved Hide resolved
src/atdf/chip.rs Outdated Show resolved Hide resolved
Copy link
Owner

@Rahix Rahix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

re-ran with your latest changeset. Now I'm generating an SVD file successfully but svdtools isn't a fan of the new version. I'm hitting this error:

Traceback (most recent call last):
...
  File ".../svdtools/cli.py", line 16, in patch
    svdtools.patch.main(yaml_file)
  File ".../svdtools/patch.py", line 1639, in main
    process_device(svd, root)
  File ".../svdtools/patch.py", line 1619, in process_device
    sort_recursive(svd.getroot())
  File ".../svdtools/patch.py", line 374, in sort_recursive
    sort_recursive(child)
  File ".../svdtools/patch.py", line 370, in sort_recursive
    sort_element(tag)
  File ".../svdtools/patch.py", line 362, in sort_element
    raise UnknownTagError((tag.tag, child.tag))
svdtools.patch.UnknownTagError: ('cpu', 'access')

and the diff between old and new is this:

--- svd-original/atmega32u4.svd	2022-09-28 19:56:16.307095959 +0200
+++ svd/atmega32u4.svd	2022-10-08 22:54:17.229940071 +0200
@@ -14,7 +14,10 @@
     <endian>little</endian>
     <mpuPresent>false</mpuPresent>
     <fpuPresent>false</fpuPresent>
-    <nvicPrioBits>4</nvicPrioBits>
+    <access>read-write</access>
+    <resetValue>0</resetValue>
+    <resetMask>0xff</resetMask>
+    <nvicPrioBits>0</nvicPrioBits>
     <vendorSystickConfig>false</vendorSystickConfig>
   </cpu>
   <peripherals>

Maybe we can just drop the access, resetValue, and resetMask from the <cpu/> tag again?

@jeandudey
Copy link
Contributor Author

Just had a stroke, they weren't there before, not sure why I added them there 🤔

@jeandudey
Copy link
Contributor Author

Just removed them on recent commits, thanks for noticing it out!

Copy link
Owner

@Rahix Rahix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, change looks good now and no regressions in my tests. Only change I'm seeing is the expected

--- src/devices-original/attiny88/mod.rs	2022-09-28 19:55:49.690093934 +0200
+++ src/devices/attiny88/mod.rs	2022-10-11 20:04:40.240616110 +0200
@@ -3,7 +3,7 @@
 use core::marker::PhantomData;
 use core::ops::Deref;
 #[doc = r"Number available in the NVIC for configuring priority"]
-pub const NVIC_PRIO_BITS: u8 = 4;
+pub const NVIC_PRIO_BITS: u8 = 0;
 #[doc(hidden)]
 pub mod interrupt;
 pub use self::interrupt::Interrupt;

but that's totally fine. Thanks again for the contribution!

@Rahix Rahix merged commit 1aa770f into Rahix:main Oct 11, 2022
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 this pull request may close these issues.

2 participants