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

Parse SVD format register definition files #6

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

mdodkins
Copy link

Added SVD file parsing via new command "regview loadsvd".

Format is adapted during load so it can use the same view function as the eclipse xml load.

Makes this tool really useful for me, because many more MCU register definitions are available in this format. I've included STM32429 as a sample (the one I'm targeting).

RegisterView.py Outdated
r.set('fullname', fullname)
# Calculate absolute address
offset = r.find('addressOffset').text
r.set('address', hex(int(new_base_address,16) + int(offset,16)))

Choose a reason for hiding this comment

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

base = 16 before this? to avoid the magic number feel :)

Copy link
Author

Choose a reason for hiding this comment

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

👍

peripheral.insert(0, new_elements)

# No need to do anything else - complete copy has been made
return

Choose a reason for hiding this comment

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

Do you need a return here?

Copy link
Author

Choose a reason for hiding this comment

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

yes, because all the stuff that happens below is irrelevant when the peripheral is derived from another one and a deep copy of it has been made :)

@PabloMansanet
Copy link

Looks good!

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