1.. _qemu_cortex_m0:
2
3ARM Cortex-M0 Emulation (QEMU)
4##############################
5
6Overview
7********
8
9This board configuration will use QEMU to emulate the
10BBC Microbit (Nordic nRF51822) platform.
11
12This configuration provides support for an ARM Cortex-M0 CPU and these devices:
13
14* Nested Vectored Interrupt Controller
15* TIMER (nRF TIMER System Clock)
16
17.. note::
18   This board configuration makes no claims about its suitability for use
19   with an actual nRF51 Microbit hardware system, or any other hardware system.
20
21Hardware
22********
23Supported Features
24==================
25
26The following hardware features are supported:
27
28+--------------+------------+----------------------+
29| Interface    | Controller | Driver/Component     |
30+==============+============+======================+
31| NVIC         | on-chip    | nested vectored      |
32|              |            | interrupt controller |
33+--------------+------------+----------------------+
34| nRF          | on-chip    | serial port          |
35| UART         |            |                      |
36+--------------+------------+----------------------+
37| nRF TIMER    | on-chip    | system clock         |
38+--------------+------------+----------------------+
39
40The kernel currently does not support other hardware features on this platform.
41
42Devices
43========
44System Clock
45------------
46
47This board configuration uses a system clock frequency of 1 MHz.
48
49Serial Port
50-----------
51
52This board configuration uses a single serial communication channel with the
53CPU's UART0.
54
55Known Problems or Limitations
56==============================
57
58The following platform features are unsupported:
59
60* Writing to the hardware's flash memory
61
62
63Programming and Debugging
64*************************
65
66Use this configuration to run basic Zephyr applications and kernel tests in the QEMU
67emulated environment, for example, with the :zephyr:code-sample:`synchronization` sample:
68
69.. zephyr-app-commands::
70   :zephyr-app: samples/synchronization
71   :host-os: unix
72   :board: qemu_cortex_m0
73   :goals: run
74
75This will build an image with the synchronization sample app, boot it using
76QEMU, and display the following console output:
77
78.. code-block:: console
79
80        ***** BOOTING ZEPHYR OS v1.8.99 - BUILD: Jun 27 2017 13:09:26 *****
81        threadA: Hello World from arm!
82        threadB: Hello World from arm!
83        threadA: Hello World from arm!
84        threadB: Hello World from arm!
85        threadA: Hello World from arm!
86        threadB: Hello World from arm!
87        threadA: Hello World from arm!
88        threadB: Hello World from arm!
89        threadA: Hello World from arm!
90        threadB: Hello World from arm!
91
92Exit QEMU by pressing :kbd:`CTRL+A` :kbd:`x`.
93
94Debugging
95=========
96
97Refer to the detailed overview about :ref:`application_debugging`.
98
99Networking
100==========
101
102References
103**********
104
1051. The Definitive Guide to the ARM Cortex-M0, Second Edition by Joseph Yiu (ISBN
106   978-0-12-803278-7)
1072. ARMv6-M Architecture Technical Reference Manual (ARM DDI 0419D 0403D ID051917)
1083. Procedure Call Standard for the ARM Architecture (ARM IHI 0042E, current
109   through ABI release 2.09, 2012/11/30)
1104. Cortex-M0 Revision r2p1 Technical Reference Manual (ARM DDI 0432C ID113009)
1115. Cortex-M0 Devices Generic User Guide (ARM DUI 0497A ID112109)
112