1.. _nucleo_l452re_board:
2
3ST Nucleo L452RE
4################
5
6Overview
7********
8
9The Nucleo L452RE(-P) boards feature an ARM Cortex-M4 based STM32L452RE MCU
10with a wide range of connectivity support and configurations. There are two variants:
11
12- ST Nucleo L452RE
13- ST Nucleo L452RE-P
14
15Here some highlights of these boards:
16
17- STM32 microcontroller in LQFP64 package
18- Arduino Uno V3 connectivity
19- On-board ST-LINK/V2-1 debugger/programmer with SWD connector
20- Flexible board power supply:
21
22  - USB VBUS or external source(3.3V, 5V, 7 - 12V)
23  - Power management access point
24
25- Three LEDs: USB communication (LD1), user LED (LD2), power LED (LD3)
26- One push-button: RESET
27
28.. image:: img/nucleo_l452re_p.jpg
29  :align: center
30  :alt: Nucleo L452RE-P
31
32The main difference between the ST Nucleo L452RE and the L452RE-P (note the missing
33"-P" at the end) lays in the External Switched Mode Power Supply (SMPS) included in
34the P series.
35
36More information about the boards can be found at the `Nucleo L452RE website`_ and
37the `Nucleo L452RE-P website`_.
38
39Hardware
40********
41
42The STM32L452RE SoC provides the following hardware IPs:
43
44- Ultra-low-power with FlexPowerControl (down to 28 nA Standby mode and 84
45  |micro| A/MHz run mode)
46- Core: ARM |reg| 32-bit Cortex |reg| -M4 CPU with FPU, frequency up to 80 MHz,
47  100DMIPS/1.25DMIPS/MHz (Dhrystone 2.1)
48- Clock Sources:
49
50  - 4 to 48 MHz crystal oscillator
51  - 32 kHz crystal oscillator for RTC (LSE)
52  - Internal 16 MHz factory-trimmed RC ( |plusminus| 1%)
53  - Internal low-power 32 kHz RC ( |plusminus| 5%)
54  - Internal multispeed 100 kHz to 48 MHz oscillator, auto-trimmed by
55    LSE (better than |plusminus| 0.25 % accuracy)
56  - 2 PLLs for system clock, USB, audio, ADC
57
58- RTC with HW calendar, alarms and calibration
59- Up to 3 capacitive sensing channels: support touchkey, linear and rotary touch sensors
60- 12x timers:
61
62  - 1x 16-bit advanced motor-control
63  - 1x 32-bit and 3x 16-bit general purpose
64  - 2x 16-bit basic
65  - 2x low-power 16-bit timers (available in Stop mode)
66  - 2x watchdogs
67  - SysTick timer
68
69- Up to 26 fast I/Os, most 5 V-tolerant
70- Memories
71
72  - Up to 512 KB single bank Flash, proprietary code readout protection
73  - 160 KB of SRAM including 32 KB with hardware parity check
74  - Quad SPI memory interface
75
76- Rich analog peripherals (independent supply)
77
78  - 1x 12-bit ADC 5 MSPS, up to 16-bit with hardware oversampling, 200
79    |micro| A/MSPS
80  - 2x 12-bit DAC, low-power sample and hold
81  - 1x operational amplifiers with built-in PGA
82  - 2x ultra-low-power comparators
83
84- 17x communication interfaces
85  - USB 2.0 full-speed crystal less solution with LPM and BCD
86  - 1x SAI (serial audio interface)
87  - 4x I2C FM+(1 Mbit/s), SMBus/PMBus
88  - 3x USARTs (ISO 7816, LIN, IrDA, modem)
89  - 1x UART (LIN, IrDA, modem)
90  - 1x LPUART (Stop 2 wake-up)
91  - 3x SPIs (and 1x Quad SPI)
92  - CAN (2.0B Active) and SDMMC interface
93  - IRTIM (Infrared interface)
94
95- 14-channel DMA controller
96- True random number generator
97- CRC calculation unit, 96-bit unique ID
98- Development support: serial wire debug (SWD), JTAG, Embedded Trace Macrocell*
99
100
101More information about STM32L452RE can be found here:
102
103- `STM32L452RE on www.st.com`_
104- `STM32L452 reference manual`_
105
106Supported Features
107==================
108
109The Zephyr nucleo_l452re board configuration supports the following hardware features:
110
111+-----------+------------+-------------------------------------+
112| Interface | Controller | Driver/Component                    |
113+===========+============+=====================================+
114| NVIC      | on-chip    | nested vector interrupt controller  |
115+-----------+------------+-------------------------------------+
116| UART      | on-chip    | serial port-polling;                |
117|           |            | serial port-interrupt               |
118+-----------+------------+-------------------------------------+
119| PINMUX    | on-chip    | pinmux                              |
120+-----------+------------+-------------------------------------+
121| GPIO      | on-chip    | gpio                                |
122+-----------+------------+-------------------------------------+
123| I2C       | on-chip    | i2c                                 |
124+-----------+------------+-------------------------------------+
125| PWM       | on-chip    | pwm                                 |
126+-----------+------------+-------------------------------------+
127| CAN       | on-chip    | can                                 |
128+-----------+------------+-------------------------------------+
129
130.. note:: CAN feature requires CAN transceiver
131
132Other hardware features are not yet supported on this Zephyr port.
133
134The default configuration can be found in the defconfig file:
135``boards/arm/nucleo_l452re/nucleo_l452re_defconfig``
136
137
138Connections and IOs
139===================
140
141Nucleo L452RE Board has 6 GPIO controllers. These controllers are responsible for pin muxing,
142input/output, pull-up, etc.
143
144Available pins:
145---------------
146.. image:: img/nucleo_l452re_pinout.jpg
147   :align: center
148   :alt: Nucleo L452RE Pinout
149
150.. image:: img/nucleo_l452re_p_pinout.jpg
151   :align: center
152   :alt: Nucleo L452RE-P Pinout
153
154For more details please refer to `ST Nucleo L452RE User Manual`_ or
155`ST Nucleo L452RE-P User Manual`_.
156
157Default Zephyr Peripheral Mapping:
158----------------------------------
159
160- UART_1_TX : PA9
161- UART_1_RX : PA10
162- UART_2_TX : PA2
163- UART_2_RX : PA3
164- I2C_1_SCL : PB8
165- I2C_1_SDA : PB7
166- PWM_2_CH1 : PA0
167- SPI_NSS : PB6
168- SPI_SCK : PA5
169- SPI_MISO : PA6
170- SPI_MOSI : PA7
171- CAN_TX : PA11
172- CAN_RX : PA12
173- LD2 : PA5
174
175System Clock
176------------
177
178Nucleo L452RE System Clock could be driven by internal or external oscillator,
179as well as main PLL clock. By default System clock is driven by PLL clock at 80MHz,
180driven by 16MHz high speed internal oscillator.
181
182Serial Port
183-----------
184
185Nucleo L452RE board has 3 U(S)ARTs. The Zephyr console output is assigned to UART2.
186Default settings are 115200 8N1.
187
188
189Programming and Debugging
190*************************
191
192Applications for the ``nucleo_l452re`` board configuration can be built and
193flashed in the usual way (see :ref:`build_an_application` and
194:ref:`application_run` for more details).
195
196Flashing
197========
198
199Nucleo L452RE board includes an ST-LINK/V2-1 embedded debug tool
200interface.  This interface is supported by the openocd version
201included in the Zephyr SDK since v0.9.2.
202
203Flashing an application to Nucleo L452RE
204----------------------------------------
205
206Connect the Nucleo L452RE to your host computer using the USB port,
207then run a serial host program to connect with your Nucleo board.
208
209.. code-block:: console
210
211   $ minicom -D /dev/ttyACM0
212
213Now build and flash an application. Here is an example for
214:ref:`hello_world`.
215
216.. zephyr-app-commands::
217   :zephyr-app: samples/hello_world
218   :board: nucleo_l452re
219   :goals: build flash
220
221You should see the following message on the console:
222
223.. code-block:: console
224
225   $ Hello World! arm
226
227
228Debugging
229=========
230
231You can debug an application in the usual way.  Here is an example for the
232:ref:`hello_world` application.
233
234.. zephyr-app-commands::
235   :zephyr-app: samples/hello_world
236   :board: nucleo_l452re
237   :maybe-skip-config:
238   :goals: debug
239
240.. _Nucleo L452RE website:
241   https://www.st.com/en/evaluation-tools/nucleo-l452re.html
242
243.. _Nucleo L452RE-P website:
244   https://www.st.com/en/evaluation-tools/nucleo-l452re-p.html
245
246.. _ST Nucleo L452RE User Manual:
247   https://www.st.com/resource/en/user_manual/dm00105823.pdf
248
249.. _ST Nucleo L452RE-P User Manual:
250   https://www.st.com/resource/en/user_manual/dm00387966.pdf
251
252.. _STM32L452RE on www.st.com:
253   https://www.st.com/en/microcontrollers-microprocessors/stm32l452re.html
254
255.. _STM32L452 reference manual:
256   https://www.st.com/resource/en/reference_manual/dm00151940.pdf
257