2015-10-15 12:50:38 +08:00
|
|
|
.. _apps_run:
|
|
|
|
|
|
|
|
Run an Application
|
|
|
|
##################
|
|
|
|
|
|
|
|
The kernel's built-in simulator is QEMU. It creates an environment
|
|
|
|
where you can run and test an application virtually, before (or
|
|
|
|
in lieu of) loading and running it on actual target hardware.
|
|
|
|
|
|
|
|
Procedures
|
|
|
|
**********
|
|
|
|
|
2015-10-20 02:15:41 +08:00
|
|
|
.. _run_app_qemu:
|
2015-10-15 12:50:38 +08:00
|
|
|
|
|
|
|
Running an Application using QEMU
|
|
|
|
=================================
|
|
|
|
|
|
|
|
Run your application in QEMU for testing and demonstration purposes.
|
|
|
|
|
|
|
|
Prerequisites
|
|
|
|
-------------
|
|
|
|
|
|
|
|
* You must have already generated a .elf image file for a
|
2016-02-02 12:57:23 +08:00
|
|
|
QEMU-supported board configuration, such as qemu_cortex_m3 or qemu_x86.
|
2015-10-15 12:50:38 +08:00
|
|
|
|
|
|
|
* The environment variable must be set for each console
|
|
|
|
terminal using :ref:`apps_common_procedures`.
|
|
|
|
|
|
|
|
Steps
|
|
|
|
-----
|
|
|
|
|
|
|
|
1. Open a terminal console and navigate to the application directory
|
|
|
|
:file:`~/appDir`.
|
|
|
|
|
|
|
|
2. Enter the following command to build and run an application
|
|
|
|
in QEMU:
|
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
$ make qemu
|
|
|
|
|
|
|
|
|
|
|
|
The application begins running in the terminal console.
|
|
|
|
|
|
|
|
3. Press :kbd:`Ctrl A, X` to stop the application from running
|
|
|
|
in QEMU.
|
|
|
|
|
|
|
|
The application stops running and the terminal console prompt
|
|
|
|
redisplays.
|
|
|
|
|
|
|
|
.. _loading_on_target:
|
|
|
|
|
|
|
|
Loading and Running an Application on Target Hardware
|
|
|
|
=====================================================
|
|
|
|
|
|
|
|
An application image is loaded on the target based on functionality
|
|
|
|
available on the hardware device. Loading instructions are often
|
|
|
|
unique to the particular target board. For this reason, loading
|
2015-12-18 08:12:33 +08:00
|
|
|
instructions reside with the board-specific documentation.
|
2015-10-15 12:50:38 +08:00
|
|
|
|
2015-12-18 08:12:33 +08:00
|
|
|
For more information see :ref:`board`.
|