1.. zephyr:board:: stm32vl_disco
2
3Overview
4********
5
6The STM32 Discovery series comes in many varieties, in this case the "Value
7Line" STM32F100x SoC series is showcased. Like other Discovery board, an
8integrated ST-LINK debugger and programmer is included (V1), but the only
9included I/O devices are two user LEDs and one user button.
10
11More information about the board can be found at the `STM32VLDISCOVERY website`_.
12
13Hardware
14********
15
16The STM32 Discovery board features:
17
18- On-board ST-LINK/V1 with selection mode switch to use the kit as a standalone
19  ST-LINK/V1 (with SWD connector for programming and debugging)
20- Board power supply: through USB bus or from an external 5 V supply voltage
21- External application power supply: 3 V and 5 V
22- Four LEDs:
23
24    - LD1 (red) for 3.3 V power on
25    - LD2 (red/green) for USB communication
26    - LD3 (green) for PC9 output
27    - LD4 (blue) for PC8 output
28- Two push buttons (user and reset)
29- Extension header for all LQFP64 I/Os for quick connection to prototyping board
30  and easy probing
31
32More information about the STM32F100x can be found in the
33`STM32F100x reference manual`_ and the `STM32F100x data sheet`_.
34
35Supported Features
36==================
37
38The Zephyr stm32vl_disco board configuration supports the following hardware features:
39
40.. list-table:: Supported hardware
41   :header-rows: 1
42
43   * - Interface
44     - Controller
45     - Driver/component
46   * - NVIC
47     - on-chip
48     - nested vector interrupt controller
49   * - UART
50     - on-chip
51     - serial port-polling
52       serial port-interrupt
53   * - PINMUX
54     - on-chip
55     - pinmux
56   * - GPIO
57     - on-chip
58     - gpio
59   * - CLOCK
60     - on-chip
61     - reset and clock control
62   * - FLASH
63     - on-chip
64     - flash memory
65   * - WATCHDOG
66     - on-chip
67     - window watchdog
68   * - I2C
69     - on-chip
70     - i2c
71   * - SPI
72     - on-chip
73     - spi
74   * - ADC
75     - on-chip
76     - adc
77
78Other hardware features are not yet supported in this Zephyr port.
79
80The default configuration can be found in
81:zephyr_file:`boards/st/stm32vl_disco/stm32vl_disco_defconfig`
82
83Connections and IOs
84===================
85
86Each of the GPIO pins can be configured by software as output (push-pull or open-drain), as
87input (with or without pull-up or pull-down), or as peripheral alternate function. Most of the
88GPIO pins are shared with digital or analog alternate functions. All GPIOs are high current
89capable except for analog inputs.
90
91Default Zephyr Peripheral Mapping:
92----------------------------------
93
94.. rst-class:: rst-columns
95
96- UART_1_TX : PA9
97- UART_1_RX : PA10
98- UART_2_TX : PA2
99- UART_2_RX : PA3
100- UART_3_TX : PB10
101- UART_3_RX : PB11
102- SPI1_NSS : PA4
103- SPI1_SCK : PA5
104- SPI1_MISO : PA6
105- SPI1_MOSI : PA7
106- SPI2_NSS : PB12
107- SPI2_SCK : PB13
108- SPI2_MISO : PB14
109- SPI2_MOSI : PB15
110- I2C1_SCL : PB6
111- I2C1_SDA : PB7
112- I2C2_SCL : PB10
113- I2C2_SDA : PB11
114
115For more details please refer to `STM32VLDISCOVERY board User Manual`_.
116
117Programming and Debugging
118*************************
119
120Applications for the ``stm32vl_disco`` board configuration can be built and
121flashed in the usual way (see :ref:`build_an_application` and
122:ref:`application_run` for more details).
123
124Flashing
125========
126
127STM32VLDISCOVERY board includes an ST-LINK/V1 embedded debug tool interface.
128This interface is supported by the openocd version included in the Zephyr SDK.
129
130Flashing an application
131-----------------------
132
133Here is an example for the :zephyr:code-sample:`blinky` application.
134
135.. zephyr-app-commands::
136   :zephyr-app: samples/basic/blinky
137   :board: stm32vl_disco
138   :goals: build flash
139
140You will see the LED blinking every second.
141
142Debugging
143=========
144
145You can debug an application in the usual way.  Here is an example for the
146:zephyr:code-sample:`blinky` application.
147
148.. zephyr-app-commands::
149   :zephyr-app: samples/basic/blinky
150   :board: stm32vl_disco
151   :maybe-skip-config:
152   :goals: debug
153
154USB mass storage issues
155=======================
156
157The ST-LINK/V1 includes a buggy USB mass storage gadget. To connect to the
158ST-LINK from Linux, you might need to ignore the device using modprobe
159configuration parameters:
160
161.. code-block:: shell
162
163   $ echo "options usb-storage quirks=483:3744:i" | sudo tee /etc/modprobe.d/local.conf
164   $ sudo modprobe -r usb-storage
165
166References
167**********
168
169.. target-notes::
170
171.. _STM32VLDISCOVERY website:
172   https://www.st.com/en/evaluation-tools/stm32vldiscovery.html
173
174.. _STM32F100x reference manual:
175   https://www.st.com/resource/en/reference_manual/cd00246267.pdf
176
177.. _STM32F100x data sheet:
178   https://www.st.com/resource/en/datasheet/stm32f100cb.pdf
179
180.. _STM32VLDISCOVERY board User Manual:
181   https://www.st.com/resource/en/user_manual/cd00267113.pdf
182