-
Notifications
You must be signed in to change notification settings - Fork 9
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
base: master
Are you sure you want to change the base?
Conversation
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))) |
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 :)
Looks good! |
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).