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

Cannot copy from a peripheral that is also deleted in the same patch #30

Open
ijager opened this issue Jul 22, 2020 · 2 comments
Open

Comments

@ijager
Copy link

ijager commented Jul 22, 2020

If I try to first _copy (or _rebase) a peripheral and then delete the original it does not work. This is the simplest reproduction of this issue:

_svd: svd/stm32g070.svd

_copy:
  TIM3:
    from: TIM2

_delete:
  - TIM2

It crashes with the error

svdtools.patch.SvdPatchError: peripheral None not found

How is the order of operations defined? It seems like _delete is done before _copy. If I remove the _delete, the _copy works fine. Is there a workaround?

@duskmoon314
Copy link
Contributor

I'm facing the same issue.

It seems that the order is hardcoded in src/patch/peripheral.rs of the rust version.

Have you figured out how to workaround?

@ijager
Copy link
Author

ijager commented Mar 19, 2022

Looks like I renamed TIM2 to TIM3:

_modify:
  name: STM32G070

  # Remove TIM3 and rename TIM2 to TIM3. Because TIM3 was derive from TIM2
  TIM2:
    name: TIM3
    baseAddress: "0x40000400"

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

2 participants