1.. _arduino_nicla_vision_board:
2
3Arduino Nicla Vision
4####################
5
6Overview
7********
8
9Arduino Nicla Vision is a development board by Arduino based on the
10STM32H747GAII, 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 Boot button
17- USB device
18- Murata Type 1DX Bluetooth + WiFi module (CYW4343W based)
19- GC2145 2 Megapixel Camera Sensor
20- SE050C2HQ1 Crypto IC
21- MP34DT06JTR Omnidirectional Microphone
22- VL53L1CBV0FY ToF Sensor
23- LSM6DSOXTR Gyro+Accelerometer Sensor
24
25.. image:: img/arduino_nicla_vision.webp
26     :align: center
27     :alt: Arduino Nicla Vision
28
29More information about the board, including the datasheet, pinout and
30schematics, can be found at the `Arduino Nicla Vision website`_.
31
32More information about STM32H747GAII6 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_nicla_vision/stm32h747xx/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| DCMI      | on-chip    | Parallel Camera interface           |
65+-----------+------------+-------------------------------------+
66| IPM       | on-chip    | virtual mailbox based on HSEM       |
67+-----------+------------+-------------------------------------+
68| RADIO     | Murata 1DX | WiFi and Bluetooth module           |
69+-----------+------------+-------------------------------------+
70
71And the ``arduino_nicla_vision/stm32h747xx/m4`` has the following
72support from Zephyr:
73
74+-----------+------------+-------------------------------------+
75| Interface | Controller | Driver/Component                    |
76+===========+============+=====================================+
77| NVIC      | on-chip    | nested vector interrupt controller  |
78+-----------+------------+-------------------------------------+
79| UART      | on-chip    | serial port-polling;                |
80|           |            | serial port-interrupt               |
81+-----------+------------+-------------------------------------+
82| PINMUX    | on-chip    | pinmux                              |
83+-----------+------------+-------------------------------------+
84| GPIO      | on-chip    | gpio                                |
85+-----------+------------+-------------------------------------+
86
87Other hardware features are not yet supported on Zephyr port.
88
89Fetch Binary Blobs
90******************
91
92The board Bluetooth/WiFi module requires fetching some binary blob files, to do
93that run the command:
94
95.. code-block:: console
96
97   west blobs fetch hal_infineon
98
99.. note:: Only Bluetooth functionality is currently supported.
100
101Resources sharing
102=================
103
104The dual core nature of STM32H747 SoC requires sharing HW resources between the
105two cores. This is done in 3 ways:
106
107- **Compilation**: Clock configuration is only accessible to M7 core. M4 core only
108  has access to bus clock activation and deactivation.
109- **Static pre-compilation assignment**: Peripherals such as a UART are assigned in
110  devicetree before compilation. The user must ensure peripherals are not assigned
111  to both cores at the same time.
112- **Run time protection**: Interrupt-controller and GPIO configurations could be
113  accessed by both cores at run time. Accesses are protected by a hardware semaphore
114  to avoid potential concurrent access issues.
115
116Programming and Debugging
117*************************
118
119Applications for the ``arduino_nicla_vision`` board should be built per core target,
120using either ``arduino_nicla_vision/stm32h747xx/m7`` or ``arduino_nicla_vision/stm32h747xx/m4`` as the target.
121
122See :ref:`build_an_application` for more information about application builds.
123
124Flashing
125========
126
127This board can be flashed either using dfu-util, or with an external debugging
128probe, such as a J-Link or Black Magic Probe, connected to the on board MIPI-10
129SWD port marked as "JTAG".
130
131.. note::
132
133   The board ships with a custom Arduino bootloader programmed in the first
134   flash page that can be triggered by double clicking the ``RST`` button. This
135   bootloader is USB-DFU compatible and supports programming both the internal
136   and external flash and is the one used by ``west flash`` by default.
137
138First, connect the Arduino Nicla Vision board to your host computer using the USB
139port to prepare it for flashing. Double click the ``RST`` button to put the
140board into the Arduino Bootloader mode. Then build and flash your application.
141
142Here is an example for the :zephyr:code-sample:`hello_world` application.
143
144.. zephyr-app-commands::
145   :zephyr-app: samples/hello_world
146   :board: arduino_nicla_vision/stm32h747xx/m7
147   :goals: build flash
148
149Run a serial host program to connect with your board:
150
151.. code-block:: console
152
153   $ minicom -D /dev/ttyACM0
154
155You should see the following message on the console:
156
157.. code-block:: console
158
159   Hello World! arduino_nicla_vision
160
161Similarly, you can build and flash samples on the M4 target.
162
163Here is an example for the :zephyr:code-sample:`blinky` application on M4 core.
164
165.. zephyr-app-commands::
166   :zephyr-app: samples/basic/blinky
167   :board: arduino_nicla_vision/stm32h747xx/m4
168   :goals: build flash
169
170Debugging
171=========
172
173Debugging is supported by using ``west debug`` with an external probe such as a
174J-Link or Black Magic Probe, connected to the on board through the edge eslov pins
175as "SWD". For example::
176
177  west debug -r jlink
178
179.. _Arduino Nicla Vision website:
180   https://docs.arduino.cc/hardware/nicla-vision/
181
182.. _Arduino Nicla Vision User Manual:
183   https://docs.arduino.cc/tutorials/nicla-vision/user-manual/
184
185.. _STM32H747XI on www.st.com:
186   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
187
188.. _STM32H747xx reference manual:
189   https://www.st.com/resource/en/reference_manual/dm00176879.pdf
190
191.. _STM32H747xx datasheet:
192   https://www.st.com/resource/en/datasheet/stm32h747xi.pdf
193
194.. _dfu-util:
195   http://dfu-util.sourceforge.net/build.html
196