embassy-rs / embassy-rs/chiptool
Incompatible differences in commands
- Dominant language
- Rust
- Stars
- 65
- Forks
- 54
- PR merge metrics
- No merged PRs in 30d
Description
For [nxp-pac](https://github.com/embassy-rs/nxp-pac) we are slowly migrating to a more stm32-metapac style of generating the code from extracted data, instead of directly generating the code from the SVD. During migration I had the following issue:
The commands `generate`, `extract-all` and `extract-peripheral` work slightly different, resulting in inconsistent output.
For example, the `generate` command uses `svd2ir::convert_svd` whilst `extract_all` and `extract_peripheral` use `svd2ir::convert_peripheral`. In order to generate correct code, `svd2ir::convert_svd` [adds extra module namespaces](https://github.com/embassy-rs/chiptool/blob/e2888bf6404263689b523f92f9cc1b0632945b01/src/svd2ir.rs#L410-L411) in the form of 'regs' and 'vals' to names.
You can clearly note the PAC's generated directly and PAC's that use extraction and then manually generating code by the presence of these names in the namespaces. As an additional consequence, files with transforms for generation may not be directly usable when extracting.
Making it more consistent may require the commands to optionally fall back to their older behaviour.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.