1.. zephyr:board:: nucleo_l152re
2
3Overview
4********
5The STM32 Nucleo-64 development board with STM32L152RE MCU, supports Arduino™ and ST morpho connectivity.
6
7The STM32 Nucleo board provides an affordable, and flexible way for users to try out new concepts,
8and build prototypes with the STM32 microcontroller, choosing from the various
9combinations of performance, power consumption and features.
10
11The Arduino Uno V3 connectivity support and the ST morpho headers allow easy functionality
12expansion of the STM32 Nucleo open development platform with a wide choice of
13specialized shields.
14
15The STM32 Nucleo board integrates the ST-LINK/V2-1 debugger and programmer.
16
17The STM32 Nucleo board comes with the STM32 comprehensive software HAL library together
18with various packaged software examples.
19
20More information about the board can be found at the `Nucleo L152RE website`_.
21
22Hardware
23********
24Nucleo L152RE provides the following hardware components:
25
26- STM32 microcontroller in QFP64 package
27- Two types of extension resources:
28
29  - Arduino Uno V3 connectivity
30  - ST morpho extension pin headers for full access to all STM32 I/Os
31
32- On-board ST-LINK/V2-1 debugger/programmer with SWD connector:
33
34  - Selection-mode switch to use the kit as a standalone ST-LINK/V2-1
35
36- Flexible board power supply:
37
38  - USB VBUS or external source (3.3V, 5V, 7 - 12V)
39  - Power management access point
40
41- Three LEDs:
42
43  - USB communication (LD1), user LED (LD2), power LED (LD3)
44
45- Two push-buttons: B1 (USER/blue) and B2 (RESET/black)
46- USB re-enumeration capability. Three different interfaces supported on USB:
47
48  - Virtual COM port
49  - Mass storage
50  - Debug port
51
52More information about STM32L152RE can be found here:
53
54- `STM32L152 reference manual`_
55- `STM32L152 data sheet`_
56
57Supported Features
58==================
59
60The Zephyr nucleo_l152re board configuration supports the following hardware features:
61
62+-----------+------------+-------------------------------------+
63| Interface | Controller | Driver/Component                    |
64+===========+============+=====================================+
65| NVIC      | on-chip    | nested vector interrupt controller  |
66+-----------+------------+-------------------------------------+
67| CLOCK     | on-chip    | reset and clock control             |
68+-----------+------------+-------------------------------------+
69| PINMUX    | on-chip    | pinmux                              |
70+-----------+------------+-------------------------------------+
71| UART      | on-chip    | serial port-polling;                |
72|           |            | serial port-interrupt               |
73+-----------+------------+-------------------------------------+
74| GPIO      | on-chip    | gpio                                |
75+-----------+------------+-------------------------------------+
76| I2C       | on-chip    | i2c controller                      |
77+-----------+------------+-------------------------------------+
78| EEPROM    | on-chip    | eeprom                              |
79+-----------+------------+-------------------------------------+
80| WATCHDOG  | on-chip    | independent watchdog                |
81+-----------+------------+-------------------------------------+
82| FLASH     | on-chip    | flash memory                        |
83+-----------+------------+-------------------------------------+
84| COUNTER   | on-chip    | rtc                                 |
85+-----------+------------+-------------------------------------+
86| ADC       | on-chip    | ADC Controller                      |
87+-----------+------------+-------------------------------------+
88| DAC       | on-chip    | DAC Controller                      |
89+-----------+------------+-------------------------------------+
90| PWM       | on-chip    | PWM                                 |
91+-----------+------------+-------------------------------------+
92| DMA       | on-chip    | Direct Memory Access                |
93+-----------+------------+-------------------------------------+
94| die-temp  | on-chip    | die temperature sensor              |
95+-----------+------------+-------------------------------------+
96| RTC       | on-chip    | rtc                                 |
97+-----------+------------+-------------------------------------+
98
99Other hardware features are not yet supported in this Zephyr port.
100
101The default configuration can be found in
102:zephyr_file:`boards/st/nucleo_l152re/nucleo_l152re_defconfig`
103
104Connections and IOs
105===================
106
107Each of the GPIO pins can be configured by software as output (push-pull or open-drain), as
108input (with or without pull-up or pull-down), or as peripheral alternate function. Most of the
109GPIO pins are shared with digital or analog alternate functions. All GPIOs are high current
110capable except for analog inputs.
111
112Board connectors:
113-----------------
114.. image:: img/nucleo_l152re_connectors.jpg
115   :align: center
116   :alt: Nucleo L152RE connectors
117
118Default Zephyr Peripheral Mapping:
119----------------------------------
120
121- UART_2 TX/RX : PA2/PA3 (ST-Link Virtual COM Port)
122- I2C1 SCL/SDA : PB8/PB9 (Arduino I2C)
123- B1 (USER/blue) : PC13
124- LD1 : PA5
125- DAC : PA4
126- PWM_3_CH1 : PA6
127
128For more details please refer to `STM32 Nucleo-64 board User Manual`_.
129
130Programming and Debugging
131*************************
132
133Nucleo L152RE board includes an ST-LINK/V2-1 embedded debug tool interface.
134
135Applications for the ``nucleo_l152re`` board configuration can be built and
136flashed in the usual way (see :ref:`build_an_application` and
137:ref:`application_run` for more details).
138
139Flashing
140========
141
142The board is configured to be flashed using west `STM32CubeProgrammer`_ runner,
143so its :ref:`installation <stm32cubeprog-flash-host-tools>` is required.
144
145Alternatively, openocd can also be used to flash the board using
146the ``--runner`` (or ``-r``) option:
147
148.. code-block:: console
149
150   $ west flash --runner openocd
151
152Flashing an application to Nucleo L152RE
153----------------------------------------
154
155Here is an example for the :zephyr:code-sample:`blinky` application.
156
157.. zephyr-app-commands::
158   :zephyr-app: samples/basic/blinky
159   :board: nucleo_l152re
160   :goals: build flash
161
162You will see the LED blinking every second.
163
164Debugging
165=========
166
167You can debug an application in the usual way. Here is an example for the
168:zephyr:code-sample:`hello_world` application.
169
170.. zephyr-app-commands::
171   :zephyr-app: samples/hello_world
172   :board: nucleo_l152re
173   :maybe-skip-config:
174   :goals: debug
175
176References
177**********
178
179.. target-notes::
180
181.. _Nucleo L152RE website:
182   https://www.st.com/en/evaluation-tools/nucleo-l152re.html
183
184.. _STM32L152 reference manual:
185   https://www.st.com/resource/en/reference_manual/cd00240193.pdf
186
187.. _STM32L152 data sheet:
188   https://www.st.com/resource/en/datasheet/stm32l152re.pdf
189
190.. _STM32 Nucleo-64 board User Manual:
191   https://www.st.com/resource/en/user_manual/dm00105823.pdf
192
193.. _STM32CubeProgrammer:
194   https://www.st.com/en/development-tools/stm32cubeprog.html
195