Testing a no_std crate with QEMU and cortex-m/.../minitest? #479
Replies: 2 comments 1 reply
-
QEMU is pretty much the only way. The need for a separate project comes from QEMU often not having the same target as you are developing for, however QEMU is quite capable, and if you have the time you can write code to add your target into QEMU, then you only need one build target that runs on both physical hardware and QEMU. There are other options such as simulating the verilog in something like verilator (or VCS, but it costs lots of money and is around 24x slower in my experience), but that only works if you have the source which often isn't available unless you're working on open source chips or an in-house SoC. I've also explored the ARM FPV (or was it FVP?) model in the past, but it isn't really an option because it is poorly documented, and closed source. The only practical way to use it is if you're paying ARM for support, and at that point you probably have simulation options available. There are also some smaller QEMU-like projects floating around that might work, but I don't have much experience with them. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the info. I guess I'm content to use QEMU. I do have QEMU working with https://github.com/rust-embedded/cortex-m/tree/master/testsuite/minitest. The downside to |
Beta Was this translation helpful? Give feedback.
-
What's the best way to locally test that no_std crate will really work on an embedded processor?
This GitHub project gives a sample of what I want. The sample is run by a GitHub action called on-target.yml and job called hil-qemu. It calls subproject testsuite which uses sub-sub-projects minitest and macros.
I've gotten the steps to work locally on Ubuntu and Windows.
The downside to this solution is that it seems to require one to create (at least) three additional (sub)projects.
Is there a better way? (I see crate defmt-test, but can't figure out how to run it with QEMU.)
Beta Was this translation helpful? Give feedback.
All reactions