1.. zephyr:board:: disco_l475_iot1
2
3Overview
4********
5
6The B-L475E-IOT01A Discovery kit for IoT node allows users to develop
7applications with direct connection to cloud servers.
8The Discovery kit enables a wide diversity of applications by exploiting
9low-power communication, multiway sensing and ARM |reg| Cortex |reg|-M4 core-based
10STM32L4 Series features.
11
12This kit provides:
13
14- 64-Mbit Quad-SPI (Macronix) Flash memory
15- Bluetooth |reg| V4.1 module (SPBTLE-RF)
16- Sub-GHz (868 or 915 MHz) low-power-programmable RF module (SPSGRF-868 or SPSGRF-915)
17- Wi-Fi |reg| module Inventek ISM43362-M3G-L44 (802.11 b/g/n compliant)
18- Dynamic NFC tag based on M24SR with its printed NFC antenna
19- 2 digital omni-directional microphones (MP34DT01)
20- Capacitive digital sensor for relative humidity and temperature (HTS221)
21- High-performance 3-axis magnetometer (LIS3MDL)
22- 3D accelerometer and 3D gyroscope (LSM6DSL)
23- 260-1260 hPa absolute digital output barometer (LPS22HB)
24- Time-of-Flight and gesture-detection sensor (VL53L0X)
25- 2 push-buttons (user and reset)
26- USB OTG FS with Micro-AB connector
27- Expansion connectors:
28        - Arduino |trade| Uno V3
29        - PMOD
30- Flexible power-supply options:
31        - ST LINK USB VBUS or external sources
32- On-board ST-LINK/V2-1 debugger/programmer with USB re-enumeration capability:
33        - mass storage, virtual COM port and debug port
34
35
36More information about the board can be found at the `Disco L475 IoT1 website`_.
37
38Hardware
39********
40
41The STM32L475VG SoC provides the following hardware IPs:
42
43- Ultra-low-power with FlexPowerControl (down to 120 nA Standby mode and 100 uA/MHz run mode)
44- Core: ARM |reg| 32-bit Cortex |reg|-M4 CPU with FPU, frequency up to 80 MHz, 100DMIPS/1.25DMIPS/MHz (Dhrystone 2.1)
45- Clock Sources:
46        - 4 to 48 MHz crystal oscillator
47        - 32 kHz crystal oscillator for RTC (LSE)
48        - Internal 16 MHz factory-trimmed RC ( |plusminus| 1%)
49        - Internal low-power 32 kHz RC ( |plusminus| 5%)
50        - Internal multispeed 100 kHz to 48 MHz oscillator, auto-trimmed by
51          LSE (better than |plusminus| 0.25 % accuracy)
52        - 3 PLLs for system clock, USB, audio, ADC
53- RTC with HW calendar, alarms and calibration
54- Up to 24 capacitive sensing channels: support touchkey, linear and rotary touch sensors
55- 16x timers:
56        - 2x 16-bit advanced motor-control
57        - 2x 32-bit and 5x 16-bit general purpose
58        - 2x 16-bit basic
59        - 2x low-power 16-bit timers (available in Stop mode)
60        - 2x watchdogs
61        - SysTick timer
62- Up to 114 fast I/Os, most 5 V-tolerant, up to 14 I/Os with independent supply down to 1.08 V
63- Memories
64        - Up to 1 MB Flash, 2 banks read-while-write, proprietary code readout protection
65        - Up to 128 KB of SRAM including 32 KB with hardware parity check
66        - External memory interface for static memories supporting SRAM, PSRAM, NOR and NAND memories
67        - Quad SPI memory interface
68- 4x digital filters for sigma delta modulator
69- Rich analog peripherals (independent supply)
70        - 2x 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- 18x communication interfaces
75        - USB OTG 2.0 full-speed, LPM and BCD
76        - 2x SAIs (serial audio interface)
77        - 3x I2C FM+(1 Mbit/s), SMBus/PMBus
78        - 6x USARTs (ISO 7816, LIN, IrDA, modem)
79        - 3x SPIs (4x SPIs with the Quad SPI)
80        - CAN (2.0B Active) and SDMMC interface
81        - SWPMI single wire protocol master I/F
82- 14-channel DMA controller
83- True random number generator
84- CRC calculation unit, 96-bit unique ID
85- Development support: serial wire debug (SWD), JTAG, Embedded Trace Macrocell |trade|
86
87
88More information about STM32L475VG can be found here:
89       - `STM32L475VG on www.st.com`_
90       - `STM32L475 reference manual`_
91
92Supported Features
93==================
94
95The Zephyr Disco L475 IoT board configuration supports the following hardware features:
96
97+-----------+------------+-------------------------------------+
98| Interface | Controller | Driver/Component                    |
99+===========+============+=====================================+
100| NVIC      | on-chip    | nested vector interrupt controller  |
101+-----------+------------+-------------------------------------+
102| UART      | on-chip    | serial port-polling;                |
103|           |            | serial port-interrupt               |
104+-----------+------------+-------------------------------------+
105| PINMUX    | on-chip    | pinmux                              |
106+-----------+------------+-------------------------------------+
107| GPIO      | on-chip    | gpio                                |
108+-----------+------------+-------------------------------------+
109| FLASH     | on-chip    | flash memory                        |
110+-----------+------------+-------------------------------------+
111| I2C       | on-chip    | i2c                                 |
112+-----------+------------+-------------------------------------+
113| SPI       | on-chip    | spi                                 |
114+-----------+------------+-------------------------------------+
115| PWM       | on-chip    | pwm                                 |
116+-----------+------------+-------------------------------------+
117| WATCHDOG  | on-chip    | independent watchdog                |
118+-----------+------------+-------------------------------------+
119| DAC       | on-chip    | DAC Controller                      |
120+-----------+------------+-------------------------------------+
121| ADC       | on-chip    | adc                                 |
122+-----------+------------+-------------------------------------+
123| QSPI NOR  | on-chip    | off-chip flash                      |
124+-----------+------------+-------------------------------------+
125| die-temp  | on-chip    | die temperature sensor              |
126+-----------+------------+-------------------------------------+
127| RTC       | on-chip    | rtc                                 |
128+-----------+------------+-------------------------------------+
129
130Other hardware features are not yet supported on this Zephyr port.
131
132The default configuration can be found in the defconfig file:
133
134	:zephyr_file:`boards/st/disco_l475_iot1/disco_l475_iot1_defconfig`
135
136
137Connections and IOs
138===================
139
140Disco L475 IoT Board has 8 GPIO controllers. These controllers are responsible for pin muxing,
141input/output, pull-up, etc.
142
143Note that LED LD1 and SPI1 SCK use the same GPIO pin and cannot be used simultaneously.
144
145Available pins:
146---------------
147
148For detailed information about available pins please refer to `STM32 Disco L475 IoT1 board User Manual`_.
149
150Default Zephyr Peripheral Mapping:
151----------------------------------
152
153- UART_1 TX/RX : PB6/PB7 (ST-Link Virtual Port Com)
154- UART_4 TX/RX : PA0/PA1 (Arduino Serial)
155- I2C1 SCL/SDA : PB8/PB9 (Arduino I2C)
156- I2C2 SCL/SDA : PB10/PB11 (Sensor I2C bus)
157- I2C3 SCL/SDA : PC0/PC1
158- SPI1 NSS/SCK/MISO/MOSI : PA2/PA5/PA6/PA7 (Arduino SPI)
159- SPI3 SCK/MISO/MOSI : PC10/PC11/PC12 (BT SPI bus)
160- PWM_2_CH1 : PA15
161- PWM_15_CH1 : PB14 (LD2)
162- USER_PB : PC13
163- LD1 : PA5 (same as SPI1 SCK)
164- LD2 : PB14
165- ADC12_IN5 : PA0
166- ADC123_IN3 : PC2
167- ADC123_IN4 : PC3
168- ADC12_IN13 : PC4
169- ADC12_IN14 : PC5
170- DAC1_OUT1 : PA4
171
172System Clock
173------------
174
175Disco L475 IoT System Clock could be driven by internal or external oscillator,
176as well as main PLL clock. By default System clock is driven by PLL clock at 80MHz,
177driven by 16MHz high speed internal oscillator.
178
179Serial Port
180-----------
181
182Disco L475 IoT board has 6 U(S)ARTs. The Zephyr console output is assigned to UART1.
183Default settings are 115200 8N1.
184
185
186Programming and Debugging
187*************************
188
189Disco L475 IoT board includes an ST-LINK/V2-1 embedded debug tool interface.
190
191Applications for the ``disco_l475_iot1`` board configuration can be built and
192flashed in the usual way (see :ref:`build_an_application` and
193:ref:`application_run` for more details).
194
195Flashing
196========
197
198The board is configured to be flashed using west `STM32CubeProgrammer`_ runner,
199so its :ref:`installation <stm32cubeprog-flash-host-tools>` is required.
200
201Alternatively, OpenOCD or JLink can also be used to flash the board using
202the ``--runner`` (or ``-r``) option:
203
204.. code-block:: console
205
206   $ west flash --runner openocd
207   $ west flash --runner jlink
208
209Flashing an application to Disco L475 IoT
210-----------------------------------------
211
212Here is an example for the :zephyr:code-sample:`hello_world` application.
213
214Connect the Disco L475 IoT to your host computer using the USB port, then
215run a serial host program to connect with your Nucleo board. For example:
216
217.. code-block:: console
218
219   $ minicom -D /dev/ttyACM0
220
221Then build and flash the application:
222
223.. zephyr-app-commands::
224   :zephyr-app: samples/hello_world
225   :board: disco_l475_iot1
226   :goals: build flash
227
228You should see the following message on the console:
229
230.. code-block:: console
231
232   $ Hello World! arm
233
234Debugging
235=========
236
237You can debug an application in the usual way.  Here is an example for the
238:zephyr:code-sample:`hello_world` application.
239
240.. zephyr-app-commands::
241   :zephyr-app: samples/hello_world
242   :board: disco_l475_iot1
243   :maybe-skip-config:
244   :goals: debug
245
246.. _Disco L475 IoT1 website:
247   https://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/mcu-eval-tools/stm32-mcu-eval-tools/stm32-mcu-discovery-kits/b-l475e-iot01a.html
248
249.. _STM32 Disco L475 IoT1 board User Manual:
250   https://www.st.com/resource/en/user_manual/dm00347848.pdf
251
252.. _STM32L475VG on www.st.com:
253   https://www.st.com/en/microcontrollers-microprocessors/stm32l475vg.html
254
255.. _STM32L475 reference manual:
256   https://www.st.com/resource/en/reference_manual/dm00083560.pdf
257
258.. _STM32CubeProgrammer:
259   https://www.st.com/en/development-tools/stm32cubeprog.html
260