1.. zephyr:board:: nucleo_g071rb
2
3Overview
4********
5The Nucleo G071RB board features an ARM Cortex-M0+ based STM32G071RB MCU
6with a wide range of connectivity support and configurations. Here are
7some highlights of the Nucleo G071RB board:
8
9- STM32 microcontroller in QFP64 package
10- Two types of extension resources:
11
12  - Arduino Uno V3 connectivity
13  - ST morpho extension pin headers for full access to all STM32 I/Os
14
15- On-board ST-LINK/V2-1 debugger/programmer with SWD connector
16- Flexible board power supply:
17
18   - USB VBUS or external source(3.3V, 5V, 7 - 12V)
19   - Power management access point
20
21- Three LEDs: USB communication (LD1), user LED (LD4), power LED (LD3)
22- Two push-buttons: USER and RESET
23
24More information about the board can be found at the `Nucleo G071RB website`_.
25
26Hardware
27********
28Nucleo G071RB provides the following hardware components:
29
30- STM32 microcontroller in LQFP64 package
31- Two types of extension resources:
32
33  - Arduino* Uno V3 connectivity
34  - ST morpho extension pin headers for full access to all STM32 I/Os
35
36- ARM* mbed*
37- On-board ST-LINK/V2-1 debugger/programmer with SWD connector:
38
39  - Selection-mode switch to use the kit as a standalone ST-LINK/V2-1
40
41- Flexible board power supply:
42
43  - USB VBUS or external source (3.3V, 5V, 7 - 12V)
44  - Power management access point
45
46- Three LEDs:
47
48  - USB communication (LD1), user LED (LD4), power LED (LD3)
49
50- Two push-buttons: USER and RESET
51- USB re-enumeration capability. Three different interfaces supported on USB:
52
53  - Virtual COM port
54  - Mass storage
55  - Debug port
56
57- Support of wide choice of Integrated Development Environments (IDEs) including:
58
59  - IAR
60  - ARM Keil
61  - GCC-based IDEs
62
63More information about STM32G071RB can be found here:
64
65- `G071RB on www.st.com`_
66- `STM32G071 reference manual`_
67
68
69Supported Features
70==================
71
72The Zephyr nucleo_g071rb board configuration supports the following hardware features:
73
74+-----------+------------+-------------------------------------+
75| Interface | Controller | Driver/Component                    |
76+===========+============+=====================================+
77| MPU       | on-chip    | arm memory protection unit          |
78+-----------+------------+-------------------------------------+
79| NVIC      | on-chip    | nested vector interrupt controller  |
80+-----------+------------+-------------------------------------+
81| UART      | on-chip    | serial port-polling;                |
82|           |            | serial port-interrupt               |
83+-----------+------------+-------------------------------------+
84| PINMUX    | on-chip    | pinmux                              |
85+-----------+------------+-------------------------------------+
86| GPIO      | on-chip    | gpio                                |
87+-----------+------------+-------------------------------------+
88| I2C       | on-chip    | i2c                                 |
89+-----------+------------+-------------------------------------+
90| SPI       | on-chip    | spi                                 |
91+-----------+------------+-------------------------------------+
92| CLOCK     | on-chip    | reset and clock control             |
93+-----------+------------+-------------------------------------+
94| FLASH     | on-chip    | flash memory                        |
95+-----------+------------+-------------------------------------+
96| COUNTER   | on-chip    | rtc                                 |
97+-----------+------------+-------------------------------------+
98| WATCHDOG  | on-chip    | independent watchdog                |
99+-----------+------------+-------------------------------------+
100| PWM       | on-chip    | pwm                                 |
101+-----------+------------+-------------------------------------+
102| ADC       | on-chip    | adc                                 |
103+-----------+------------+-------------------------------------+
104| DAC       | on-chip    | dac                                 |
105+-----------+------------+-------------------------------------+
106| die-temp  | on-chip    | die temperature sensor              |
107+-----------+------------+-------------------------------------+
108| RTC       | on-chip    | rtc                                 |
109+-----------+------------+-------------------------------------+
110
111Other hardware features are not yet supported in this Zephyr port.
112
113The default configuration can be found in the defconfig file:
114:zephyr_file:`boards/st/nucleo_g071rb/nucleo_g071rb_defconfig`
115
116Connections and IOs
117===================
118
119Each of the GPIO pins can be configured by software as output (push-pull or open-drain), as
120input (with or without pull-up or pull-down), or as peripheral alternate function. Most of the
121GPIO pins are shared with digital or analog alternate functions. All GPIOs are high current
122capable except for analog inputs.
123
124Default Zephyr Peripheral Mapping:
125----------------------------------
126
127- UART_1 TX/RX : PC4/PC5
128- UART_2 TX/RX : PA2/PA3 (ST-Link Virtual Port Com)
129- I2C1 SCL/SDA : PB8/PB9 (Arduino I2C)
130- I2C2 SCL/SDA : PA11/PA12
131- SPI1 NSS/SCK/MISO/MOSI : PB0/PA5/PA6/PA7 (Arduino SPI)
132- SPI2 NSS/SCK/MISO/MOSI : PB12/PB13/PB14/PB15
133- USER_PB   : PC13
134- LD4       : PA5
135- PWM       : PA6
136- ADC1 IN0  : PA0
137- ADC1 IN1  : PA1
138- DAC1_OUT1 : PA4
139
140For more details please refer to `STM32 Nucleo-64 board User Manual`_.
141
142Programming and Debugging
143*************************
144
145Nucleo G071RB board includes an ST-LINK/V3 embedded debug tool interface.
146
147Applications for the ``nucleo_g071rb`` board configuration can be built and
148flashed in the usual way (see :ref:`build_an_application` and
149:ref:`application_run` for more details).
150
151Flashing
152========
153
154The board is configured to be flashed using west `STM32CubeProgrammer`_ runner,
155so its :ref:`installation <stm32cubeprog-flash-host-tools>` is required.
156
157Alternatively, OpenOCD, JLink, or pyOCD can also be used to flash the board using
158the ``--runner`` (or ``-r``) option:
159
160.. code-block:: console
161
162   $ west flash --runner openocd
163   $ west flash --runner jlink
164   $ west flash --runner pyocd
165
166Flashing an application to Nucleo G071RB
167----------------------------------------
168
169Here is an example for the :zephyr:code-sample:`blinky` application.
170
171.. zephyr-app-commands::
172   :zephyr-app: samples/basic/blinky
173   :board: nucleo_g071rb
174   :goals: build flash
175
176You will see the LED blinking every second.
177
178Debugging
179=========
180
181You can debug an application in the usual way.  Here is an example for the
182:zephyr:code-sample:`hello_world` application.
183
184.. zephyr-app-commands::
185   :zephyr-app: samples/hello_world
186   :board: nucleo_g071rb
187   :maybe-skip-config:
188   :goals: debug
189
190References
191**********
192
193.. target-notes::
194
195.. _Nucleo G071RB website:
196   https://www.st.com/en/evaluation-tools/nucleo-g071rb.html
197
198.. _STM32G071 reference manual:
199   https://www.st.com/resource/en/reference_manual/dm00371828.pdf
200
201.. _STM32 Nucleo-64 board User Manual:
202   https://www.st.com/resource/en/user_manual/dm00452640.pdf
203
204.. _G071RB on www.st.com:
205   https://www.st.com/en/microcontrollers/stm32g071rb.html
206
207.. _STM32CubeProgrammer:
208   https://www.st.com/en/development-tools/stm32cubeprog.html
209