1.. zephyr:board:: nucleo_l4a6zg
2
3Overview
4********
5
6The Nucleo L4A6ZG board features an ARM Cortex-M4 based STM32L4A6ZG MCU
7with a wide range of connectivity support and configurations. Here are
8some highlights of the Nucleo L4A6ZG board:
9
10
11- STM32 microcontroller in QFP144 package
12- USB OTG FS with Micro-AB connector
13- Two types of extension resources:
14
15  - Arduino Uno V3 connectivity
16  - ST morpho extension pin headers for full access to all STM32 I/Os
17
18- On-board ST-LINK/V2-1 debugger/programmer with SWD connector
19- Flexible board power supply:
20
21  - USB VBUS or external source(3.3V, 5V, 7 - 12V)
22  - Power management access point
23
24- 8 LEDs: user LEDs (LD1, LD2, LD3), communication LED (LD4), USB
25  power fault(LD5), power LED (LD6), USB FS OTG (LD7, LD8)
26- 2 push buttons: USER and RESET
27
28More information about the board can be found at the `Nucleo L4A6ZG website`_.
29
30Hardware
31********
32
33The STM32L4A6ZG SoC provides the following hardware capabilities:
34
35- Ultra-low-power with FlexPowerControl (down to 108 nA Standby mode and 91 uA/MHz run mode)
36- Core: ARM |reg| 32-bit Cortex |reg|-M4 CPU with FPU, frequency up to 80 MHz, 100DMIPS/1.25DMIPS/MHz (Dhrystone 2.1)
37- Clock Sources:
38
39  - 4 to 48 MHz crystal oscillator
40  - 32 kHz crystal oscillator for RTC (LSE)
41  - Internal 16 MHz factory-trimmed RC ( |plusminus| 1%)
42  - Internal low-power 32 kHz RC ( |plusminus| 5%)
43  - Internal multispeed 100 kHz to 48 MHz oscillator, auto-trimmed by
44    LSE (better than  |plusminus| 0.25 % accuracy)
45  - 3 PLLs for system clock, USB, audio, ADC
46
47- RTC with HW calendar, alarms and calibration
48- LCD 8 x 40 or 4 x 44 with step-up converter
49- Up to 24 capacitive sensing channels: support touchkey, linear and rotary touch sensors
50- 16x timers:
51
52  - 2x 16-bit advanced motor-control
53  - 2x 32-bit and 5x 16-bit general purpose
54  - 2x 16-bit basic
55  - 2x low-power 16-bit timers (available in Stop mode)
56  - 2x watchdogs
57  - SysTick timer
58
59- Up to 136 fast I/Os, most 5 V-tolerant, up to 14 I/Os with independent supply down to 1.08 V
60- Memories
61
62  - Up to 1 MB Flash, 2 banks read-while-write, proprietary code readout protection
63  - Up to 320 KB of SRAM including 64 KB with hardware parity check
64  - External memory interface for static memories supporting SRAM, PSRAM, NOR and NAND memories
65  - Quad SPI memory interface
66
67- 4x digital filters for sigma delta modulator
68- Rich analog peripherals (independent supply)
69
70  - 3x 12-bit ADC 5 MSPS, up to 16-bit with hardware oversampling, 200 uA/MSPS
71  - 2x 12-bit DAC, low-power sample and hold
72  - 2x operational amplifiers with built-in PGA
73  - 2x ultra-low-power comparators
74
75- 20x communication interfaces
76
77  - USB OTG 2.0 full-speed, LPM and BCD
78  - 2x SAIs (serial audio interface)
79  - 4x I2C FM+(1 Mbit/s), SMBus/PMBus
80  - 5x U(S)ARTs (ISO 7816, LIN, IrDA, modem)
81  - 1x LPUART
82  - 3x SPIs (4x SPIs with the Quad SPI)
83  - 2x CAN (2.0B Active) and SDMMC interface
84  - SWPMI single wire protocol master I/F
85  - IRTIM (Infrared interface)
86
87- 14-channel DMA controller
88- True random number generator
89- CRC calculation unit, 96-bit unique ID
90- AES and HASH hardware accelerators
91- Development support: serial wire debug (SWD), JTAG, Embedded Trace Macrocell |trade|
92
93
94More information about STM32L4A6ZG can be found here:
95
96- `STM32L4A6ZG on www.st.com`_
97- `STM32L4A6 reference manual`_
98
99Supported Features
100==================
101
102The Zephyr nucleo_l4a6zg board configuration supports the following hardware features:
103
104+-----------+------------+-------------------------------------+
105| Interface | Controller | Driver/Component                    |
106+===========+============+=====================================+
107| AES       | on-chip    | crypto                              |
108+-----------+------------+-------------------------------------+
109| FLASH     | on-chip    | flash memory                        |
110+-----------+------------+-------------------------------------+
111| GPIO      | on-chip    | gpio                                |
112+-----------+------------+-------------------------------------+
113| I2C       | on-chip    | i2c                                 |
114+-----------+------------+-------------------------------------+
115| NVIC      | on-chip    | nested vector interrupt controller  |
116+-----------+------------+-------------------------------------+
117| PINMUX    | on-chip    | pinmux                              |
118+-----------+------------+-------------------------------------+
119| PWM       | on-chip    | pwm                                 |
120+-----------+------------+-------------------------------------+
121| RTC       | on-chip    | rtc                                 |
122+-----------+------------+-------------------------------------+
123| SPI       | on-chip    | spi                                 |
124+-----------+------------+-------------------------------------+
125| UART      | on-chip    | serial port-polling;                |
126|           |            | serial port-interrupt               |
127+-----------+------------+-------------------------------------+
128| WATCHDOG  | on-chip    | System Window Watchdog              |
129+-----------+------------+-------------------------------------+
130
131Other hardware features are not yet supported on this Zephyr port.
132
133The default configuration can be found in the defconfig file:
134:zephyr_file:`boards/st/nucleo_l4a6zg/nucleo_l4a6zg_defconfig`
135
136
137Connections and IOs
138===================
139
140Nucleo L4A6ZG Board has 8 GPIO controllers. These controllers are responsible for pin muxing,
141input/output, pull-up, etc.
142
143For more details please refer to `STM32 Nucleo-144 board User Manual`_.
144
145Default Zephyr Peripheral Mapping:
146----------------------------------
147
148- LPUART_1 TX/RX : PG7/PG8 (ST-Link Virtual COM Port)
149- UART_3 TX/RX : PD8/PD9 (Arduino Serial)
150- I2C_1 SCL/SDA : PB8/PB7 (Arduino I2C)
151- SPI_1 SCK/MISO/MOSI/NSS : PA5/PA6/PA7/PD14 (Arduino SPI)
152- USER_PB : PC13
153- PWM_15_CH1 : PB14 (Red LED)
154- LD1 : PC7 (Green LED)
155- LD2 : PB7 (Blue LED)
156- LD3 : PB14 (Red LED)
157
158System Clock
159------------
160
161Nucleo L4A6ZG system clock could be driven by internal or external oscillator,
162as well as main PLL clock. By default, system clock is driven by PLL at 80MHz, which is
163driven by 16MHz high speed internal oscillator (HSI). High speed external oscillator
164(HSE) is not soldered on the board, so it cannot be used to drive the PLL.
165
166Serial Port
167-----------
168
169Nucleo L4A6ZG board has 5 UARTs. The Zephyr console output is assigned to LPUART1,
170which is connected to the onboard ST-LINK/V2-1. Virtual COM port interface.
171Default settings are 115200 8N1.
172
173
174Programming and Debugging
175*************************
176
177Nucleo L4A6ZG board includes an ST-LINK/V2-1 embedded debug tool interface.
178
179Applications for the ``nucleo_l4a6zg`` board configuration can be built and
180flashed in the usual way (see :ref:`build_an_application` and
181:ref:`application_run` for more details).
182
183Flashing
184========
185
186The board is configured to be flashed using west `STM32CubeProgrammer`_ runner,
187so its :ref:`installation <stm32cubeprog-flash-host-tools>` is required.
188
189Alternatively, OpenOCD or JLink can also be used to flash the board using
190the ``--runner`` (or ``-r``) option:
191
192.. code-block:: console
193
194   $ west flash --runner openocd
195   $ west flash --runner jlink
196
197Flashing an application to Nucleo L4A6ZG
198----------------------------------------
199
200Connect the Nucleo L4A6ZG to your host computer using the ST-LINK USB port.
201Then build and flash an application. Here is an example for the
202:zephyr:code-sample:`hello_world` application.
203
204Run a serial host program to connect with your Nucleo board:
205
206.. code-block:: console
207
208   $ minicom -D /dev/ttyUSB0
209
210Then build and flash the application.
211
212.. zephyr-app-commands::
213   :zephyr-app: samples/hello_world
214   :board: nucleo_l4a6zg
215   :goals: build flash
216
217You should see the following message on the console:
218
219.. code-block:: console
220
221   Hello World! nucleo_l4a6zg
222
223Debugging
224=========
225
226You can debug an application in the usual way.  Here is an example for the
227:zephyr:code-sample:`hello_world` application.
228
229.. zephyr-app-commands::
230   :zephyr-app: samples/hello_world
231   :board: nucleo_l4a6zg
232   :maybe-skip-config:
233   :goals: debug
234
235.. _Nucleo L4A6ZG website:
236   https://www.st.com/en/evaluation-tools/nucleo-l4a6zg.html
237
238.. _STM32 Nucleo-144 board User Manual:
239   https://www.st.com/resource/en/user_manual/dm00368330.pdf
240
241.. _STM32L4A6ZG on www.st.com:
242   https://www.st.com/en/microcontrollers-microprocessors/stm32l4a6zg.html
243
244.. _STM32L4A6 reference manual:
245   https://www.st.com/resource/en/reference_manual/dm00083560.pdf
246
247.. _STM32CubeProgrammer:
248   https://www.st.com/en/development-tools/stm32cubeprog.html
249