1.. zephyr:board:: stm32l496g_disco
2
3Overview
4********
5
6The STM32L496G Discovery board features an ARM Cortex-M4 based STM32L496AG MCU
7with a wide range of connectivity support and configurations. Here are
8some highlights of the STM32L496G Discovery board:
9
10
11- STM32L496AGI6 microcontroller featuring 1 Mbyte of Flash memory and 320 Kbytes of RAM in an UFBGA169 package
12- 1.54 inch 240 x 240 pixel-TFT color LCD with parallel interface
13- SAI Audio CODEC, with a stereo headset jack, including analog microphone input
14- Stereo digital MEMS microphones
15- microSD card connector (card included)
16- Camera 8 bit-connector
17- 8 Mbit-PSRAM
18- IDD measurement
19- 64 Mbit-Quad-SPI Flash
20- USB OTG FS with Micro-AB connector
21- Two types of extension resources:
22
23  - STMod+ and PMOD connectors
24  - Compatible Arduino* Uno V3 connectors
25
26- On-board ST-LINK/V2-1 debugger/programmer with SWD connector
27- 5 source options for power supply
28
29  - ST-LINK/V2-1 USB connector
30  - User USB FS connector
31  - VIN from Arduino connector
32  - 5 V from Arduino connector
33  - USB charger
34  - USB VBUS or external source(3.3V, 5V, 7 - 12V)
35  - Power management access point
36
37- 8 LEDs
38- Reset push button
39- 4 direction-joystick with selection
40
41More information about the board can be found at the `STM32L496G Discovery website`_.
42
43Hardware
44********
45
46The STM32L496AG SoC provides the following hardware capabilities:
47
48- Ultra-low-power with FlexPowerControl (down to 108 nA Standby mode and 91
49  |micro| A/MHz run mode)
50- Core: ARM |reg| 32-bit Cortex |reg| -M4 CPU with FPU, frequency up to 80 MHz,
51  100DMIPS/1.25DMIPS/MHz (Dhrystone 2.1)
52- Clock Sources:
53
54  - 4 to 48 MHz crystal oscillator
55  - 32 kHz crystal oscillator for RTC (LSE)
56  - Internal 16 MHz factory-trimmed RC ( |plusminus| 1%)
57  - Internal low-power 32 kHz RC ( |plusminus| 5%)
58  - Internal multispeed 100 kHz to 48 MHz oscillator, auto-trimmed by
59    LSE (better than |plusminus| 0.25 % accuracy)
60  - Internal 48 MHz with clock recovery
61  - 3 PLLs for system clock, USB, audio, ADC
62
63- RTC with HW calendar, alarms and calibration
64- LCD 8 x 40 or 4 x 44 with step-up converter
65- Up to 24 capacitive sensing channels: support touchkey, linear and rotary touch sensors
66- 16x timers:
67
68  - 2x 16-bit advanced motor-control
69  - 2x 32-bit and 5x 16-bit general purpose
70  - 2x 16-bit basic
71  - 2x low-power 16-bit timers (available in Stop mode)
72  - 2x watchdogs
73  - SysTick timer
74
75- Up to 136 fast I/Os, most 5 V-tolerant, up to 14 I/Os with independent supply down to 1.08 V
76- Memories
77
78  - Up to 1 MB Flash, 2 banks read-while-write, proprietary code readout protection
79  - 320 KB of SRAM including 64 KB with hardware parity check
80  - External memory interface for static memories supporting SRAM, PSRAM, NOR, and NAND memories
81  - Quad SPI memory interface
82
83- 4x digital filters for sigma delta modulator
84- Rich analog peripherals (independent supply)
85
86  - 3x 12-bit ADC 5 MSPS, up to 16-bit with hardware oversampling, 200
87    |micro| A/MSPS
88  - 2x 12-bit DAC, low-power sample and hold
89  - 2x operational amplifiers with built-in PGA
90  - 2x ultra-low-power comparators
91
92- 20x communication interfaces
93
94  - USB OTG 2.0 full-speed, LPM and BCD
95  - 2x SAIs (serial audio interface)
96  - 4x I2C FM+(1 Mbit/s), SMBus/PMBus
97  - 5x USARTs (ISO 7816, LIN, IrDA, modem)
98  - 1x LPUART
99  - 3x SPIs (4x SPIs with the Quad SPI)
100  - 2x CAN (2.0B Active) and SDMMC interface
101  - SWPMI single wire protocol master I/F
102  - IRTIM (Infrared interface)
103
104- 14-channel DMA controller
105- True random number generator
106- CRC calculation unit, 96-bit unique ID
107- Development support: serial wire debug (SWD), JTAG, Embedded Trace Macrocell*
108
109
110More information about STM32L496AG can be found in:
111
112- `STM32L496AG on www.st.com`_
113- `STM32L496 reference manual`_
114
115Supported Features
116==================
117
118The Zephyr stm32l496g_disco board configuration supports the following hardware features:
119
120+-----------+------------+-------------------------------------+
121| Interface | Controller | Driver/Component                    |
122+===========+============+=====================================+
123| NVIC      | on-chip    | nested vector interrupt controller  |
124+-----------+------------+-------------------------------------+
125| UART      | on-chip    | serial port-polling;                |
126|           |            | serial port-interrupt               |
127+-----------+------------+-------------------------------------+
128| PINMUX    | on-chip    | pinmux                              |
129+-----------+------------+-------------------------------------+
130| GPIO      | on-chip    | gpio                                |
131+-----------+------------+-------------------------------------+
132| I2C       | on-chip    | i2c                                 |
133+-----------+------------+-------------------------------------+
134| SDMMC     | on-chip    | disk access                         |
135+-----------+------------+-------------------------------------+
136| SPI       | on-chip    | spi                                 |
137+-----------+------------+-------------------------------------+
138| QSPI NOR  | on-chip    | off-chip flash                      |
139+-----------+------------+-------------------------------------+
140| PWM       | on-chip    | pwm                                 |
141+-----------+------------+-------------------------------------+
142| ADC       | on-chip    | adc                                 |
143+-----------+------------+-------------------------------------+
144| USB       | on-chip    | usb_device                          |
145+-----------+------------+-------------------------------------+
146
147Other hardware features are not yet supported on this Zephyr port.
148
149The default configuration can be found in the defconfig file:
150
151	:zephyr_file:`boards/st/stm32l496g_disco/stm32l496g_disco_defconfig`
152
153
154Connections and IOs
155===================
156
157STM32L496G Discovery Board has 8 GPIO controllers. These controllers are responsible for pin muxing,
158input/output, pull-up, etc.
159
160For more details please refer to `STM32L496G Discovery board User Manual`_.
161
162Default Zephyr Peripheral Mapping:
163----------------------------------
164
165- UART_1 TX/RX : PB6/PG10
166- UART_2 TX/RX : PA2/PD6 (ST-Link Virtual Port Com)
167- LPUART_1 TX/RX : PG7/PG8 (Arduino Serial)
168- I2C1 SCL/SDA : PB8/PB7 (Arduino I2C)
169- SDMMC_1 D0/D1/D2/D3/CK/CMD: PC8/PC9/PC10/PC11/PC12/PD2
170- SPI1 NSS/SCK/MISO/MOSI : PA15/PA5/PB4/PB5 (Arduino SPI)
171- USB DM/DP/ID : PA11/PA12/PA10
172- I2C_1_SCL : PB8
173- I2C_1_SDA : PB7
174- PWM_2_CH1 : PA0
175- LD2 : PB13
176
177System Clock
178------------
179
180STM32L496G Discovery System Clock could be driven by an internal or external oscillator,
181as well as the main PLL clock. By default the System clock is driven by the PLL clock at 80MHz,
182driven by 16MHz high speed internal oscillator.
183
184Serial Port
185-----------
186
187STM32L496G Discovery board has 5 U(S)ARTs. The Zephyr console output is assigned to UART2.
188Default settings are 115200 8N1.
189
190
191Programming and Debugging
192*************************
193
194STM32L496G Discovery board includes an ST-LINK/V2-1 embedded debug tool interface.
195
196Flashing
197========
198
199The board is configured to be flashed using west `STM32CubeProgrammer`_ runner,
200so its :ref:`installation <stm32cubeprog-flash-host-tools>` is required.
201
202Alternatively, OpenOCD or JLink can also be used to flash the board using
203the ``--runner`` (or ``-r``) option:
204
205.. code-block:: console
206
207   $ west flash --runner openocd
208   $ west flash --runner jlink
209
210Applications for the ``stm32l496g_disco`` board configuration can be
211built and flashed in the usual way (see :ref:`build_an_application`
212and :ref:`application_run` for more details).
213
214Flashing an application to STM32L496G Discovery
215-----------------------------------------------
216
217Connect the STM32L496G Discovery to your host computer using the USB
218port, then run a serial host program to connect with your Discovery
219board. For example:
220
221.. code-block:: console
222
223   $ minicom -D /dev/ttyACM0
224
225Then, build and flash in the usual way. Here is an example for the
226:zephyr:code-sample:`hello_world` application.
227
228.. zephyr-app-commands::
229   :zephyr-app: samples/hello_world
230   :board: stm32l496g_disco
231   :goals: build flash
232
233You should see the following message on the console:
234
235.. code-block:: console
236
237   Hello World! arm
238
239Debugging
240=========
241
242You can debug an application in the usual way.  Here is an example for the
243:zephyr:code-sample:`hello_world` application.
244
245.. zephyr-app-commands::
246   :zephyr-app: samples/hello_world
247   :board: stm32l496g_disco
248   :maybe-skip-config:
249   :goals: debug
250
251.. _STM32L496G Discovery website:
252   https://www.st.com/en/evaluation-tools/32l496gdiscovery.html
253
254.. _STM32L496G Discovery board User Manual:
255   https://www.st.com/resource/en/user_manual/dm00353127.pdf
256
257.. _STM32L496AG on www.st.com:
258   https://www.st.com/en/microcontrollers/stm32l496ag.html
259
260.. _STM32L496 reference manual:
261   https://www.st.com/resource/en/reference_manual/DM00083560.pdf
262
263.. _STM32CubeProgrammer:
264   https://www.st.com/en/development-tools/stm32cubeprog.html
265