1.. _mps3_board:
2
3ARM MPS3
4###############
5
6Overview
7********
8
9The mps3 board configuration is used by Zephyr applications that run
10on the MPS3 board. It provides support for the following devices:
11
12- Nested Vectored Interrupt Controller (NVIC)
13- System Tick System Clock (SYSTICK)
14- Cortex-M System Design Kit GPIO
15- Cortex-M System Design Kit UART
16- Ethos-U55 NPU
17- AN547 and AN552 support Arm Cortex-M55 CPU
18- AN555 support Arm Cortex-M85 CPU
19
20.. image:: img/mps3.jpg
21     :align: center
22     :alt: ARM MPS3
23
24`Corstone-300 FVP`_/`Corstone-310 FVP`_ (Fixed Virtual Platforms) is a complete
25simulations of the Arm system, including processor, memory and peripherals.
26They are available free of charge for Linux and Windows systems.
27The FVPs have been selected for simulation since they provide access to the
28Ethos-U55 NPU, which is unavailable in QEMU or other simulation platforms.
29
30
31Zephyr board options
32====================
33
34.. tabs::
35
36  .. tab:: MPS3 Corstone-300 (AN547)
37
38   The MPS3+ AN547 is an SoC with Cortex-M55 architecture. Zephyr provides support
39   for building for both Secure and Non-Secure firmware.
40
41   The BOARD options are summarized below:
42
43   +-------------------------------+-----------------------------------------------+
44   |   BOARD                       | Description                                   |
45   +===============================+===============================================+
46   | ``mps3/corstone300/an547``    | For building Secure (or Secure-only) firmware |
47   +-------------------------------+-----------------------------------------------+
48   | ``mps3/corstone300/an547/ns`` | For building Non-Secure firmware              |
49   +-------------------------------+-----------------------------------------------+
50
51   FPGA Usage:
52    - Follow `Programming and Debugging`_ for build and flash instructions.
53
54   FVP Usage:
55    - FVP is not supported for this variant.
56
57   QEMU Usage:
58    - To run with QEMU instead of the default FVP, override the emulator selection at build time via:
59
60    .. code-block:: bash
61
62     $ west build -b mps3_an547 samples/hello_world -DEMU_PLATFORM=qemu -t run
63
64  .. tab:: MPS3 Corstone-300 (AN552)
65
66   The MPS3+ AN552 is an SoC with Cortex-M55 architecture. Zephyr provides support
67   for building for both Secure and Non-Secure firmware.
68
69   The BOARD options are summarized below:
70
71   +-------------------------------+-----------------------------------------------+
72   |   BOARD                       | Description                                   |
73   +===============================+===============================================+
74   | ``mps3/corstone300/an552``    | For building Secure (or Secure-only) firmware |
75   +-------------------------------+-----------------------------------------------+
76   | ``mps3/corstone300/an552/ns`` | For building Non-Secure firmware              |
77   +-------------------------------+-----------------------------------------------+
78
79   FPGA Usage:
80    - Follow `Programming and Debugging`_ for build and flash instructions.
81
82   FVP Usage:
83    - FVP not supported for this variant.
84
85   QEMU Usage:
86    - QEMU not supported for this variant of board.
87
88  .. tab:: MPS3 Corstone-300 (FVP)
89
90   The MPS3+ FVP is an SoC with Cortex-M55 architecture. Zephyr provides support
91   for building for both Secure and Non-Secure firmware.
92
93   The BOARD options are summarized below:
94
95   +-------------------------------+-----------------------------------------------+
96   |   BOARD                       | Description                                   |
97   +===============================+===============================================+
98   | ``mps3/corstone300/fvp``      | For building Secure (or Secure-only) firmware |
99   +-------------------------------+-----------------------------------------------+
100   | ``mps3/corstone300/fvp/ns``   | For building Non-Secure firmware              |
101   +-------------------------------+-----------------------------------------------+
102
103   FPGA Usage:
104    - N/A.
105
106   FVP Usage:
107    - To run with the FVP, first set environment variable ``ARMFVP_BIN_PATH`` before using it. Then you can run it with ``west build -t run``.
108
109    .. code-block:: bash
110
111       export ARMFVP_BIN_PATH=/path/to/fvp/directory
112       west build -b {BOARD qualifier from table above} samples/hello_world -t run
113
114   To run the Fixed Virtual Platform simulation tool you must download "FVP model
115   for the Corstone-300 MPS3" from Arm and install it on your host PC. This board
116   has been tested with version 11.24.13 (Jan  4 2024).
117
118   QEMU Usage:
119    - N/A.
120
121  .. tab:: MPS3 Corstone-310 (AN555)
122
123   The MPS3+ AN555 is an SoC with Cortex-M85 architecture. Zephyr provides support
124   for building for both Secure and Non-Secure firmware.
125
126   The BOARD options are summarized below:
127
128   +-------------------------------+-----------------------------------------------+
129   |   BOARD                       | Description                                   |
130   +===============================+===============================================+
131   | ``mps3/corstone310/an555``    | For building Secure (or Secure-only) firmware |
132   +-------------------------------+-----------------------------------------------+
133   | ``mps3/corstone310/an555/ns`` | For building Non-Secure firmware              |
134   +-------------------------------+-----------------------------------------------+
135
136   FPGA Usage:
137    - Follow `Programming and Debugging`_ for build and flash instructions.
138
139   FVP Usage:
140    - FVP not supported for this variant.
141
142   QEMU Usage:
143    - QEMU not supported for this variant of board.
144
145  .. tab:: MPS3 Corstone-310 (FVP)
146
147   The MPS3+ FVP is an SoC with Cortex-M85 architecture. Zephyr provides support
148   for building for both Secure and Non-Secure firmware.
149
150   The BOARD options are summarized below:
151
152   +-------------------------------+-----------------------------------------------+
153   |   BOARD                       | Description                                   |
154   +===============================+===============================================+
155   | ``mps3/corstone310/fvp``      | For building Secure (or Secure-only) firmware |
156   +-------------------------------+-----------------------------------------------+
157   | ``mps3/corstone310/fvp/ns``   | For building Non-Secure firmware              |
158   +-------------------------------+-----------------------------------------------+
159
160   FPGA Usage:
161    - N/A.
162
163   FVP Usage:
164    - To run with the FVP, first set environment variable ``ARMFVP_BIN_PATH`` before using it. Then you can run it with ``west build -t run``.
165
166    .. code-block:: bash
167
168       export ARMFVP_BIN_PATH=/path/to/fvp/directory
169       west build -b {BOARD qualifier from table above} samples/hello_world -t run
170
171   To run the Fixed Virtual Platform simulation tool you must download "FVP model
172   for the Corstone-310 MPS3" from Arm and install it on your host PC. This board
173   has been tested with version 11.24.13 (Jan  4 2024).
174
175   QEMU Usage:
176    - N/A.
177
178  .. note::
179     Board qualifier must include the board name as mentioned above.
180     ``mps3/corstone300`` or ``mps3/corstone310`` without the board name is not a valid qualifier.
181
182Hardware
183********
184
185ARM MPS3 provides the following hardware components:
186
187- CPU
188
189  - AN547 and AN552 support Arm Cortex-M55 CPU and
190    Soft Macro Model (SMM) implementation of SSE-300 subsystem
191  - AN555 support Arm Cortex-M85 CPU and
192    Soft Macro Model (SMM) implementation of SSE-310 subsystem
193
194- Memory
195
196  - 8MB BRAM
197  - 4GB DDR4 SODIMM (by default, upgradeable to 8GB)
198  - 16GB eMMC
199  - 8MB QSPI Flash
200
201- Debug
202
203  - P‐JTAG, F-JTAG, SWD, 4-bit trace, 16-bit trace
204  - Four serial ports over USB
205
206- Interface
207
208  - AHB GPIO
209  - UART
210  - SPI
211  - I2C
212  - I2S
213  - Color LCD serial interface
214  - Ethernet
215  - VGA
216
217- On-board Peripherals
218
219  - Color LCD
220  - 10 LEDs
221  - 8 Switches
222  - 2 user push buttons
223
224Supported Features
225===================
226
227The ``MPS3`` board configuration supports the following hardware features:
228
229+-----------+------------+-------------------------------------+
230| Interface | Controller | Driver/Component                    |
231+===========+============+=====================================+
232| NVIC      | on-chip    | nested vector interrupt controller  |
233+-----------+------------+-------------------------------------+
234| SYSTICK   | on-chip    | systick                             |
235+-----------+------------+-------------------------------------+
236| UART      | on-chip    | serial port-polling;                |
237|           |            | serial port-interrupt               |
238+-----------+------------+-------------------------------------+
239| GPIO      | on-chip    | gpio                                |
240+-----------+------------+-------------------------------------+
241
242Other hardware features are not currently supported by the port.
243See the `MPS3 FPGA Website`_ for a complete list of MPS3 AN547 board hardware
244features.
245
246The default configuration can be found in
247 - For AN547: :zephyr_file:`boards/arm/mps3/mps3_corstone300_an547_defconfig`.
248 - For AN552: :zephyr_file:`boards/arm/mps3/mps3_corstone300_an552_defconfig`.
249 - For FVP  : :zephyr_file:`boards/arm/mps3/mps3_corstone300_fvp_defconfig`.
250 - For AN555: :zephyr_file:`boards/arm/mps3/mps3_corstone310_an555_defconfig`.
251
252
253Serial Port
254===========
255
256The MPS3 has six UARTs. The Zephyr console output by default, uses
257UART0, which is exposed over the Debug USB interface (J8).
258
259Serial port 0 on the Debug USB interface is the MCC board control console.
260
261Serial port 1 on the Debug USB interface is connected to UART 0.
262
263Serial port 2 on the Debug USB interface is connected to UART 1.
264
265Serial port 3 on the Debug USB interface is connected to UART 2.
266
267.. Programming and Debugging:
268
269Programming and Debugging
270*************************
271
272Flashing
273========
274
275MPS3 provides:
276
277- A USB connection to the host computer, which exposes Mass Storage and
278  CMSIS-DAP, and serial ports.
279
280Building an application with AN547
281----------------------------------
282
283You can build applications in the usual way. Here is an example for
284the :zephyr:code-sample:`hello_world` application with AN547.
285
286.. zephyr-app-commands::
287   :zephyr-app: samples/hello_world
288   :board: mps3/corstone300/an547
289   :goals: build
290
291Open a serial terminal (minicom, putty, etc.) with the following settings:
292
293- Speed: 115200
294- Data: 8 bits
295- Parity: None
296- Stop bits: 1
297
298Reset the board, and you should see the following message on the corresponding
299serial port:
300
301.. code-block:: console
302
303   Hello World! mps3
304
305Uploading an application to MPS3 AN547
306---------------------------------------
307
308Applications can be in elf, hex or bin format. The binaries are flashed when
309the board boots up, using files stored on the on-board Micro SD card. The
310Motherboard Configuration Controller (MCC) is responsible for loading the FPGA
311image and binaries.
312
313Connect the MPS3 to your host computer using the USB port. You should see a
314USB connection exposing a Mass Storage (``V2M-MPS3`` by default).
315
316The update requires 3 steps:
317
3181. Copy application files to ``<MPS3 device name>/SOFTWARE/``.
3192. Open ``<MPS3 device name>/MB/HBI0309C/AN547/images.txt``.
3203. Update the ``images.txt`` file as follows:
321
322.. code-block:: bash
323
324   TITLE: Versatile Express Images Configuration File
325
326   [IMAGES]
327   TOTALIMAGES: 1 ;Number of Images (Max: 32)
328
329   IMAGE0ADDRESS: 0x01000000 ;Please select the required executable program
330
331   IMAGE0FILE: \SOFTWARE\zephyr.elf
332
333
334Reset the board, and you should see the following message on the corresponding
335serial port:
336
337.. code-block:: console
338
339   Hello World! mps3
340
341
342For more details refer to:
343 - `MPS3 AN547 Technical Reference Manual (TRM)`_
344 - `MPS3 AN552 Technical Reference Manual (TRM)`_
345 - `MPS3 AN555 Technical Reference Manual (TRM)`_
346 - `MPS3 FPGA Prototyping Board Technical Reference Manual (TRM)`_
347 - `Cortex M55 Generic User Guide`_
348 - `Cortex M85 Generic User Guide`_
349 - `Corelink SSE-300 Example Subsystem`_
350 - `Corelink SSE-310 Example Subsystem`_
351
352.. _Corstone-300 FVP:
353   https://developer.arm.com/tools-and-software/open-source-software/arm-platforms-software/arm-ecosystem-fvps
354
355.. _Corstone-310 FVP:
356   https://developer.arm.com/tools-and-software/open-source-software/arm-platforms-software/arm-ecosystem-fvps
357
358.. _MPS3 FPGA Website:
359   https://developer.arm.com/tools-and-software/development-boards/fpga-prototyping-boards/mps3
360
361.. _MPS3 AN547 Technical Reference Manual (TRM):
362   https://developer.arm.com/-/media/Arm%20Developer%20Community/PDF/DAI0547B_SSE300_PLUS_U55_FPGA_for_mps3.pdf
363
364.. _MPS3 AN552 Technical Reference Manual (TRM):
365   https://developer.arm.com/documentation/dai0552/latest
366
367.. _MPS3 AN555 Technical Reference Manual (TRM):
368   https://developer.arm.com/documentation/107642/latest
369
370.. _MPS3 FPGA Prototyping Board Technical Reference Manual (TRM):
371   https://developer.arm.com/documentation/100765/latest
372
373.. _Cortex M55 Generic User Guide:
374   https://developer.arm.com/documentation/101051/latest
375
376.. _Cortex M85 Generic User Guide:
377   https://developer.arm.com/documentation/101924/latest
378
379.. _Corelink SSE-300 Example Subsystem:
380   https://developer.arm.com/documentation/101772/latest
381
382.. _Corelink SSE-310 Example Subsystem:
383   https://developer.arm.com/documentation/102778/latest
384