Facing error while running qemu-system-arm target

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)

Will appreciate the help. Let me know if you need more details.

If you type qemu-system-arm in the command line, does it find qemu ?

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

  • qemu-system-arm
  •   + CategoryInfo          : ObjectNotFound: (qemu-system-arm:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException

Quoting the link you provided, QEMU - The Embedded Rust Book

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.

Also in cmd it displays this error pop up.

Here's the thing:

  1. 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.

  2. 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.

Appreciate the help! Thanks! :+1:

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.