1.. _mps3_an547_board:
2
3ARM MPS3 AN547
4###############
5
6Overview
7********
8
9The mps3_an547 board configuration is used by Zephyr applications that run
10on the MPS3 AN547 board. It provides support for the MPS3 AN547 ARM Cortex-M55
11CPU and the following devices:
12
13- Nested Vectored Interrupt Controller (NVIC)
14- System Tick System Clock (SYSTICK)
15- Cortex-M System Design Kit GPIO
16- Cortex-M System Design Kit UART
17- Ethos-U55 NPU
18
19.. image:: img/mps3_an547.jpg
20     :align: center
21     :alt: ARM MPS3 AN547
22
23This board configuration also supports using the `Corstone-300 FVP`_ to emulate
24a MPS3 AN547 hardware platform.
25
26The Corstone-300 FVP (Fixed Virtual Platform) is a complete simulation of the
27Arm system, including processor, memory and peripherals. It is a available free
28of charge for Linux and Windows systems. The FVP has been selected for
29simulation since it provides access to the Ethos-U55 NPU, which is unavailable
30in QEMU or other simulation platforms.
31
32To run the Fixed Virtual Platform simulation tool you must download "FVP model
33for the Corstone-300 MPS3" from Arm and install it on your host PC. This board
34has been tested with version 11.12.57 (Nov  2 2020).
35
36Zephyr board options
37====================
38
39The MPS3+ AN547 is an SoC with Cortex-M55 architecture. Zephyr provides support
40for building for both Secure and Non-Secure firmware.
41
42The BOARD options are summarized below:
43
44+----------------------+-----------------------------------------------+
45|   BOARD              | Description                                   |
46+======================+===============================================+
47| mps3_an547           | For building Secure (or Secure-only) firmware |
48+----------------------+-----------------------------------------------+
49| mps3_an547_ns        | For building Non-Secure firmware              |
50+----------------------+-----------------------------------------------+
51
52Hardware
53********
54
55ARM MPS3 AN547 provides the following hardware components:
56
57- ARM Cortex-M55
58- Soft Macro Model (SMM) implementation of SSE-300 subsystem
59- Memory
60
61  - 8MB BRAM
62  - 4GB DDR4 SODIMM (by default, upgradeable to 8GB)
63  - 16GB eMMC
64  - 8MB QSPI Flash
65
66- Debug
67
68  - P‐JTAG, F-JTAG, SWD, 4-bit trace, 16-bit trace
69  - Four serial ports over USB
70
71- Interface
72
73  - AHB GPIO
74  - UART
75  - SPI
76  - I2C
77  - I2S
78  - Color LCD serial interface
79  - Ethernet
80  - VGA
81
82- On-board Peripherals
83
84  - Color LCD
85  - 10 LEDs
86  - 8 Switches
87  - 2 user push buttons
88
89Supported Features
90===================
91
92The mps3_an547 board configuration supports the following hardware features:
93
94+-----------+------------+-------------------------------------+
95| Interface | Controller | Driver/Component                    |
96+===========+============+=====================================+
97| NVIC      | on-chip    | nested vector interrupt controller  |
98+-----------+------------+-------------------------------------+
99| SYSTICK   | on-chip    | systick                             |
100+-----------+------------+-------------------------------------+
101| UART      | on-chip    | serial port-polling;                |
102|           |            | serial port-interrupt               |
103+-----------+------------+-------------------------------------+
104| GPIO      | on-chip    | gpio                                |
105+-----------+------------+-------------------------------------+
106
107Other hardware features are not currently supported by the port.
108See the `MPS3 FPGA Website`_ for a complete list of MPS3 AN547 board hardware
109features.
110
111The default configuration can be found in the defconfig file:
112``boards/arm/mps3_an547/mps3_an547_defconfig``.
113
114For more details refer to `MPS3 AN547 Technical Reference Manual (TRM)`_.
115
116Serial Port
117===========
118
119The MPS3 AN547 has six UARTs. The Zephyr console output by default, uses
120UART0, which is exposed over the Debug USB interface (J8).
121
122Serial port 0 on the Debug USB interface is the MCC board control console.
123
124Serial port 1 on the Debug USB interface is connected to UART 0.
125
126Serial port 2 on the Debug USB interface is connected to UART 1.
127
128Serial port 3 on the Debug USB interface is connected to UART 2.
129
130Programming and Debugging
131*************************
132
133Flashing
134========
135
136MPS3 AN547 provides:
137
138- A USB connection to the host computer, which exposes Mass Storage and
139  CMSIS-DAP, and serial ports.
140
141Building an application
142-----------------------
143
144You can build applications in the usual way. Here is an example for
145the :ref:`hello_world` application.
146
147.. zephyr-app-commands::
148   :zephyr-app: samples/hello_world
149   :board: mps3_an547
150   :goals: build
151
152Open a serial terminal (minicom, putty, etc.) with the following settings:
153
154- Speed: 115200
155- Data: 8 bits
156- Parity: None
157- Stop bits: 1
158
159Reset the board, and you should see the following message on the corresponding
160serial port:
161
162.. code-block:: console
163
164   Hello World! mps3_an547
165
166Uploading an application to MPS3 AN547
167---------------------------------------
168
169Applications can be in elf, hex or bin format. The binaries are flashed when
170the board boots up, using files stored on the on-board Micro SD card. The
171Motherboard Configuration Controller (MCC) is responsible for loading the FPGA
172image and binaries.
173
174Connect the MPS3 to your host computer using the USB port. You should see a
175USB connection exposing a Mass Storage (``V2M-MPS3`` by default).
176
177The update requires 3 steps:
178
1791. Copy application files to ``<MPS3 device name>/SOFTWARE/``.
1802. Open ``<MPS3 device name>/MB/HBI0309C/AN547/images.txt``.
1813. Update the ``AN547/images.txt`` file as follows:
182
183.. code-block:: bash
184
185   TITLE: Versatile Express Images Configuration File
186
187   [IMAGES]
188   TOTALIMAGES: 1 ;Number of Images (Max: 32)
189
190   IMAGE0ADDRESS: 0x01000000 ;Please select the required executable program
191
192   IMAGE0FILE: \SOFTWARE\zephyr.elf
193
194
195Reset the board, and you should see the following message on the corresponding
196serial port:
197
198.. code-block:: console
199
200   Hello World! mps3_an547
201
202
203FVP Usage
204=========
205
206To run with the FVP, first set environment variable ``ARMFVP_BIN_PATH`` before
207using it. Then you can run it with ``west build -t run``.
208
209.. code-block:: bash
210
211   export ARMFVP_BIN_PATH=/path/to/fvp/directory
212   west build -t run
213
214
215QEMU Usage
216==========
217
218To run with QEMU instead of the default FVP, override the emulator selection
219at build time via:
220
221.. code-block:: bash
222
223   $ west build -b mps3_an547 samples/hello_world -DEMU_PLATFORM=qemu -t run
224
225
226Note, however, that the Ethos-U55 NPU is not available in QEMU. If you require
227the use of the NPU, please use the default FVP for device emulation.
228
229.. _Corstone-300 FVP:
230   https://developer.arm.com/tools-and-software/open-source-software/arm-platforms-software/arm-ecosystem-fvps
231
232.. _MPS3 FPGA Website:
233   https://developer.arm.com/tools-and-software/development-boards/fpga-prototyping-boards/mps3
234
235.. _MPS3 AN547 Technical Reference Manual (TRM):
236   https://developer.arm.com/-/media/Arm%20Developer%20Community/PDF/DAI0547B_SSE300_PLUS_U55_FPGA_for_mps3.pdf
237
238.. _MPS3 FPGA Prototyping Board Technical Reference Manual (TRM):
239   https://developer.arm.com/documentation/100765/latest
240
241.. _Cortex M55 Generic User Guide:
242   https://developer.arm.com/documentation/101051/latest
243
244.. _Corelink SSE-300 Example Subsystem:
245   https://developer.arm.com/documentation/101772/latest
246