1.. zephyr:board:: adafruit_grand_central_m4_express
2
3Overview
4********
5
6The Adafruit Grand Central M4 Express is an ARM development board with the
7form factor of an Arduino Mega.
8It features 70 GPIO pins, a microSDHC slot and 8MiB of QSPI Flash.
9
10Hardware
11********
12
13- ATSAMD51P20A ARM Cortex-M4F processor at 120 MHz
14- 1024 KiB of flash memory and 256 KiB of RAM
15- 8 MiB of QSPI flash
16- A red user LED
17- A RGB "NeoPixel" / WS2812B LED
18- A microSDHC slot (connected via SPI)
19- Native USB port
20
21Supported Features
22==================
23
24The adafruit_grand_central_m4_express board configuration supports the following
25hardware features:
26
27+-----------+------------+------------------------------------------+
28| Interface | Controller | Driver/Component                         |
29+===========+============+==========================================+
30| NVIC      | on-chip    | Nested vector interrupt controller       |
31+-----------+------------+------------------------------------------+
32| SYSTICK   | on-chip    | SysTick                                  |
33+-----------+------------+------------------------------------------+
34| WDT       | on-chip    | Watchdog                                 |
35+-----------+------------+------------------------------------------+
36| GPIO      | on-chip    | I/O ports, User LED                      |
37+-----------+------------+------------------------------------------+
38| UART      | on-chip    | Serial ports, Console                    |
39+-----------+------------+------------------------------------------+
40| SPI       | on-chip    | SPI ports, microSDHC slot                |
41+-----------+------------+------------------------------------------+
42| TRNG      | on-chip    | True Random Number Generator             |
43+-----------+------------+------------------------------------------+
44| RTC       | on-chip    | Real-Time Counter                        |
45+-----------+------------+------------------------------------------+
46| USB       | on-chip    | USB device                               |
47+-----------+------------+------------------------------------------+
48| WDT       | on-chip    | Watchdog Timer                           |
49+-----------+------------+------------------------------------------+
50
51Other hardware features are not currently supported by Zephyr.
52
53The default configuration can be found in the Kconfig file
54:zephyr_file:`boards/adafruit/grand_central_m4_express/adafruit_grand_central_m4_express_defconfig`.
55
56Connections and IOs
57===================
58
59The `Adafruit Learning System`_ has detailed information about
60the board including `pinouts`_ and the `schematics`_.
61
62System Clock
63============
64
65The SAMD51 MCU is configured to use the 32.768 kHz external oscillator
66with the on-chip PLL generating the 120 MHz system clock.
67
68Serial Port
69===========
70
71The SAMD51 MCU has 8 SERCOM based UARTs. On the Grand Central, SERCOM0 is
72the Zephyr console and is available on RX(PB25) and TX(PB24).
73
74SPI Port
75========
76
77The SAMD51 MCU has 8 SERCOM based SPIs. On the Grand Central, SERCOM7 has been
78set into SPI mode to connect to devices over the SCK(PD09), MOSI(PD08), and MISO(PD11) pins.
79Additionally SERCOM2 has been configured as SPI to access the microSDHC card.
80
81I2C Port
82========
83
84The SAMD51 MCU has 8 SERCOM based I2Cs. On the Grand Central, SERCOM3 has been
85configured as I2C to connect to devices over the SCL(PB21) and SDA(PB20) pins.
86
87USB Device Port
88===============
89
90The SAMD51 MCU has a USB device port that can be used to communicate
91with a host PC.  See the :zephyr:code-sample-category:`usb` sample applications for
92more, such as the :zephyr:code-sample:`usb-cdc-acm` sample which sets up a virtual
93serial port that echos characters back to the host PC.
94
95Programming and Debugging
96*************************
97
98The Grand Central ships with a BOSSA compatible UF2 bootloader.
99The bootloader can be entered by quickly tapping the reset button twice.
100
101Flashing
102========
103
104#. Build the Zephyr kernel and the :zephyr:code-sample:`hello_world` sample application:
105
106   .. zephyr-app-commands::
107      :zephyr-app: samples/hello_world
108      :board: adafruit_grand_central_m4_express
109      :goals: build
110      :compact:
111
112#. Connect the Grand Central to your host computer using USB.
113
114#. Connect a 3.3 V USB to serial adapter to the board and to the
115   host.  See the `Serial Port`_ section above for the board's pin
116   connections.
117
118#. Run your favorite terminal program to listen for output. Under Linux the
119   terminal should be :code:`/dev/ttyUSB0`. For example:
120
121   .. code-block:: console
122
123      $ minicom -D /dev/ttyUSB0 -o
124
125   The -o option tells minicom not to send the modem initialization
126   string. Connection should be configured as follows:
127
128   - Speed: 115200
129   - Data: 8 bits
130   - Parity: None
131   - Stop bits: 1
132
133#. Tap the reset button twice quickly to enter bootloader mode
134
135#. Flash the image:
136
137   .. zephyr-app-commands::
138      :zephyr-app: samples/hello_world
139      :board: adafruit_grand_central_m4_express
140      :goals: flash
141      :compact:
142
143   You should see "Hello World! adafruit_grand_central_m4_express" in your terminal.
144
145Debugging
146=========
147
148In addition to the built-in bootloader, the Grand Central can be flashed and
149debugged using a SWD probe such as the Segger J-Link.
150
151#. Connect the probe to the board using the 10-pin SWD interface.
152
153#. Flash the image:
154
155   .. zephyr-app-commands::
156      :zephyr-app: samples/hello_world
157      :board: adafruit_grand_central_m4_express
158      :goals: flash
159      :flash-args: -r openocd
160      :compact:
161
162#. Start debugging:
163
164   .. zephyr-app-commands::
165      :zephyr-app: samples/hello_world
166      :board: adafruit_grand_central_m4_express
167      :goals: debug
168      :compact:
169
170References
171**********
172
173.. target-notes::
174
175.. _Adafruit Learning System:
176    https://learn.adafruit.com/adafruit-grand-central
177
178.. _pinouts:
179    https://learn.adafruit.com/adafruit-grand-central/pinouts
180
181.. _schematics:
182    https://learn.adafruit.com/adafruit-grand-central/downloads
183
184.. _J-Link:
185    https://www.segger.com/products/debug-probes/j-link/technology/interface-description/
186