1.. _arduino_giga_r1_board:
2
3Arduino GIGA R1 WiFi
4####################
5
6Overview
7********
8
9Arduino GIGA R1 WiFi is a development board by Arduino based on the
10STM32H747XI, a dual core ARM Cortex-M7 + Cortex-M4 MCU, with 2MBytes of Flash
11memory and 1MB SRAM.
12
13The board features:
14
15- RGB LED
16- Reset and Boot buttons
17- USB-C device
18- USB Host
19- 16MB external QSPI flash
20- 8MB external SDRAM
21- Murata Type 1DX Bluetooth + WiFi module (CYW4343W based)
22- Audio jack
23- ATECC608A secure element
24
25.. image:: img/arduino_giga_r1.jpg
26     :align: center
27     :alt: Arduino GIGA R1 WiFi
28
29More information about the board, including the datasheet, pinout and
30schematics, can be found at the `Arduino GIGA website`_.
31
32More information about STM32H747XIH6 can be found here:
33
34- `STM32H747XI on www.st.com`_
35- `STM32H747xx reference manual`_
36- `STM32H747xx datasheet`_
37
38Supported Features
39==================
40
41The current Zephyr ``arduino_giga_r1_m7`` board configuration supports the
42following hardware features:
43
44+-----------+------------+-------------------------------------+
45| Interface | Controller | Driver/Component                    |
46+===========+============+=====================================+
47| NVIC      | on-chip    | nested vector interrupt controller  |
48+-----------+------------+-------------------------------------+
49| UART      | on-chip    | serial port-polling;                |
50|           |            | serial port-interrupt               |
51+-----------+------------+-------------------------------------+
52| PINMUX    | on-chip    | pinmux                              |
53+-----------+------------+-------------------------------------+
54| GPIO      | on-chip    | gpio                                |
55+-----------+------------+-------------------------------------+
56| FLASH     | on-chip    | flash memory                        |
57+-----------+------------+-------------------------------------+
58| RNG       | on-chip    | True Random number generator        |
59+-----------+------------+-------------------------------------+
60| I2C       | on-chip    | i2c                                 |
61+-----------+------------+-------------------------------------+
62| SPI       | on-chip    | spi                                 |
63+-----------+------------+-------------------------------------+
64| IPM       | on-chip    | virtual mailbox based on HSEM       |
65+-----------+------------+-------------------------------------+
66| FMC       | on-chip    | memc (SDRAM)                        |
67+-----------+------------+-------------------------------------+
68| QSPI      | on-chip    | QSPI flash                          |
69+-----------+------------+-------------------------------------+
70| RADIO     | Murata 1DX | WiFi and Bluetooth module           |
71+-----------+------------+-------------------------------------+
72
73Other hardware features are not yet supported on Zephyr port.
74
75Fetch Binary Blobs
76******************
77
78The board Bluetooth/WiFi module requires fetching some binary blob files, to do
79that run the command:
80
81.. code-block:: console
82
83   west blobs fetch hal_infineon
84
85.. note:: Only Bluetooth functionality is currently supported.
86
87Resources sharing
88=================
89
90The dual core nature of STM32H747 SoC requires sharing HW resources between the
91two cores. This is done in 3 ways:
92
93- **Compilation**: Clock configuration is only accessible to M7 core. M4 core only
94  has access to bus clock activation and deactivation.
95- **Static pre-compilation assignment**: Peripherals such as a UART are assigned in
96  devicetree before compilation. The user must ensure peripherals are not assigned
97  to both cores at the same time.
98- **Run time protection**: Interrupt-controller and GPIO configurations could be
99  accessed by both cores at run time. Accesses are protected by a hardware semaphore
100  to avoid potential concurrent access issues.
101
102Programming and Debugging
103*************************
104
105Applications for the ``arduino_giga_r1`` board should be built per core target,
106using either ``arduino_giga_r1/stm32h747xx/m7`` or ``arduino_giga_r1/stm32h747xx/m4`` as the target.
107
108See :ref:`build_an_application` for more information about application builds.
109
110Flashing
111========
112
113This board can be flashed either using dfu-util, or with an external debugging
114probe, such as a J-Link or Black Magic Probe, connected to the on board MIPI-10
115SWD port marked as "JTAG".
116
117.. note::
118
119   The board ships with a custom Arduino bootloader programmed in the first
120   flash page that can be triggered by double clicking the ``RST`` button. This
121   bootloader is USB-DFU compatible and supports programming both the internal
122   and external flash and is the one used by ``west flash`` by default. The
123   internal STM32 ROM bootloader can also be used by pressing ``RST`` while
124   holding the ``BOOT0`` button, this also supports USB-DFU but can only
125   program the internal flash and can overwrite the Arduino bootloader. More
126   details can be found in the "Boot0" section of the `Arduino GIGA Cheat
127   Sheet`_.
128
129First, connect the Arduino GIGA R1 board to your host computer using the USB
130port to prepare it for flashing. Double click the ``RST`` button to put the
131board into the Arduino Bootloader mode. Then build and flash your application.
132
133Here is an example for the :ref:`hello_world` application.
134
135.. zephyr-app-commands::
136   :zephyr-app: samples/hello_world
137   :board: arduino_giga_r1/stm32h747xx/m7
138   :goals: build flash
139
140Run a serial host program to connect with your board:
141
142.. code-block:: console
143
144   $ minicom -D /dev/ttyACM0
145
146You should see the following message on the console:
147
148.. code-block:: console
149
150   Hello World! arduino_giga_r1
151
152Similarly, you can build and flash samples on the M4 target.
153
154Here is an example for the :zephyr:code-sample:`blinky` application on M4 core.
155
156.. zephyr-app-commands::
157   :zephyr-app: samples/basic/blinky
158   :board: arduino_giga_r1/stm32h747xx/m4
159   :goals: build flash
160
161Debugging
162=========
163
164Debugging is supported by using ``west debug`` with an external probe such as a
165J-Link or Black Magic Probe, connected to the on board MIPI-10 SWD port marked
166as "JTAG". For example::
167
168  west debug -r jlink
169
170.. _Arduino GIGA website:
171   https://docs.arduino.cc/hardware/giga-r1-wifi
172
173.. _Arduino GIGA Cheat Sheet:
174   https://docs.arduino.cc/tutorials/giga-r1-wifi/cheat-sheet
175
176.. _STM32H747XI on www.st.com:
177   https://www.st.com/content/st_com/en/products/microcontrollers-microprocessors/stm32-32-bit-arm-cortex-mcus/stm32-high-performance-mcus/stm32h7-series/stm32h747-757/stm32h747xi.html
178
179.. _STM32H747xx reference manual:
180   https://www.st.com/resource/en/reference_manual/dm00176879.pdf
181
182.. _STM32H747xx datasheet:
183   https://www.st.com/resource/en/datasheet/stm32h747xi.pdf
184
185.. _dfu-util:
186   http://dfu-util.sourceforge.net/build.html
187