Run an Application

An appliction image can be run on real or simulated hardware. The kernel’s built-in simulator is QEMU. It allows you to run and test an application virtually, before (or in lieu of) loading and running it on actual target hardware.

Running an Application using QEMU

Prerequisites

  • Ensure the application can be built successfully using a QEMU-supported board configuration, such as qemu_cortex_m3 or qemu_x86, as described in Build an Application.
  • Ensure the Zephyr environment variables are set for each console terminal; see Common Procedures.

Steps

  1. Open a terminal console and navigate to the application directory ~/appDir.

  2. Enter the following command to build and run the application using a QEMU-supported board configuration, such as qemu_cortex_m3 or qemu_x86.

    $ make [BOARD=<type> ...] qemu
    

    The Zephyr build system generates a zephyr.elf image file and then begins running it in the terminal console.

  3. Press Ctrl A, X to stop the application from running in QEMU.

    The application stops running and the terminal console prompt redisplays.

Loading and Running an Application on Target Hardware

The procedure required to load an application image (zephyr.elf) on a target depends on the functionality available on its hardware, and is often unique to that target board. For this reason, loading instructions reside with the board-specific documentation; see Supported Boards.