svd2ada raises "CONSTRAINT_ERROR" if `derivedFrom` is used by tag "enumerationValues"
Nobody has claimed this yet.
- Dominant language
- Ada
- Stars
- 71
- Forks
- 41
- PR merge metrics
- No merged PRs in 30d
Description
I tried to generate code from this SVD:
https://raw.githubusercontent.com/esp-rs/esp32/master/svd/esp32.svd
svd2ada also aborts if the tag which is referenced by derivedFrom is not defied before the element which makes use of derivedFrom. It's not really nice to fix this manually but it works but I got stuck because derivedFrom is also used in an enumeration - although the field the tag references is located before. svd2ada crashes:
raised CONSTRAINT_ERROR : enumerate 'derivedFrom' is not known: WDT_STG0
[.../svd2ada]
0x4d1443 descriptors__enumerate__read_enumerate at ???
0x4e3e84 descriptors__field__read_field at ???
0x4d6c6d descriptors__register__read_register at ???
0x5197d0 descriptors__peripheral__read_peripheral at ???
0x521b4f descriptors__device__read_device at ???
0x451f1b _ada_svd2ada at ???
0x450e34 main at ???
[/lib/x86_64-linux-gnu/libc.so.6]
0x7fc289c03d8e
0x7fc289c03e3e
[..../svd2ada]
0x450e8c _start at ???
0xfffffffffffffffe
Besides of -p and -o, I've not passed any further arguments to svd2ada.
I'd really be happy if there was solution to fix or work-around this problem...
I've found issue #84 but it seems different to me ...
I'm using the current master of svd2ada for the test:
commit 6eb0b591bf51af383d9ab1a3f2dbda994970ee07 (HEAD -> master, origin/master, origin/HEAD)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the crash with the linked esp32.svd input and the current svd2ada master, using only the reported -p and -o options. Trace handling of enumerationValues and derivedFrom from the reported read_enumerate path; done means the SVD generates successfully without a CONSTRAINT_ERROR when the referenced enumeration is used.
Written by the indexing model from the issue text.
Assessment
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100