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