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
24.. zephyr:board-supported-hw::
25
26Connections and IOs
27===================
28
29The `Adafruit Learning System`_ has detailed information about
30the board including `pinouts`_ and the `schematics`_.
31
32System Clock
33============
34
35The SAMD51 MCU is configured to use the 32.768 kHz external oscillator
36with the on-chip PLL generating the 120 MHz system clock.
37
38Serial Port
39===========
40
41The SAMD51 MCU has 8 SERCOM based UARTs. On the Grand Central, SERCOM0 is
42the Zephyr console and is available on RX(PB25) and TX(PB24).
43
44SPI Port
45========
46
47The SAMD51 MCU has 8 SERCOM based SPIs. On the Grand Central, SERCOM7 has been
48set into SPI mode to connect to devices over the SCK(PD09), MOSI(PD08), and MISO(PD11) pins.
49Additionally SERCOM2 has been configured as SPI to access the microSDHC card.
50
51I2C Port
52========
53
54The SAMD51 MCU has 8 SERCOM based I2Cs. On the Grand Central, SERCOM3 has been
55configured as I2C to connect to devices over the SCL(PB21) and SDA(PB20) pins.
56
57USB Device Port
58===============
59
60The SAMD51 MCU has a USB device port that can be used to communicate
61with a host PC.  See the :zephyr:code-sample-category:`usb` sample applications for
62more, such as the :zephyr:code-sample:`usb-cdc-acm` sample which sets up a virtual
63serial port that echos characters back to the host PC.
64
65Programming and Debugging
66*************************
67
68The Grand Central ships with a BOSSA compatible UF2 bootloader.
69The bootloader can be entered by quickly tapping the reset button twice.
70
71Flashing
72========
73
74#. Build the Zephyr kernel and the :zephyr:code-sample:`hello_world` sample application:
75
76   .. zephyr-app-commands::
77      :zephyr-app: samples/hello_world
78      :board: adafruit_grand_central_m4_express
79      :goals: build
80      :compact:
81
82#. Connect the Grand Central to your host computer using USB.
83
84#. Connect a 3.3 V USB to serial adapter to the board and to the
85   host.  See the `Serial Port`_ section above for the board's pin
86   connections.
87
88#. Run your favorite terminal program to listen for output. Under Linux the
89   terminal should be :code:`/dev/ttyUSB0`. For example:
90
91   .. code-block:: console
92
93      $ minicom -D /dev/ttyUSB0 -o
94
95   The -o option tells minicom not to send the modem initialization
96   string. Connection should be configured as follows:
97
98   - Speed: 115200
99   - Data: 8 bits
100   - Parity: None
101   - Stop bits: 1
102
103#. Tap the reset button twice quickly to enter bootloader mode
104
105#. Flash the image:
106
107   .. zephyr-app-commands::
108      :zephyr-app: samples/hello_world
109      :board: adafruit_grand_central_m4_express
110      :goals: flash
111      :compact:
112
113   You should see "Hello World! adafruit_grand_central_m4_express" in your terminal.
114
115Debugging
116=========
117
118In addition to the built-in bootloader, the Grand Central can be flashed and
119debugged using a SWD probe such as the Segger J-Link.
120
121#. Connect the probe to the board using the 10-pin SWD interface.
122
123#. Flash the image:
124
125   .. zephyr-app-commands::
126      :zephyr-app: samples/hello_world
127      :board: adafruit_grand_central_m4_express
128      :goals: flash
129      :flash-args: -r openocd
130      :compact:
131
132#. Start debugging:
133
134   .. zephyr-app-commands::
135      :zephyr-app: samples/hello_world
136      :board: adafruit_grand_central_m4_express
137      :goals: debug
138      :compact:
139
140References
141**********
142
143.. target-notes::
144
145.. _Adafruit Learning System:
146    https://learn.adafruit.com/adafruit-grand-central
147
148.. _pinouts:
149    https://learn.adafruit.com/adafruit-grand-central/pinouts
150
151.. _schematics:
152    https://learn.adafruit.com/adafruit-grand-central/downloads
153
154.. _J-Link:
155    https://www.segger.com/products/debug-probes/j-link/technology/interface-description/
156