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