1.. zephyr:board:: nucleo_f401re
2
3Overview
4********
5
6The Nucleo F401RE board features an ARM Cortex-M4 based STM32F401RE MCU
7with a wide range of connectivity support and configurations Here are
8some highlights of the Nucleo F401RE board:
9
10- STM32 microcontroller in QFP64 package
11- Two types of extension resources:
12
13  - Arduino Uno V3 connectivity
14  - ST morpho extension pin headers for full access to all STM32 I/Os
15
16- On-board ST-LINK/V2-1 debugger/programmer with SWD connector
17- Flexible board power supply:
18
19  - USB VBUS or external source(3.3V, 5V, 7 - 12V)
20  - Power management access point
21
22- Three LEDs: USB communication (LD1), user LED (LD2), power LED (LD3)
23- Two push-buttons: USER and RESET
24
25More information about the board can be found at the `Nucleo F401RE website`_.
26
27Hardware
28********
29
30Nucleo F401RE provides the following hardware components:
31
32- STM32F401RET6 in LQFP64 package
33- ARM |reg| 32-bit Cortex |reg|-M4 CPU with FPU
34- 84 MHz max CPU frequency
35- VDD from 1.7 V to 3.6 V
36- 512 KB Flash
37- 96 KB SRAM
38- GPIO with external interrupt capability
39- 12-bit ADC with 16 channels
40- RTC
41- Advanced-control Timer
42- General Purpose Timers (7)
43- Watchdog Timers (2)
44- USART/UART (3)
45- I2C (3)
46- SPI (4)
47- SDIO
48- USB 2.0 OTG FS
49- DMA Controller
50
51More information about STM32F401RE can be found here:
52
53- `STM32F401RE on www.st.com`_
54- `STM32F401 reference manual`_
55
56Supported Features
57==================
58
59The Zephyr nucleo_401re board configuration supports the following hardware features:
60
61+-----------+------------+-------------------------------------+
62| Interface | Controller | Driver/Component                    |
63+===========+============+=====================================+
64| NVIC      | on-chip    | nested vector interrupt controller  |
65+-----------+------------+-------------------------------------+
66| UART      | on-chip    | serial port-polling;                |
67|           |            | serial port-interrupt               |
68+-----------+------------+-------------------------------------+
69| PINMUX    | on-chip    | pinmux                              |
70+-----------+------------+-------------------------------------+
71| GPIO      | on-chip    | gpio                                |
72+-----------+------------+-------------------------------------+
73| PWM       | on-chip    | pwm                                 |
74+-----------+------------+-------------------------------------+
75| I2C       | on-chip    | i2c                                 |
76+-----------+------------+-------------------------------------+
77| ADC       | on-chip    | ADC Controller                      |
78+-----------+------------+-------------------------------------+
79| WATCHDOG  | on-chip    | System Window Watchdog              |
80+-----------+------------+-------------------------------------+
81| die-temp  | on-chip    | die temperature sensor              |
82+-----------+------------+-------------------------------------+
83| RTC       | on-chip    | rtc                                 |
84+-----------+------------+-------------------------------------+
85
86Other hardware features are not yet supported on Zephyr porting.
87
88The default configuration can be found in
89:zephyr_file:`boards/st/nucleo_f401re/nucleo_f401re_defconfig`
90
91
92Pin Mapping
93===========
94
95Nucleo F401RE Board has 6 GPIO controllers. These controllers are responsible for pin muxing,
96input/output, pull-up, etc.
97
98Available pins:
99---------------
100.. image:: img/nucleo_f401re_arduino.jpg
101   :align: center
102   :alt: Nucleo F401RE Arduino connectors
103.. image:: img/nucleo_f401re_morpho.jpg
104   :align: center
105   :alt: Nucleo F401RE Morpho connectors
106
107For more details please refer to `STM32 Nucleo-64 board User Manual`_.
108
109Default Zephyr Peripheral Mapping:
110----------------------------------
111
112- UART_1 TX/RX : PB6/PB7
113- UART_2 TX/RX : PA2/PA3 (ST-Link Virtual Port Com)
114- I2C1 SCL/SDA : PB8/PB9 (Arduino I2C)
115- SPI1 CS/SCK/MISO/MOSI : PB6/PA5/PA6/PA7 (Arduino SPI)
116- PWM_2_CH1 : PA0
117- USER_PB   : PC13
118- LD2       : PA5
119
120System Clock
121============
122
123Nucleo F401RE System Clock could be driven by internal or external oscillator,
124as well as main PLL clock. By default System clock is driven by PLL clock at 84MHz,
125driven by 8MHz high speed external clock.
126
127Serial Port
128===========
129
130Nucleo F401RE board has 3 UARTs. The Zephyr console output is assigned to UART2.
131Default settings are 115200 8N1.
132
133I2C
134===
135
136Nucleo F401RE board has up to 3 I2Cs. The default I2C mapping for Zephyr is:
137
138- I2C1_SCL : PB8
139- I2C1_SDA : PB9
140
141Programming and Debugging
142*************************
143
144Nucleo F401RE board includes an ST-LINK/V2-1 embedded debug tool interface.
145
146Applications for the ``nucleo_f401re`` board configuration can be built and
147flashed in the usual way (see :ref:`build_an_application` and
148:ref:`application_run` for more details).
149
150Flashing
151========
152
153The board is configured to be flashed using west `STM32CubeProgrammer`_ runner,
154so its :ref:`installation <stm32cubeprog-flash-host-tools>` is required.
155
156Alternatively, OpenOCD or JLink can also be used to flash the board using
157the ``--runner`` (or ``-r``) option:
158
159.. code-block:: console
160
161   $ west flash --runner openocd
162   $ west flash --runner jlink
163
164Flashing an application to Nucleo F401RE
165----------------------------------------
166
167Connect the Nucleo F401RE to your host computer using the USB port,
168then run a serial host program to connect with your Nucleo board:
169
170.. code-block:: console
171
172   $ minicom -D /dev/ttyACM0
173
174Now build and flash an application. Here is an example for
175:zephyr:code-sample:`hello_world`.
176
177.. zephyr-app-commands::
178   :zephyr-app: samples/hello_world
179   :board: nucleo_f401re
180   :goals: build flash
181
182You should see the following message on the console:
183
184.. code-block:: console
185
186   Hello World! arm
187
188
189Debugging
190=========
191
192You can debug an application in the usual way.  Here is an example for the
193:zephyr:code-sample:`hello_world` application.
194
195.. zephyr-app-commands::
196   :zephyr-app: samples/hello_world
197   :board: nucleo_f401re
198   :maybe-skip-config:
199   :goals: debug
200
201.. _Nucleo F401RE website:
202   https://www.st.com/en/evaluation-tools/nucleo-f401re.html
203
204.. _STM32 Nucleo-64 board User Manual:
205   https://www.st.com/resource/en/user_manual/dm00105823.pdf
206
207.. _STM32F401RE on www.st.com:
208   https://www.st.com/en/microcontrollers/stm32f401re.html
209
210.. _STM32F401 reference manual:
211   https://www.st.com/resource/en/reference_manual/dm00096844.pdf
212
213.. _STM32CubeProgrammer:
214   https://www.st.com/en/development-tools/stm32cubeprog.html
215