Open kblomqvist opened 9 years ago
FYI, I have made several improvements to the example project since filing the issue.
Update:
The mentioned CMSIS-SVD parser is now part of the default parsers of Yasha, which is a code generator based on Jinja2 template engine.
Lately I have been working with the SCons integration of Yasha for C and came up with the custom builder. Examples can be found here, https://github.com/kblomqvist/yasha#sconstruct-scons. Shortly it's possible to generate C files (also headers) so that SCons can resolve the dependencies coming from the generated code.
However, what I have understood is that Cargo doesn't support "custom dependency builders" so it's not possible to do similar integration for Rust. Or is it?
Cargo supports custom build steps to some extent, but I don't think that regenerating all SVDs should be part of it really.
I was thinking that only the target SVD would be generated during the first build and regenerated after the clean. I'm assuming that the build system can know the target MCU.
I have been developing code generator with SVD to ioreg case in mind. I know that you already have some tooling to generate ioreg macros from SVD, but I though that you would still be interested in to see what I have made.
The example project can be found here: https://github.com/kblomqvist/nrf51.rs
nrf51.rs.jinja
is a template file for the generatednrf51.rs
nrf51.jinja-ext
contains the SVD parser and few template filters. The core of the SvdFile parser is placed incmsis.py
.The parser also supports cluster elements, which aren't addressed by the current tooling.