1.. _nucleo_l031k6_board:
2
3ST Nucleo L031K6
4################
5
6Overview
7********
8The STM32 Nucleo-32 development board with STM32L031K6 MCU, supports Arduino Nano V3 connectivity.
9
10The STM32 Nucleo board provides an affordable, and flexible way for users to try out new concepts,
11and build prototypes with the STM32 microcontroller, choosing from the various
12combinations of performance, power consumption, and features.
13
14The Arduino* Nano V3 connectivity support allow easy functionality
15expansion of the STM32 Nucleo open development platform with a wide choice of
16specialized shields.
17
18The STM32 Nucleo board integrates the ST-LINK/V2-1 debugger and programmer.
19
20The STM32 Nucleo board comes with the STM32 comprehensive software HAL library together
21with various packaged software examples.
22
23.. image:: img/nucleo_l031k6.jpg
24   :align: center
25   :alt: Nucleo L031K6
26
27More information about the board can be found at the `Nucleo L031K6 website`_.
28
29Hardware
30********
31Nucleo L031K6 provides the following hardware components:
32
33- STM32 microcontroller in LQFP32 package
34- Extension resource:
35
36  - Arduino* Nano V3 connectivity
37
38- On-board ST-LINK/V2-1 debugger/programmer with SWD connector:
39
40  - Selection-mode switch to use the kit as a standalone ST-LINK/V2-1
41
42- Flexible board power supply:
43
44  - USB VBUS or external source (3.3V, 5V, 7 - 12V)
45  - Power management access point
46
47- Three LEDs:
48
49  - USB communication (LD1), user LED (LD2), power LED (LD3)
50
51- One push-button: RESET
52
53- USB re-enumeration capability. Three different interfaces supported on USB:
54
55  - Virtual COM port
56  - Mass storage
57  - Debug port
58
59More information about STM32L031K6 can be found in the
60`STM32L0x1 reference manual`_
61
62Supported Features
63==================
64
65The Zephyr nucleo_l031k6 board configuration supports the following hardware features:
66
67+-----------+------------+-------------------------------------+
68| Interface | Controller | Driver/Component                    |
69+===========+============+=====================================+
70| NVIC      | on-chip    | nested vector interrupt controller  |
71+-----------+------------+-------------------------------------+
72| UART      | on-chip    | serial port-polling;                |
73|           |            | serial port-interrupt               |
74+-----------+------------+-------------------------------------+
75| PINMUX    | on-chip    | pinmux                              |
76+-----------+------------+-------------------------------------+
77| GPIO      | on-chip    | gpio                                |
78+-----------+------------+-------------------------------------+
79| CLOCK     | on-chip    | reset and clock control             |
80+-----------+------------+-------------------------------------+
81| I2C       | on-chip    | i2c controller                      |
82+-----------+------------+-------------------------------------+
83| SPI       | on-chip    | spi controller                      |
84+-----------+------------+-------------------------------------+
85| EEPROM    | on-chip    | eeprom                              |
86+-----------+------------+-------------------------------------+
87
88Other hardware features are not yet supported in this Zephyr port.
89
90The default configuration can be found in the defconfig file:
91``boards/arm/nucleo_l031k6/nucleo_l031k6_defconfig``
92
93Connections and IOs
94===================
95
96Each of the GPIO pins can be configured by software as output (push-pull or open-drain), as
97input (with or without pull-up or pull-down), or as peripheral alternate function. Most of the
98GPIO pins are shared with digital or analog alternate functions. All GPIOs are high current
99capable except for analog inputs.
100
101Default Zephyr Peripheral Mapping:
102----------------------------------
103
104- UART_2 TX/RX : PA2/PA15 (ST-Link Virtual Port Com)
105- I2C1 SCL/SDA : PA9/PA10 (Arduino I2C)
106- SPI1 SCK/MISO/MOSI : PA5/PA6/PA7 (Arduino SPI)
107- LD2       : PB3
108
109For mode details please refer to `STM32 Nucleo-32 board User Manual`_.
110
111Programming and Debugging
112*************************
113
114Applications for the ``nucleo_l031k6`` board configuration can be built and
115flashed in the usual way (see :ref:`build_an_application` and
116:ref:`application_run` for more details).
117
118Flashing
119========
120
121Nucleo L031K6 board includes an ST-LINK/V2-1 embedded debug tool interface.
122This interface is supported by the openocd version included in the Zephyr SDK.
123
124Flashing an application to Nucleo L031K6
125----------------------------------------
126
127Here is an example for the :zephyr:code-sample:`blinky` application.
128
129.. zephyr-app-commands::
130   :zephyr-app: samples/basic/blinky
131   :board: nucleo_l031k6
132   :goals: build flash
133
134You will see the LED blinking every second.
135
136Debugging
137=========
138
139You can debug an application in the usual way.  Here is an example for the
140:ref:`hello_world` application.
141
142.. zephyr-app-commands::
143   :zephyr-app: samples/hello_world
144   :board: nucleo_l031k6
145   :maybe-skip-config:
146   :goals: debug
147
148References
149**********
150
151.. target-notes::
152
153.. _Nucleo L031K6 website:
154   https://www.st.com/en/evaluation-tools/nucleo-l031k6.html
155
156.. _STM32L0x1 reference manual:
157   https://www.st.com/resource/en/reference_manual/dm00108282-ultralowpower-stm32l0x1-advanced-armbased-32bit-mcus-stmicroelectronics.pdf
158
159.. _STM32 Nucleo-32 board User Manual:
160   https://www.st.com/resource/en/user_manual/dm00231744-stm32-nucleo32-boards-mb1180-stmicroelectronics.pdf
161