Skip to content
This repository was archived by the owner on Aug 9, 2022. It is now read-only.

Fix bitfield prefix stripping for indexed peripherals #19

Merged
merged 2 commits into from
Feb 18, 2020

Conversation

MabezDev
Copy link
Member

@MabezDev MabezDev commented Feb 13, 2020

This also reduces the compile time, as copy's meant duplicate codegen, derive uses a single source for X peripherals.

Unfortunately, I've had to remove the interrupts for the indexed peripherals atm. Including _indexed_interrupts.yaml causes svdpatch to die:

svd patch svd/patches/esp32.yaml
Traceback (most recent call last):
  File "/home/mabez/.local/bin/svd", line 8, in <module>
    sys.exit(svdtools_cli())
  File "/home/mabez/.local/lib64/python3.6/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/mabez/.local/lib64/python3.6/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/mabez/.local/lib64/python3.6/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/mabez/.local/lib64/python3.6/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/mabez/.local/lib64/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/mabez/.local/lib64/python3.6/site-packages/svdtools/cli.py", line 16, in patch
    svdtools.patch.main(yaml_file)
  File "/home/mabez/.local/lib64/python3.6/site-packages/svdtools/patch.py", line 1004, in main
    process_device(svd, root)
  File "/home/mabez/.local/lib64/python3.6/site-packages/svdtools/patch.py", line 984, in process_device
    d.process_peripheral(periphspec, device[periphspec], update_fields)
  File "/home/mabez/.local/lib64/python3.6/site-packages/svdtools/patch.py", line 427, in process_peripheral
    raise MissingPeripheralError("Could not find {}".format(pspec))
svdtools.patch.MissingPeripheralError: Could not find UHCI0
make: *** [Makefile:11: patch] Error 1

Quite a strange error as UHCI0 and the likes are actually already in the base svd file, so I don't really understand how it's not finding it.

Closes #17

…it did in the 0.2.1 release, but interrupts for indexed peripherals have been moved into a unused yaml file
@davidkern
Copy link
Contributor

Unfortunately that was the same issue I ran into adding the interrupts. Switching them over to copy instead was the only thing I could figure out to get it to work (but then broke this instead).

I'm still hoping to fix this upstream in the idf2svd tool, but haven't had time to work on this recently.

@MabezDev
Copy link
Member Author

I think I've fixed the issue now (provided CI passes), but you're right I think this would be better if it could be derived with idf2svd. One quite nice benefit of derive is that it reduced the compile time massively.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bitfield stripping is broken on indexed peripherals
2 participants