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
60.. zephyr:board-supported-hw::
61
62Connections and IOs
63===================
64
65Each of the GPIO pins can be configured by software as output (push-pull or open-drain), as
66input (with or without pull-up or pull-down), or as peripheral alternate function. Most of the
67GPIO pins are shared with digital or analog alternate functions. All GPIOs are high current
68capable except for analog inputs.
69
70Board connectors:
71-----------------
72.. image:: img/nucleo_l152re_connectors.jpg
73   :align: center
74   :alt: Nucleo L152RE connectors
75
76Default Zephyr Peripheral Mapping:
77----------------------------------
78
79- UART_2 TX/RX : PA2/PA3 (ST-Link Virtual COM Port)
80- I2C1 SCL/SDA : PB8/PB9 (Arduino I2C)
81- B1 (USER/blue) : PC13
82- LD1 : PA5
83- DAC : PA4
84- PWM_3_CH1 : PA6
85
86For more details please refer to `STM32 Nucleo-64 board User Manual`_.
87
88Programming and Debugging
89*************************
90
91.. zephyr:board-supported-runners::
92
93Nucleo L152RE board includes an ST-LINK/V2-1 embedded debug tool interface.
94
95Applications for the ``nucleo_l152re`` board configuration can be built and
96flashed in the usual way (see :ref:`build_an_application` and
97:ref:`application_run` for more details).
98
99Flashing
100========
101
102The board is configured to be flashed using west `STM32CubeProgrammer`_ runner,
103so its :ref:`installation <stm32cubeprog-flash-host-tools>` is required.
104
105Alternatively, openocd can also be used to flash the board using
106the ``--runner`` (or ``-r``) option:
107
108.. code-block:: console
109
110   $ west flash --runner openocd
111
112Flashing an application to Nucleo L152RE
113----------------------------------------
114
115Here is an example for the :zephyr:code-sample:`blinky` application.
116
117.. zephyr-app-commands::
118   :zephyr-app: samples/basic/blinky
119   :board: nucleo_l152re
120   :goals: build flash
121
122You will see the LED blinking every second.
123
124Debugging
125=========
126
127You can debug an application in the usual way. Here is an example for the
128:zephyr:code-sample:`hello_world` application.
129
130.. zephyr-app-commands::
131   :zephyr-app: samples/hello_world
132   :board: nucleo_l152re
133   :maybe-skip-config:
134   :goals: debug
135
136References
137**********
138
139.. target-notes::
140
141.. _Nucleo L152RE website:
142   https://www.st.com/en/evaluation-tools/nucleo-l152re.html
143
144.. _STM32L152 reference manual:
145   https://www.st.com/resource/en/reference_manual/cd00240193.pdf
146
147.. _STM32L152 data sheet:
148   https://www.st.com/resource/en/datasheet/stm32l152re.pdf
149
150.. _STM32 Nucleo-64 board User Manual:
151   https://www.st.com/resource/en/user_manual/dm00105823.pdf
152
153.. _STM32CubeProgrammer:
154   https://www.st.com/en/development-tools/stm32cubeprog.html
155