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

Consideration: use an existing svd lib instead of rolling your own. #51

Open
hanetzer opened this issue Sep 9, 2022 · 6 comments
Open
Assignees

Comments

@hanetzer
Copy link
Contributor

hanetzer commented Sep 9, 2022

https://github.com/posborne/cmsis-svd
For the sake of deduplicating work. Plus they ship quite a lot of SVDs you can use out of the box.

@bnahill
Copy link
Owner

bnahill commented Sep 11, 2022

That might have been a good idea had this not predated Paul's work by a few years. I support the idea of switching the parser over to something more robust but don't have the time for such an undertaking. I haven't been doing enough microcontroller debugging the last few years to motivate the jump, but am happy to keep this issue open to keep it from falling off the stack altogether.

@hanetzer
Copy link
Contributor Author

ah, a very valid point. I wasn't aware of the timeline involved between the two projects, so sorry if it sounded
presumptuous. Maybe I'll look into it myself.

@bnahill
Copy link
Owner

bnahill commented Oct 9, 2022

Alright I've started working on this! Paul's library is good, though I don't want to require some 5GB of XML. I'm also working on Python2-friendly type annotations for cmsis-svd to make it usable which I'll try to push back. Hopefully I can wrap this up before getting too busy with something else.

There are bugs in the parser I made and honestly I don't use this enough to fix them, and that's a disservice to everyone using this and finding their specific case isn't well-supported.

@bnahill bnahill self-assigned this Oct 9, 2022
@tannewt
Copy link
Contributor

tannewt commented Nov 11, 2022

Instead of shipping the xml with the package we could use https://github.com/pyocd/cmsis-pack-manager. It is used by pyocd to manage packs including svd files.

@markrages
Copy link

I found the cmsis-svd parser was insufficient for what I needed to implement in https://github.com/markrages/svd_gdb.

I am not proposing my parser as objectively better, but it is more closely aligned to PyCortexMDebug's use case.

Seems like a lot of duplicated effort all round!

@bnahill
Copy link
Owner

bnahill commented Jan 9, 2023

@markrages for sure! We all had our own needs. Someday I'll

I think the cmsis-svd library is sufficient here and there is a cmsis-svd branch which I believe is complete but not yet thoroughly tested because I don't have time for microcontroller things these days. Out of curiosity what is cmsis-svd missing? Maybe there are some details I'm unaware of...

https://github.com/bnahill/PyCortexMDebug/tree/switch-to-cmsis_svd

So far I've tested just playing around with the IO stubbed out to just print the accesses being made and it seems to work as expected, I think dealing with most of the quirks of SVD. I'm not sure if I changed the usage at all when neatening things but it's certainly a lot cleaner than it used to be. I'd appreciate any testing but understand most aren't in the business to test janky code out on the internet. I have a few microcontroller projects in the queue so maybe it'll get some attention again soon.

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

No branches or pull requests

4 participants