Skip to main content

Zephyr

Notes on running Zephyr demos on emulated STM32 boards with the xPack QEMU Arm build. See also QEMU.

Linux

Install the toolchain and QEMU with xPacks:

npm install --global xpm@latest
cd my-project
xpm init
xpm install @xpack-dev-tools/arm-none-eabi-gcc@latest --verbose
xpm install @xpack-dev-tools/qemu-arm@latest --verbose

~/.local/xPacks/@xpack-dev-tools/arm-none-eabi-gcc/12.2.1-1.2.1/.content/bin/arm-none-eabi-gcc --version
~/.local/xPacks/@xpack-dev-tools/qemu-arm/7.2.0-1.1/.content/bin/qemu-system-gnuarmeclipse --version

In Eclipse, open Marketplace, search for mcu, and install Eclipse Embedded C/C++. The QEMU executable lives at:

/home/dev/.local/xPacks/@xpack-dev-tools/qemu-arm/7.2.0-1.1/.content/bin/

Results with the blinky demo (LED visible on the emulator screen):

BoardDeviceEmulator LED
STM32F4-DiscoverySTM32F407VGWorks
STM32F429I-DiscoverySTM32F429ZIDoes not work
~/.local/xPacks/@xpack-dev-tools/qemu-arm/7.2.0-1.1/.content/bin/qemu-system-gnuarmeclipse --verbose --verbose -board STM32F429I-Discovery --image test.elf --gdb tcp::1234 -d unimp,guest_errors --semihosting-config enable=on,target=native

Windows

Run from the Command Prompt. With the blinky demo, the LED does not appear on the emulator screen for NUCLEO-F103RB.

set QEMU_ARM_VER=7.2.0-1.1
echo %QEMU_ARM_VER%
set QEMU_ARM_BASE=D:\temp\zephyr\tools\xpack-qemu-arm-7.2.0-1
echo %QEMU_ARM_BASE%

"%USERPROFILE%\AppData\Roaming\xPacks\@xpack-dev-tools\qemu-arm\%QEMU_ARM_VER%\.content\bin\qemu-system-gnuarmeclipse.exe" --version

:: User scope
"%USERPROFILE%\AppData\Roaming\xPacks\@xpack-dev-tools\qemu-arm\%QEMU_ARM_VER%\.content\bin\qemu-system-gnuarmeclipse.exe" --verbose --verbose -board NUCLEO-F103RB --image build\zephyr\zephyr.elf --gdb tcp::1234 -d unimp,guest_errors --semihosting-config enable=on,target=native

:: Package scope
"%QEMU_ARM_BASE%\bin\qemu-system-gnuarmeclipse.exe" --verbose --verbose -board NUCLEO-F103RB --image build\zephyr\zephyr.elf --gdb tcp::1234 -d unimp,guest_errors --semihosting-config enable=on,target=native