Open matthewjrichey opened 2 months ago
Hi @matthewjrichey, we are happy to hear to enjoy working with defmt-test
! 😁
Support for Cortex-R sounds like a great idea and beneficial to the community. If you want to make the changes, I'd be happy to review and merge them.
Otherwise you can contract us to implement the change. If you are interested just shoot us a message at https://ferrous-systems.com/contact/.
Thanks for your reply!
I will consult with my team and see what we want to do. Stay tuned.
Our team is using defmt-test as a foundation for several unit and integration tests. Our target processor is a Cortex R core, and we build for the following architecture targets:
armv8r-none-eabihf
thumbv8r-none-eabihf
Most of our development occurred while building and testing with
armv8r-...
; we have only recently started usingthumbv8r-...
. When we made the switch to thumb, our test builds started failing with the following error:At first we wondered why the cortex-m crate was even being built for a non-CortexM target architecture (armv8r), but then we looked at the defmt-test dependencies in Cargo.toml:
Looking further into the issue, we found that switching from arm to thumb target invokes this code in the build of the cortex-m crate:
This
unwrap()
is panicking because it is looking for a.a
file that does not exist, because the crate is being built for an incompatible target architecture. With armv8r (i.e.target.starts_with("thumb")
is false), this part of the build script is never invoked and the build succeeds.Overall, we are wondering if you would consider removing this hard dependency on the cortex M crates from defmt-test. Perhaps you could put this behind a default feature flag that could be turned off when using armv8r or similar target architectures. We have had great success using defmt-test so far. That is, our test binaries build and execute successfully with the
main()
provided by defmt-test, when built for armv8r. We would like to continue using and building more tests upon the defmt-test foundation. However, we also would like to build for thumbv8r, and without forking the defmt repo there is currently no way we can think of to do this. In our minds there should be a way for us to "opt out" of the Cortex M requirement here.Thank you for your consideration.