Update QEMU machine configs and README
cover Update QEMU machine configs and README
From: Charles Dias <[email protected]>
This series updates QEMU machine configurations and improves the README documentation.
Patches 1-2 clean up the QEMU machine configs: removing the nios2 machine (dropped in Zephyr 4.2) and dropping -nographic from QB_GRAPHICS (it should be controlled by runqemu, not the machine config).
Patch 3 adds missing QEMU and Zephyr board settings for the mps2/mps3 machines (ZEPHYR_BOARD, QB_RNG, QB_MEM).
Patch 4 fixes the qemu-cortex-a9 DEFAULTTUNE to use hard-float with NEON as expected by Zephyr.
Patch 5 updates the README with consistent runqemu nographic usage and adds a section on listing supported machines.
Charles Dias (5):
zephyr-bsp: drop nios2 machine fragments (unsupported in Zephyr 4.2)
machine: remove -nographic from QB_GRAPHICS
machine: mps2/mps3: add missing QEMU and Zephyr board settings
qemu-cortex-a9: fix DEFAULTTUNE to cortexa9hf-neon
README: improve runqemu examples and add supported machines section
README.md | 26 ++++++++++++++----- meta-zephyr-bsp/conf/machine/mps2-an385.conf | 5 +++- meta-zephyr-bsp/conf/machine/mps2-an521.conf | 4 ++- meta-zephyr-bsp/conf/machine/mps3-an547.conf | 5 +++- .../conf/machine/qemu-cortex-a53.conf | 2 +- .../conf/machine/qemu-cortex-a9.conf | 4 +-- .../conf/machine/qemu-cortex-m0.conf | 2 +- .../conf/machine/qemu-cortex-m3.conf | 2 +- .../conf/machine/qemu-cortex-r5.conf | 2 +- meta-zephyr-bsp/conf/machine/qemu-nios2.conf | 17 ------------ .../conf/machine/v2m-musca-b1.conf | 2 +- .../conf/machine/v2m-musca-s1.conf | 2 +- 12 files changed, 38 insertions(+), 35 deletions(-) delete mode 100644 meta-zephyr-bsp/conf/machine/qemu-nios2.conf
PATCH 1/5 zephyr-bsp: drop nios2 machine fragments (unsupported in Zephyr 4.2)
From: Charles Dias <[email protected]>
Zephyr 4.2 removed Nios II support, so building Zephyr targets for nios2 no longer works.
--- meta-zephyr-bsp/conf/machine/qemu-nios2.conf | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 meta-zephyr-bsp/conf/machine/qemu-nios2.conf
meta-zephyr-bsp/conf/machine/qemu-nios2.conf deleted +0 -17
@@ -1,17 +0,0 @@ -#@TYPE: Machine -#@NAME: qemu-nios2 -#@DESCRIPTION: Machine for Zephyr BOARD qemu_nios2 - -require conf/machine/include/qemu.inc -require conf/machine/include/tune-nios2.inc - -ZEPHYR_INHERIT_CLASSES += "zephyr-qemuboot" - -# For runqemu -QB_SYSTEM_NAME = "qemu-system-nios2" -QB_MACHINE = "-machine altera_10m50_zephyr" -QB_OPT_APPEND = "-nographic" -QB_CPU = "-cpu nios2" - - -TCLIBC = "glibc"
PATCH 2/5 machine: remove -nographic from QB_GRAPHICS
In reply to [email protected]From: Charles Dias <[email protected]>
-nographic is not a graphics setting. Drop it from QB_GRAPHICS and let users request headless mode via runqemu nographic when needed.
--- meta-zephyr-bsp/conf/machine/mps2-an385.conf | 2 +- meta-zephyr-bsp/conf/machine/mps2-an521.conf | 2 +- meta-zephyr-bsp/conf/machine/mps3-an547.conf | 2 +- meta-zephyr-bsp/conf/machine/qemu-cortex-a53.conf | 2 +- meta-zephyr-bsp/conf/machine/qemu-cortex-a9.conf | 2 +- meta-zephyr-bsp/conf/machine/qemu-cortex-m0.conf | 2 +- meta-zephyr-bsp/conf/machine/qemu-cortex-m3.conf | 2 +- meta-zephyr-bsp/conf/machine/qemu-cortex-r5.conf | 2 +- meta-zephyr-bsp/conf/machine/v2m-musca-b1.conf | 2 +- meta-zephyr-bsp/conf/machine/v2m-musca-s1.conf | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-)
meta-zephyr-bsp/conf/machine/mps2-an385.conf +1 -1
@@ -11,7 +11,7 @@ TCLIBC = "newlib" QB_SYSTEM_NAME = "qemu-system-arm" QB_MACHINE = "-machine mps2-an385" QB_CPU = "-cpu cortex-m3" -QB_GRAPHICS = "-nographic -vga none" +QB_GRAPHICS = "-vga none" QB_OPT_APPEND = "-icount shift=7,align=off,sleep=off -rtc clock=vm" # Zephyr RTOS settings
meta-zephyr-bsp/conf/machine/mps2-an521.conf +1 -1
@@ -13,7 +13,7 @@ QB_SYSTEM_NAME = "qemu-system-arm" QB_MACHINE = "-machine mps2-an521" QB_CPU = "-cpu cortex-m33" QB_MEM = "-m 16" -QB_GRAPHICS = "-nographic -vga none" +QB_GRAPHICS = "-vga none" QB_OPT_APPEND = "-icount shift=7,align=off,sleep=off -rtc clock=vm" # Zephyr RTOS settings
meta-zephyr-bsp/conf/machine/mps3-an547.conf +1 -1
@@ -12,7 +12,7 @@ TCLIBC = "newlib" QB_SYSTEM_NAME = "qemu-system-arm" QB_MACHINE = "-machine mps3-an547" QB_CPU = "-cpu cortex-m55" -QB_GRAPHICS = "-nographic -vga none" +QB_GRAPHICS = "-vga none" QB_OPT_APPEND = "-icount shift=7,align=off,sleep=off -rtc clock=vm" # Zephyr RTOS settings
meta-zephyr-bsp/conf/machine/qemu-cortex-a53.conf +1 -1
@@ -11,7 +11,7 @@ TCLIBC = "newlib" QB_SYSTEM_NAME = "qemu-system-aarch64" QB_MACHINE = "-machine virt,secure=on,gic-version=3" QB_CPU = "-cpu cortex-a53" -QB_GRAPHICS = "-nographic -vga none" +QB_GRAPHICS = "-vga none" QB_OPT_APPEND = "-icount shift=4,align=off,sleep=on -rtc clock=vm" # Zephyr RTOS settings
meta-zephyr-bsp/conf/machine/qemu-cortex-a9.conf +1 -1
@@ -12,7 +12,7 @@ TCLIBC = "newlib" QB_SYSTEM_NAME = "qemu-system-arm" QB_MACHINE = "-machine xilinx-zynq-a9" QB_CPU = "-cpu cortex-a9" -QB_GRAPHICS = "-nographic -vga none" +QB_GRAPHICS = "-vga none" QB_OPT_APPEND = "-icount shift=3,align=off,sleep=off -rtc clock=vm" QB_RNG = ""
meta-zephyr-bsp/conf/machine/qemu-cortex-m0.conf +1 -1
@@ -14,7 +14,7 @@ TCLIBC = "newlib" QB_SYSTEM_NAME = "qemu-system-arm" QB_MACHINE = "-machine microbit" QB_CPU = "-cpu cortex-m0" -QB_GRAPHICS = "-nographic -vga none" +QB_GRAPHICS = "-vga none" QB_RNG = "" QB_OPT_APPEND = "-icount shift=6,align=off,sleep=off -rtc clock=vm"
meta-zephyr-bsp/conf/machine/qemu-cortex-m3.conf +1 -1
@@ -10,7 +10,7 @@ ZEPHYR_INHERIT_CLASSES += "zephyr-qemuboot" # For runqemu QB_SYSTEM_NAME = "qemu-system-arm" QB_MACHINE = "-machine lm3s6965evb" -QB_GRAPHICS = "-nographic -vga none" +QB_GRAPHICS = "-vga none" QB_CPU = "-cpu cortex-m3" QB_RNG = "" QB_OPT_APPEND = "-icount shift=6,align=off,sleep=off -rtc clock=vm"
meta-zephyr-bsp/conf/machine/qemu-cortex-r5.conf +1 -1
@@ -13,7 +13,7 @@ QB_SYSTEM_NAME = "qemu-system-aarch64" QB_MACHINE = "-machine xlnx-zcu102" QB_CPU = "-cpu cortex-r5" QB_MEM = "-m 64k" -QB_GRAPHICS = "-nographic -vga none" +QB_GRAPHICS = "-vga none" QB_RNG = "" # Zephyr RTOS settings
meta-zephyr-bsp/conf/machine/v2m-musca-b1.conf +1 -1
@@ -16,7 +16,7 @@ IMAGE_CLASSES += "qemuboot" QB_SYSTEM_NAME = "qemu-system-arm" QB_MACHINE = "-machine musca-b1" QB_CPU = "-cpu cortex-m33" -QB_GRAPHICS = "-nographic -vga none" +QB_GRAPHICS = "-vga none" QB_MEM = "512k" # Zephyr RTOS settings
meta-zephyr-bsp/conf/machine/v2m-musca-s1.conf +1 -1
@@ -15,7 +15,7 @@ IMAGE_CLASSES += "qemuboot" QB_SYSTEM_NAME = "qemu-system-arm" QB_MACHINE = "-machine musca-s1" QB_CPU = "-cpu cortex-m33" -QB_GRAPHICS = "-nographic -vga none" +QB_GRAPHICS = "-vga none" QB_MEM = "512k" # Zephyr RTOS settings
PATCH 3/5 machine: mps2/mps3: add missing QEMU and Zephyr board settings
In reply to [email protected]From: Charles Dias <[email protected]>
Update MPS2 and MPS3 machine configurations:
- Add ZEPHYR_BOARD with the current Zephyr board identifiers (mps2/an385, mps2/an521/cpu0, mps3/corstone300/an547).
- Add QB_RNG = "" to disable virtio-rng, which is unsupported on these machines.
- Add QB_MEM to explicitly set memory (16 MB for mps2-an385, 2048 MB for mps3-an547; mps2-an521 already had it).
--- meta-zephyr-bsp/conf/machine/mps2-an385.conf | 3 +++ meta-zephyr-bsp/conf/machine/mps2-an521.conf | 2 ++ meta-zephyr-bsp/conf/machine/mps3-an547.conf | 3 +++ 3 files changed, 8 insertions(+)
meta-zephyr-bsp/conf/machine/mps2-an385.conf +3 -0
@@ -11,8 +11,11 @@ TCLIBC = "newlib" QB_SYSTEM_NAME = "qemu-system-arm" QB_MACHINE = "-machine mps2-an385" QB_CPU = "-cpu cortex-m3" +QB_MEM = "-m 16" QB_GRAPHICS = "-vga none" QB_OPT_APPEND = "-icount shift=7,align=off,sleep=off -rtc clock=vm" +QB_RNG = "" # Zephyr RTOS settings +ZEPHYR_BOARD = "mps2/an385" ZEPHYR_INHERIT_CLASSES += "zephyr-qemuboot"
meta-zephyr-bsp/conf/machine/mps2-an521.conf +2 -0
@@ -15,6 +15,8 @@ QB_CPU = "-cpu cortex-m33" QB_MEM = "-m 16" QB_GRAPHICS = "-vga none" QB_OPT_APPEND = "-icount shift=7,align=off,sleep=off -rtc clock=vm" +QB_RNG = "" # Zephyr RTOS settings +ZEPHYR_BOARD = "mps2/an521/cpu0" ZEPHYR_INHERIT_CLASSES += "zephyr-qemuboot"
meta-zephyr-bsp/conf/machine/mps3-an547.conf +3 -0
@@ -12,8 +12,11 @@ TCLIBC = "newlib" QB_SYSTEM_NAME = "qemu-system-arm" QB_MACHINE = "-machine mps3-an547" QB_CPU = "-cpu cortex-m55" +QB_MEM = "-m 2048" QB_GRAPHICS = "-vga none" QB_OPT_APPEND = "-icount shift=7,align=off,sleep=off -rtc clock=vm" +QB_RNG = "" # Zephyr RTOS settings +ZEPHYR_BOARD = "mps3/corstone300/an547" ZEPHYR_INHERIT_CLASSES += "zephyr-qemuboot"
PATCH 4/5 qemu-cortex-a9: fix DEFAULTTUNE to cortexa9hf-neon
In reply to [email protected]From: Charles Dias <[email protected]>
Change DEFAULTTUNE from "cortexa9" to "cortexa9hf-neon" so the toolchain uses hard-float with NEON, matching what Zephyr expects for the qemu_cortex_a9 target.
--- meta-zephyr-bsp/conf/machine/qemu-cortex-a9.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta-zephyr-bsp/conf/machine/qemu-cortex-a9.conf +1 -1
@@ -2,7 +2,7 @@ #@NAME: qemu-cortex-a9 #@DESCRIPTION: Machine for Zephyr BOARD qemu_cortex_a9 -DEFAULTTUNE ?= "cortexa9" +DEFAULTTUNE ?= "cortexa9hf-neon" require conf/machine/include/qemu.inc require conf/machine/include/arm/armv7a/tune-cortexa9.inc
PATCH 5/5 README: improve runqemu examples and add supported machines section
In reply to [email protected]From: Charles Dias <[email protected]>
Add QEMU run instructions to Quick Build, use "nographic" consistently in all runqemu examples, and add a section listing supported machines.
--- README.md | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-)
README.md +19 -7
@@ -64,6 +64,14 @@ build the Zephyr "helloworld" sample: bitbake zephyr-helloworld ``` +Then, you can run the created "helloworld" image in QEMU: + +```console +runqemu nographic +``` + +To exit QEMU when running in nographic mode, press `Ctrl+A x`. + ### Building and Running other Zephyr Samples You can build other Zephyr samples. There are several sample recipes
@@ -76,21 +84,18 @@ For example, to build the bitbake zephyr-philosophers ``` -You can then run the created "philosophers" image in qemu: +You can then run the created "philosophers" image in QEMU. ```console -runqemu +runqemu nographic ``` -For a terminal-only console, pass `nographic` on the runqemu command line, for example -`runqemu nographic`. - The same sample can be built for other machines/boards, for example ARM Cortex-M3: ```console bitbake-config-build enable-fragment machine/qemu-cortex-m3 bitbake zephyr-philosophers -runqemu +runqemu nographic ``` Alternatively, you can use the MACHINE variable to define the target machine,
@@ -99,7 +104,7 @@ you will need to disable the machine fragment to prevent conflict: ```console bitbake-config-build disable-fragment machine/qemu-x86 MACHINE=qemu-cortex-m3 bitbake zephyr-philosophers -runqemu qemu-cortex-m3 +runqemu qemu-cortex-m3 nographic ``` The default configuration (with `zephyr` DISTRO) uses the Yocto Project toolchain
@@ -113,6 +118,13 @@ ZEPHYR_TOOLCHAIN_VARIANT = "zephyr" Other Tips and Tricks for building zephyr image can be found [here](https://wiki.yoctoproject.org/wiki/TipsAndTricks/BuildingZephyrImages). +### Supported Zephyr Machines + +To see the list of supported Zephyr machines, type the following command: + +``` +bitbake-layers show-machines | grep zephyr +``` ### Flashing