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