1.. zephyr:board:: mm_swiftio
2
3Overview
4********
5
6The SwiftIO board, designed by MadMachine is the world's first board
7designed with support for the modern `Swift language
8<https://docs.swift.org/swift-book/>`_.  Zephyr provides basic
9low-level capabilities for the SwiftIO board. Swift application would
10run on top of Zephyr. More information about the board can be found
11at:
12
13- `MadMachine Homepage`_
14- `SwiftIO API Reference`_
15
16Hardware
17********
18
19- i.MX RT1052 Cortex-M7 processor at 600MHz
20- 8MB QSPI Flash, 32MB SDRAM
21- On-board DAPLink debugger with serial port
22- User RGB LED, USB 2.0 Connector, microSD slot
23
24
25
26Supported Features
27==================
28
29The mm_swiftio board configuration supports the following hardware
30features:
31
32+-----------+------------+-------------------------------------+
33| Interface | Controller | Driver/Component                    |
34+===========+============+=====================================+
35| NVIC      | on-chip    | nested vector interrupt controller  |
36+-----------+------------+-------------------------------------+
37| SYSTICK   | on-chip    | systick                             |
38+-----------+------------+-------------------------------------+
39| DISPLAY   | on-chip    | display                             |
40+-----------+------------+-------------------------------------+
41| GPIO      | on-chip    | gpio                                |
42+-----------+------------+-------------------------------------+
43| I2C       | on-chip    | i2c                                 |
44+-----------+------------+-------------------------------------+
45| SPI       | on-chip    | spi                                 |
46+-----------+------------+-------------------------------------+
47| UART      | on-chip    | serial port-polling;                |
48|           |            | serial port-interrupt               |
49+-----------+------------+-------------------------------------+
50| USB       | on-chip    | USB device                          |
51+-----------+------------+-------------------------------------+
52
53
54
55Connections and IOs
56===================
57
58Note:
59The following SwiftIO pinout diagram is used for Swift programming.
60The Swift ID is not the same as the Zephyr driver ID.
61
62+-----------+---------------+----------+---------------+--------------------------+
63| Name                      | GPIO                     | Other peripherals        |
64+===========+===============+==========+===============+==========+===============+
65| Swift ID  | Pin name      | Swift ID | Zephyr driver | Swift ID | Zephyr driver |
66+-----------+---------------+----------+---------------+----------+---------------+
67| P0        | GPIO_AD_B1_03 | D0       | GPIO1_IO19    |          |               |
68+-----------+---------------+----------+---------------+ UART0    | UART_2        |
69| P1        | GPIO_AD_B1_02 | D1       | GPIO1_IO18    |          |               |
70+-----------+---------------+----------+---------------+----------+---------------+
71| P2        | GPIO_AD_B0_03 | D2       | GPIO1_IO03    |          |               |
72+-----------+---------------+----------+---------------+ UART1    | UART_6        |
73| P3        | GPIO_AD_B0_02 | D3       | GPIO1_IO02    |          |               |
74+-----------+---------------+----------+---------------+----------+---------------+
75| P4        | GPIO_B1_14    | D4       | GPIO2_IO30    |          |               |
76+-----------+---------------+----------+---------------+----------+---------------+
77| P5        | GPIO_B1_15    | D5       | GPIO2_IO31    |          |               |
78+-----------+---------------+----------+---------------+----------+---------------+
79| P6        | GPIO_B0_03    | D6       | GPIO2_IO03    |          |               |
80+-----------+---------------+----------+---------------+          |               |
81| P7        | GPIO_B0_02    | D7       | GPIO2_IO02    |          |               |
82+-----------+---------------+----------+---------------+ SPI0     | SPI_4         |
83| P8        | GPIO_B0_01    | D8       | GPIO2_IO01    |          |               |
84+-----------+---------------+----------+---------------+          |               |
85| P9        | GPIO_B0_00    | D9       | GPIO2_IO00    |          |               |
86+-----------+---------------+----------+---------------+----------+---------------+
87| P10       | GPIO_B1_03    | D10      | GPIO2_IO19    |          |               |
88+-----------+---------------+----------+---------------+----------+---------------+
89| P11       | GPIO_B1_02    | D11      | GPIO2_IO18    |          |               |
90+-----------+---------------+----------+---------------+----------+---------------+
91| P12       | GPIO_B1_01    | D12      | GPIO2_IO17    |          |               |
92+-----------+---------------+----------+---------------+ UART2    | UART_4        |
93| P13       | GPIO_B1_00    | D13      | GPIO2_IO16    |          |               |
94+-----------+---------------+----------+---------------+----------+---------------+
95| P14       | GPIO_AD_B1_15 | D14      | GPIO1_IO31    |          |               |
96+-----------+---------------+----------+---------------+          |               |
97| P15       | GPIO_AD_B1_14 | D15      | GPIO1_IO30    |          |               |
98+-----------+---------------+----------+---------------+ SPI1     | SPI_3         |
99| P16       | GPIO_AD_B1_13 | D16      | GPIO1_IO29    |          |               |
100+-----------+---------------+----------+---------------+          |               |
101| P17       | GPIO_AD_B1_12 | D17      | GPIO1_IO28    |          |               |
102+-----------+---------------+----------+---------------+----------+---------------+
103| P18       | GPIO_AD_B1_11 | D18      | GPIO1_IO27    |          |               |
104+-----------+---------------+----------+---------------+ UART3    | UART_8        |
105| P19       | GPIO_AD_B1_10 | D19      | GPIO1_IO26    |          |               |
106+-----------+---------------+----------+---------------+----------+---------------+
107| P20       | GPIO_AD_B1_09 | D20      | GPIO1_IO25    |          |               |
108+-----------+---------------+----------+---------------+----------+---------------+
109| P21       | GPIO_AD_B1_08 | D21      | GPIO1_IO24    |          |               |
110+-----------+---------------+----------+---------------+----------+---------------+
111| P22       | GPIO_AD_B1_05 | D22      | GPIO1_IO21    |          |               |
112+-----------+---------------+----------+---------------+----------+---------------+
113| P23       | GPIO_AD_B1_04 | D23      | GPIO1_IO20    |          |               |
114+-----------+---------------+----------+---------------+----------+---------------+
115| P24       | GPIO_AD_B0_15 | D24      | GPIO1_IO15    |          |               |
116+-----------+---------------+----------+---------------+----------+---------------+
117| P25       | GPIO_AD_B0_14 | D25      | GPIO1_IO14    |          |               |
118+-----------+---------------+----------+---------------+----------+---------------+
119| P26       | GPIO_B0_04    | D26      | GPIO2_IO04    |          |               |
120+-----------+---------------+----------+---------------+----------+---------------+
121| P27       | GPIO_B0_05    | D27      | GPIO2_IO05    |          |               |
122+-----------+---------------+----------+---------------+----------+---------------+
123| P28       | GPIO_B0_06    | D28      | GPIO2_IO06    |          |               |
124+-----------+---------------+----------+---------------+----------+---------------+
125| P29       | GPIO_B0_07    | D29      | GPIO2_IO07    |          |               |
126+-----------+---------------+----------+---------------+----------+---------------+
127| P30       | GPIO_B0_08    | D30      | GPIO2_IO08    |          |               |
128+-----------+---------------+----------+---------------+----------+---------------+
129| P31       | GPIO_B0_09    | D31      | GPIO2_IO09    |          |               |
130+-----------+---------------+----------+---------------+----------+---------------+
131| P32       | GPIO_B0_10    | D32      | GPIO2_IO10    |          |               |
132+-----------+---------------+----------+---------------+----------+---------------+
133| P33       | GPIO_B0_11    | D33      | GPIO2_IO11    |          |               |
134+-----------+---------------+----------+---------------+----------+---------------+
135| P34       | GPIO_B0_12    | D34      | GPIO2_IO12    |          |               |
136+-----------+---------------+----------+---------------+----------+---------------+
137| P35       | GPIO_B0_13    | D35      | GPIO2_IO13    |          |               |
138+-----------+---------------+----------+---------------+----------+---------------+
139| P36       | GPIO_B0_14    | D36      | GPIO2_IO14    |          |               |
140+-----------+---------------+----------+---------------+----------+---------------+
141| P37       | GPIO_B0_15    | D37      | GPIO2_IO15    |          |               |
142+-----------+---------------+----------+---------------+----------+---------------+
143| P38       | GPIO_B1_11    | D38      | GPIO2_IO27    |          |               |
144+-----------+---------------+----------+---------------+----------+---------------+
145| P39       | GPIO_B1_10    | D39      | GPIO2_IO26    |          |               |
146+-----------+---------------+----------+---------------+----------+---------------+
147| P40       | GPIO_B1_9     | D40      | GPIO2_IO25    |          |               |
148+-----------+---------------+----------+---------------+----------+---------------+
149| P41       | GPIO_B1_8     | D41      | GPIO2_IO24    |          |               |
150+-----------+---------------+----------+---------------+----------+---------------+
151| P42       | GPIO_B1_7     | D42      | GPIO2_IO23    |          |               |
152+-----------+---------------+----------+---------------+----------+---------------+
153| P43       | GPIO_B1_6     | D43      | GPIO2_IO22    |          |               |
154+-----------+---------------+----------+---------------+----------+---------------+
155| P44       | GPIO_B1_5     | D44      | GPIO2_IO21    |          |               |
156+-----------+---------------+----------+---------------+----------+---------------+
157| P45       | GPIO_B1_4     | D45      | GPIO2_IO20    |          |               |
158+-----------+---------------+----------+---------------+----------+---------------+
159|           | GPIO_AD_B1_07 |          |               |          |               |
160+-----------+---------------+----------+---------------+ I2C0     | I2C_3         |
161|           | GPIO_AD_B1_06 |          |               |          |               |
162+-----------+---------------+----------+---------------+----------+---------------+
163|           | GPIO_AD_B1_00 |          |               |          |               |
164+-----------+---------------+----------+---------------+ I2C1     | I2C_1         |
165|           | GPIO_AD_B1_01 |          |               |          |               |
166+-----------+---------------+----------+---------------+----------+---------------+
167
168
169Programming and Flash
170*************************
171
172Build  applications as usual (see :ref:`build_an_application` for more details).
173
174Configuring a Debug Probe
175=========================
176
177This board is configured by default to use the :ref:`opensda-daplink-onboard-debug-probe`,
178however the :ref:`pyocd-debug-host-tools` do not yet support programming the
179external flashes on this board so you must flash the device by copying files
180
181Configuring a Console
182=====================
183
184Regardless of your choice in debug probe, we will use the OpenSDA
185microcontroller as a USB-to-serial adapter for the serial console.
186
187Connect a USB cable from your PC to Serial of SwiftIO.
188
189Use the following settings with your serial terminal of choice (minicom, putty,
190etc.):
191
192- Speed: 115200
193- Data: 8 bits
194- Parity: None
195- Stop bits: 1
196
197Flashing
198========
199
200Here is an example for the :zephyr:code-sample:`hello_world` application.
201
202Connect a USB cable from your PC to "Serial" port of SwiftIO.
203On Ubuntu, DAPLink debug probes appear on the host
204computer as a USB disk mounted to ``/media/<user>/SWIFTIODBGR/``,
205where ``<user>`` is your login name.
206
207.. code-block:: console
208
209    west build -b mm_swiftio samples/hello_world
210    cp build/zephyr/zephyr.bin /media/<user>/SWIFTIODBGR/
211
212
213Open a serial terminal, reset the board (press the "reset" button), and you should
214see the following message in the terminal:
215
216.. code-block:: console
217
218   ***** Booting Zephyr OS v2.1.0-rc1 *****
219   Hello World! mm_swiftio
220
221
222.. _MadMachine Homepage:
223   https://madmachine.io
224
225.. _SwiftIO API Reference:
226   https://madmachineio.github.io/SwiftIO/documentation/swiftio/
227