-
Notifications
You must be signed in to change notification settings - Fork 156
Correctly handle case where register.name
has "[%s]" and no dimIndex
#177
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
Conversation
Fantastic, that was a big problem for me with the ATSAMD20 SVD files. Will check it out later... |
NOTE: Requires rust-embedded/svd2rust#177 for svd2rust to build properly
Thanks, @jamesmunns @homunkulus r+ Some builds will likely timeout but I'll test the problematic test suites locally. |
📌 Commit d0a2259 has been approved by |
Correctly handle case where `register.name` has "[%s]" and no `dimIndex`
Hm, weird:
Where ATSAMD21E15A.svd is from https://github.com/posborne/cmsis-svd.git and svd2rust at commit 5eaf83f from the auto branch. |
@therealprof thats actually (sadly) expected. My patch only covers registers that look like I don't know the correct way to handle If you want to test it, you can try hacking up this line to be more general: 5eaf83f#diff-6755e3579c3e8158c7d672a1ddebb24dR569 |
@therealprof here is a link to the documentation I referenced: http://www.keil.com/pack/doc/CMSIS/SVD/html/elem_registers.html |
💔 Test failed - status-travis |
@therealprof
That reads to me like You could probably use the new code path I added (but maybe add a STDERR warning like "using non-standard dim_index"?), but you would need to confirm it generates what you want it to generate. |
@japaric Not sure what that failure was. Something about a missing |
@jamesmunns Yeah, don't know. I modified it and checked the result but it doesn't look quite right. That's fine. The Atmel guys are full of crap anyway, not only generating one SVD file per footprint but also per Flash/RAM configuration and don't even manage to get their own spelling and register names consistent within those and the SVD files for sibling MCUs. Apart from that horror show their clocking system and peripherals are really disgusting so I'm happy to take this as an excuse not to waste any more time with those MCUs. 😉 |
@homunkulus r+ |
📌 Commit 550982e has been approved by |
Correctly handle case where `register.name` has "[%s]" and no `dimIndex`
@therealprof Aw, thats sad to hear. I don't have any experience with the Atmel Cortex-Ms, but had generally heard good things. Hopefully they only suck at making SVDs :) |
@jamesmunns Can't say what's worse, their peripheral implementation or their documentation. Probably correlated... Everything is asynchronous in their implementation (so you're doing busy waits all the time and everywhere) and you have mind boggling numbers of clocks to configure to make even the most simple things work and if you miss any important (and most likely undocumented or wrongly documented) step or bit in a register you're just busy waiting forever and have no idea why... and who needs sample code anyway?!? Those ATSAM are pretty much the exact opposite of the perfectly documented and easy to use ATTiny/Mega chips. No way in hell I'm ever going near them again if I don't absolutely have to. |
The ARM version of the SVD spec includes the wording:
Which reads to me that the it defaults to sequential numbering whether it uses |
@kevinmehall I just tested, and your branch produces the same output (for me) as mine does. Yours appears to be better implemented than mine, I'm okay with @japaric closing this PR and merging yours instead. Thanks for chiming in! I hadn't seen your previous PR. |
💔 Test failed - status-travis |
Closing in favor of #168 |
No description provided.