Skip to content

Conversation

@ritesh006
Copy link
Contributor

This PR introduces a Python-based QEMU runner (scripts/west_commands/runners/qemu.py)
as part of the effort to deprecate the legacy cmake/emu/qemu.cmake.

Key points:

  • Implements a ZephyrBinaryRunner subclass for QEMU
  • Supports --qemu-binary, --qemu-arg, and serial backends (stdio, fifo, pty)
  • Provides RunnerCaps(run=True) for consistent west run integration
  • Cleans up temporary FIFOs safely after execution
  • Adds a deprecation shim in cmake/emu/qemu.cmake

Tested on:

  • qemu_x86 board running samples/hello_world (successful boot and output)
  • Zephyr SDK 0.16.x with QEMU 8.2.2

This addresses part of zephyrproject-rtos/zephyr#5501
and sets the foundation for full migration from CMake to Python-based QEMU runner.

@pdgendt
Copy link
Contributor

pdgendt commented Nov 12, 2025

Please fix compliance and CI issues, also since you considerately modified the file, remove it from the ruff excludes file and format it using ruff.

"./scripts/west_commands/runners/qemu.py",

@ritesh006
Copy link
Contributor Author

Please fix compliance and CI issues, also since you considerately modified the file, remove it from the ruff excludes file and format it using ruff.

"./scripts/west_commands/runners/qemu.py",

please take a look

- Add scripts/west_commands/runners/qemu.py: starter
  ZephyrBinaryRunner for QEMU.
- Add cmake/emu/qemu.cmake shim that warns about deprecation.
- Add short note doc/contrib/qemu_runner_note.rst.

Fixes: zephyrproject-rtos#5501

Signed-off-by: Ritesh Kudkelwar <ritesh.kumar0793@gmail.com>
@ritesh006 ritesh006 force-pushed the feat/qemu-runner-starter branch from d4d7316 to a8e0305 Compare November 16, 2025 13:42
@sonarqubecloud
Copy link

list(APPEND QEMU_FLAGS
-icount shift=${CONFIG_QEMU_ICOUNT_SHIFT},align=off,sleep=on
-rtc clock=vm)
-icount shift=${CONFIG_QEMU_ICOUNT_SHIFT},align=off,sleep=on
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these changes are not valid with this alignment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants