Hey,
I am new to embedded programming and just started learning embedded rust. I am using windows system to build and run the example from rust book with qemu QEMU - The Embedded Rust Book (rust-embedded.org)
I am pretty sure I have installed QEMU. But facing error with this command.
PS C:\Workspace\RustRepowc\rust_projects\cortex-m-quickstart-master> qemu-system-arm
qemu-system-arm : The term 'qemu-system-arm' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify
that the path is correct and try again.
At line:1 char:1
This program uses something called semihosting to print text to the host console. When using real hardware this requires a debug session but when using QEMU this Just Works.
Let's start by compiling the example:
cargo build --example hello
The output binary will be located at target/thumbv7m-none-eabi/debug/examples/hello.
To run this binary on QEMU run the following command:
qemu-system-arm \
-cpu cortex-m3 \
-machine lm3s6965evb \
-nographic \
-semihosting-config enable=on,target=native \
-kernel target/thumbv7m-none-eabi/debug/examples/hello
Hello, world!
The command should successfully exit (exit code = 0) after printing the text. On *nix you can check that with the following command:
I would start by figuring out if you can run it manually, and after getting that to work, figuring out how to get it to run from cargo.
Added C:\Program Files\qemu to system path variable. qemu-system-arm don't show anything now but cargo run returns exit code: 0xc0000135, STATUS_DLL_NOT_FOUND.
If you can't run it manually on the commandline with qemu-system-arm, there is no reason to expect that "cargo run" will magically make it work.
I don't use windows, so unfortunately I can't help you any further. I would recommend playing with qemu on windows on the commandline until you get that working first.