On combining our "Teensy 4 in Rust" efforts
Hey Maciej! I've been keeping an eye on your Rust project, and I'm wondering if you'd be interested in combining our efforts into one Teensy 4 Rust project.
Around the time that you started your Teensy 4 project, I was also developing a set of Rust crates to support Teensy 4 development. I've been working on my project over here. Our projects differ in a few ways, and we may be able to benefit from one another's work. In particular,
- I really like the way you're automatically managing the SVD changes. I've made some manual changes to the MIMXRT1062 SVD file, but you've provided automation and reproducibility atop the publicly-available SVD.
- Your project supports more peripheral APIs than ours. We're still bringing-up the I2C peripheral, and we haven't even started on UART. I also appreciate your more minimal approach towards IOMUXC code generation. Basically, your approach towards the HAL > our approach towards the HAL.
We may have also solved some issues for you:
- We've worked around some of the limitations presented by the massive
MIMXRT1062
PAC. We semi-automatically create a crate per peripheral, then export the peripheral from a top-level crate. The approach lets us parallelize the build while keeping the API consistent with the normalsvd2rust
output. On my 2015 MBP, I can compile the entire PAC crate, and the entire repo, in under 1 minute, 30 seconds (release mode). (Proof of concept here.) - We have explicit separation between the iMXRT1062 HAL / runtime, and Teensy 4 BSP. This goes all the way down to the firmware configuration block (FCB), where we have a way of defining FCBs in
build.rs
scripts. It lets us separate some Teensy-specific startup components from ourcortex-m-rt
-like run-time crate. Although our project's focus is on Teensy 4 support, we also want our crates to be usable in other iMXRT106x systems. - Once the work from this PR is published to
crates.io
, we can use the public version of thecortex-m-rt-macros
crate, which let us reduce our reliance on forkedcortex-m-rt
crates. - We have support for PWM output, as well as logging over USB CDC. We're using the standard C Teensy 4 USB stack to achieve the latter.
Would you be interested in talking more about your project's goals? If you're interested, I'd love to find any opportunities to collaborate.
Thanks!