1.. zephyr:board:: nucleo_l4r5zi
2
3Overview
4********
5
6The Nucleo L4R5ZI board features an ARM Cortex-M4 based STM32L4R5ZI MCU
7with a wide range of connectivity support and configurations. Here are
8some highlights of the Nucleo L4R5ZI board:
9
10
11- STM32 microcontroller in LQFP144 package
12- Two types of extension resources:
13
14  - Arduino Uno V3 connectivity
15  - ST morpho extension pin headers for full access to all STM32 I/Os
16
17- On-board ST-LINK/V2-1 debugger/programmer with SWD connector
18- Flexible board power supply:
19
20  - USB VBUS or external source(3.3V, 5V, 7 - 12V)
21  - Power management access point
22
23- Three User LEDs: LD1 (Green), LD2 (Blue), LD3 (Red)
24- Two push-buttons: USER and RESET
25
26More information about the board can be found at the `Nucleo L4R5ZI website`_.
27
28Hardware
29********
30
31The STM32L4R5ZI SoC provides the following hardware IPs:
32
33- Ultra-low-power with FlexPowerControl (down to 130 nA Standby mode
34  and 100 uA/MHz run mode)
35- Core: ARM |reg| 32-bit Cortex |reg|-M4 CPU with FPU, adaptive
36  real-time accelerator (ART Accelerator) allowing 0-wait-state
37  execution from Flash memory, frequency up to 120 MHz, MPU, 150
38  DMIPS/1.25 DMIPS/MHz (Dhrystone 2.1), and DSP instructions
39- Clock Sources:
40
41  - 4 to 48 MHz crystal oscillator
42  - 32 kHz crystal oscillator for RTC (LSE)
43  - Internal 16 MHz factory-trimmed RC ( |plusminus| 1%)
44  - Internal low-power 32 kHz RC ( |plusminus| 5%)
45  - Internal multispeed 100 kHz to 48 MHz oscillator, auto-trimmed by
46    LSE (better than |plusminus| 0.25 % accuracy)
47  - Internal 48 MHz with clock recovery
48  - 3 PLLs for system clock, USB, audio, ADC
49
50- RTC with HW calendar, alarms and calibration
51- Up to 24 capacitive sensing channels: support touchkey, linear and
52  rotary touch sensors
53- Advanced graphics features
54
55  - Chrom-ART Accelerator™ (DMA2D) for enhanced graphic content creation
56  - Chrom-GRC™ (GFXMMU) allowing up to 20% of graphic resources optimization
57  - MIPI® DSI Host controller with two DSI lanes running at up to 500
58    Mbits/s each
59  - LCD-TFT controller
60
61- 16x timers
62
63  - 2 x 16-bit advanced motor-control
64  - 2 x 32-bit and 5 x 16-bit general purpose
65  - 2x 16-bit basic
66  - 2x low-power 16-bit timers (available in Stop mode)
67  - 2x watchdogs
68  - SysTick timer
69
70- Up to 136 fast I/Os, most 5 V-tolerant, up to 14 I/Os with
71  independent supply down to 1.08 V
72- Memories
73
74  - 2-Mbyte Flash, 2 banks read-while-write, proprietary code readout protection
75  - 640 Kbytes of SRAM including 64 Kbytes with hardware parity check
76  - External memory interface for static memories supporting SRAM,
77    PSRAM, NOR, NAND and FRAM memories
78  - 2 x OctoSPI memory interface
79
80- 4x digital filters for sigma delta modulator
81- Rich analog peripherals (independent supply)
82
83  - 12-bit ADC 5 Msps, up to 16-bit with hardware oversampling, 200 μA/Msps
84  - 2x 12-bit DAC, low-power sample and hold
85  - 2x operational amplifiers with built-in PGA
86  - 2x ultra-low-power comparators
87
88- 20x communication interfaces
89
90  - USB OTG 2.0 full-speed, LPM and BCD
91  - 2x SAIs (serial audio interface)
92  - 4x I2C FM+(1 Mbit/s), SMBus/PMBus
93  - 6x USARTs (ISO 7816, LIN, IrDA, modem)
94  - 3x SPIs (5x SPIs with the dual OctoSPI)
95  - CAN (2.0B Active) and SDMMC
96
97- 14-channel DMA controller
98- True random number generator
99- CRC calculation unit, 96-bit unique ID
100- 8- to 14-bit camera interface up to 32 MHz (black and white) or 10 MHz (color)
101- Development support: serial wire debug (SWD), JTAG, Embedded Trace
102  Macrocell (ETM)
103
104More information about STM32L4R5ZI can be found here:
105
106- `STM32L4R5ZI on www.st.com`_
107- `STM32L4R5 reference manual`_
108
109Supported Features
110==================
111
112The Zephyr nucleo_l4r5zi board configuration supports the following
113hardware features:
114
115+-----------+------------+-------------------------------------+
116| Interface | Controller | Driver/Component                    |
117+===========+============+=====================================+
118| NVIC      | on-chip    | nested vector interrupt controller  |
119+-----------+------------+-------------------------------------+
120| UART      | on-chip    | serial port-polling;                |
121|           |            | serial port-interrupt               |
122+-----------+------------+-------------------------------------+
123| PINMUX    | on-chip    | pinmux                              |
124+-----------+------------+-------------------------------------+
125| GPIO      | on-chip    | gpio                                |
126+-----------+------------+-------------------------------------+
127| I2C       | on-chip    | i2c                                 |
128+-----------+------------+-------------------------------------+
129| PWM       | on-chip    | pwm                                 |
130+-----------+------------+-------------------------------------+
131| SPI       | on-chip    | spi                                 |
132+-----------+------------+-------------------------------------+
133| USB       | on-chip    | usb                                 |
134+-----------+------------+-------------------------------------+
135| ADC       | on-chip    | adc                                 |
136+-----------+------------+-------------------------------------+
137| RTC       | on-chip    | rtc                                 |
138+-----------+------------+-------------------------------------+
139
140Other hardware features are not yet supported on this Zephyr port.
141
142The default configuration can be found in the defconfig file:
143:zephyr_file:`boards/st/nucleo_l4r5zi/nucleo_l4r5zi_defconfig`
144
145
146Connections and IOs
147===================
148
149Nucleo L4R5ZI Board has 8 GPIO controllers. These controllers are
150responsible for pin muxing, input/output, pull-up, etc.
151
152Available pins:
153---------------
154.. image:: img/nucleo144_layout.jpg
155     :align: center
156     :alt: Nucleo L4R5ZI Arduino connectors
157
158For more details please refer to `STM32 Nucleo-144 board User Manual`_.
159
160Default Zephyr Peripheral Mapping:
161----------------------------------
162
163.. rst-class:: rst-columns
164
165- UART_1_TX : PA9
166- UART_1_RX : PA10
167- UART_2_TX : PA2
168- UART_2_RX : PA3
169- UART_3_TX : PB10
170- UART_3_RX : PB11
171- I2C_1_SCL : PB6
172- I2C_1_SDA : PB7
173- SPI_1_NSS : PD14
174- SPI_1_SCK : PA5
175- SPI_1_MISO : PA6
176- SPI_1_MOSI : PA7
177- SPI_2_NSS : PB12
178- SPI_2_SCK : PB13
179- SPI_2_MISO : PB14
180- SPI_2_MOSI : PB15
181- SPI_3_NSS : PB12
182- SPI_3_SCK : PC10
183- SPI_3_MISO : PC11
184- SPI_3_MOSI : PC12
185- PWM_2_CH1 : PA0
186- USER_PB : PC13
187- LD1 : PC7
188- LD2 : PB7
189- LD3 : PB14
190- USB DM : PA11
191- USB DP : PA12
192- ADC1 : PC0
193
194System Clock
195------------
196
197Nucleo L4R5ZI System Clock could be driven by internal or external
198oscillator, as well as main PLL clock. By default, the System clock is
199driven by the PLL clock at 80MHz, driven by a 16MHz high speed
200internal oscillator. The clock can be boosted to 120MHz if boost mode
201is selected.
202
203Serial Port
204-----------
205
206Nucleo L4R5ZI board has 5 U(S)ARTs. The Zephyr console output is
207assigned to UART2.  Default settings are 115200 8N1.
208
209Network interface
210-----------------
211
212Ethernet over USB is configured as the default network interface (EEM)
213
214Programming and Debugging
215*************************
216
217The NUCLEO-L4R5ZI board includes a ST-LINK/V2 embedded debug tool interface.
218
219Flashing
220========
221
222The board is configured to be flashed using west `STM32CubeProgrammer`_ runner,
223so its :ref:`installation <stm32cubeprog-flash-host-tools>` is required.
224
225Alternatively, OpenOCD or JLink can also be used to flash the board using
226the ``--runner`` (or ``-r``) option:
227
228.. code-block:: console
229
230   $ west flash --runner openocd
231   $ west flash --runner jlink
232
233Flashing an application to Nucleo L4R4ZI
234----------------------------------------
235
236Connect the Nucleo L4R5ZI to your host computer using the USB port.
237Then build and flash an application.
238
239Here is an example for the :zephyr:code-sample:`hello_world` application.
240
241Run a serial host program to connect with your Nucleo board:
242
243.. code-block:: console
244
245   $ minicom -D /dev/ttyACM0
246
247Then build and flash the application.
248
249.. zephyr-app-commands::
250   :zephyr-app: samples/hello_world
251   :board: nucleo_l4r5zi
252   :goals: build flash
253
254You should see the following message on the console:
255
256.. code-block:: console
257
258   Hello World! arm
259
260.. _Nucleo L4R5ZI website:
261   https://www.st.com/en/evaluation-tools/nucleo-l4r5zi.html
262
263.. _STM32 Nucleo-144 board User Manual:
264   https://www.st.com/resource/en/user_manual/dm00368330.pdf
265
266.. _STM32L4R5ZI on www.st.com:
267   https://www.st.com/en/microcontrollers/stm32l4r5zi.html
268
269.. _STM32L4R5 reference manual:
270   https://www.st.com/resource/en/reference_manual/DM00310109.pdf
271
272.. _STM32 ST-LINK utility:
273   https://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-programmers/stsw-link004.html
274
275.. _STM32CubeProgrammer:
276   https://www.st.com/en/development-tools/stm32cubeprog.html
277