1.. zephyr:board:: stm32h573i_dk
2
3Overview
4********
5
6The STM32H573I-DK Discovery kit is designed as a complete demonstration and
7development platform for STMicroelectronics Arm |reg| Cortex |reg|-M33 core-based
8STM32H573IIK3Q microcontroller with TrustZone |reg|. Here are some highlights of
9the STM32H573I-DK Discovery board:
10
11
12- STM32H573IIK3Q microcontroller featuring 2 Mbytes of Flash memory and 640 Kbytes of SRAM in 176-pin BGA package
13- 1.54-inch 240x240 pixels TFT-LCD with LED  backlight and touch panel
14- USB Type-C |trade| Host and device with USB power-delivery controller
15- SAI Audio DAC stereo with one audio jacks for input/output,
16- ST MEMS digital microphone with PDM interface
17- Octo-SPI interface connected to 512Mbit Octo-SPI NORFlash memory device (MX25LM51245GXDI00 from MACRONIX)
18- 10/100-Mbit Ethernet,
19- microSD  |trade|
20- A Wi‑Fi® add-on board
21- Board connectors
22
23  - STMod+ expansion connector with fan-out expansion board for Wi‑Fi |reg|, Grove and mikroBUS |trade| compatible connectors
24  - Pmod |trade| expansion connector
25  - Audio MEMS daughterboard expansion connector
26  - ARDUINO |reg| Uno V3 expansion connector
27
28- Flexible power-supply options
29
30  - ST-LINK
31  - USB VBUS
32  - external sources
33
34- On-board STLINK-V3E debugger/programmer with USB re-enumeration capability:
35
36  - mass storage
37  - Virtual COM port
38  - debug port
39
40- 4 user LEDs
41- User and reset push-buttons
42
43More information about the board can be found at the `STM32H573I-DK Discovery website`_.
44
45Hardware
46********
47
48The STM32H573xx devices are an high-performance microcontrollers family (STM32H5
49Series) based on the high-performance Arm |reg| Cortex |reg|-M33 32-bit RISC core.
50They operate at a frequency of up to 250 MHz.
51
52- Core: ARM |reg| 32-bit Cortex |reg| -M33 CPU with TrustZone |reg| and FPU.
53- Performance benchmark:
54
55  - 375 DMPIS/MHz (Dhrystone 2.1)
56
57- Security
58
59  - Arm |reg| TrustZone |reg| with ARMv8-M mainline security extension
60  - Up to 8 configurable SAU regions
61  - TrustZone |reg| aware and securable peripherals
62  - Flexible lifecycle scheme with secure debug authentication
63  - Preconfigured immutable root of trust (ST-iROT)
64  - SFI (secure firmware installation)
65  - Secure data storage with hardware unique key (HUK)
66  - Secure firmware upgrade support with TF-M
67  - 2x AES coprocessors including one with DPA resistance
68  - Public key accelerator, DPA resistant
69  - On-the-fly decryption of Octo-SPI external memories
70  - HASH hardware accelerator
71  - True random number generator, NIST SP800-90B compliant
72  - 96-bit unique ID
73  - Active tampers
74  - True Random Number Generator (RNG) NIST SP800-90B compliant
75
76- Clock management:
77
78  - 25 MHz crystal oscillator (HSE)
79  - 32 kHz crystal oscillator for RTC (LSE)
80  - Internal 64 MHz (HSI) trimmable by software
81  - Internal low-power 32 kHz RC (LSI)( |plusminus| 5%)
82  - Internal 4 MHz oscillator (CSI), trimmable by software
83  - Internal 48 MHz (HSI48) with recovery system
84  - 3 PLLs for system clock, USB, audio, ADC
85
86- Power management
87
88  - Embedded regulator (LDO) with three configurable range output to supply the digital circuitry
89  - Embedded SMPS step-down converter
90
91- RTC with HW calendar, alarms and calibration
92- Up to 139 fast I/Os, most 5 V-tolerant, up to 10 I/Os with independent supply down to 1.08 V
93- Up to 16 timers and 2 watchdogs
94
95  - 12x 16-bit
96  - 2x 32-bit timers with up to 4 IC/OC/PWM or pulse counter and quadrature (incremental) encoder input
97  - 6x 16-bit low-power 16-bit timers (available in Stop mode)
98  - 2x watchdogs
99  - 2x SysTick timer
100
101- Memories
102
103  - Up to 2 MB Flash, 2 banks read-while-write
104  - 1 Kbyte OTP (one-time programmable)
105  - 640 KB of SRAM including 64 KB with hardware parity check and 320 Kbytes with flexible ECC
106  - 4 Kbytes of backup SRAM available in the lowest power modes
107  - Flexible external memory controller with up to 16-bit data bus: SRAM, PSRAM, FRAM, SDRAM/LPSDR SDRAM, NOR/NAND memories
108  - 1x OCTOSPI memory interface with on-the-fly decryption and support for serial PSRAM/NAND/NOR, Hyper RAM/Flash frame formats
109  - 2x SD/SDIO/MMC interfaces
110
111- Rich analog peripherals (independent supply)
112
113  - 2x 12-bit ADC with up to 5 MSPS in 12-bit
114  - 2x 12-bit D/A converters
115  - 1x Digital temperature sensor
116
117- 34x communication interfaces
118
119  - 1x USB Type-C / USB power-delivery controller
120  - 1x USB 2.0 full-speed host and device
121  - 4x I2C FM+ interfaces (SMBus/PMBus)
122  - 1x I3C interface
123  - 12x U(S)ARTS (ISO7816 interface, LIN, IrDA, modem control)
124  - 1x LP UART
125  - 6x SPIs including 3 muxed with full-duplex I2S
126  - 5x additional SPI from 5x USART when configured in Synchronous mode
127  - 2x SAI
128  - 2x FDCAN
129  - 1x SDMMC interface
130  - 2x 16 channel DMA controllers
131  - 1x 8- to 14- bit camera interface
132  - 1x HDMI-CEC
133  - 1x Ethernel MAC interface with DMA controller
134  - 1x 16-bit parallel slave synchronous-interface
135
136- CORDIC for trigonometric functions acceleration
137- FMAC (filter mathematical accelerator)
138- CRC calculation unit
139- Development support: serial wire debug (SWD), JTAG, Embedded Trace Macrocell |trade|
140
141
142More information about STM32H573 can be found here:
143
144- `STM32H573 on www.st.com`_
145- `STM32H573 reference manual`_
146
147Supported Features
148==================
149
150The Zephyr STM32H573I_DK board configuration supports the following
151hardware features:
152
153+-----------+------------+-------------------------------------+
154| Interface | Controller | Driver/Component                    |
155+===========+============+=====================================+
156| CLOCK     | on-chip    | reset and clock control             |
157+-----------+------------+-------------------------------------+
158| GPIO      | on-chip    | gpio                                |
159+-----------+------------+-------------------------------------+
160| NVIC      | on-chip    | nested vector interrupt controller  |
161+-----------+------------+-------------------------------------+
162| PINMUX    | on-chip    | pinmux                              |
163+-----------+------------+-------------------------------------+
164| RNG       | on-chip    | True Random number generator        |
165+-----------+------------+-------------------------------------+
166| UART      | on-chip    | serial port-polling;                |
167|           |            | serial port-interrupt               |
168+-----------+------------+-------------------------------------+
169| WATCHDOG  | on-chip    | independent watchdog                |
170+-----------+------------+-------------------------------------+
171| DAC       | on-chip    | DAC Controller                      |
172+-----------+------------+-------------------------------------+
173| ADC       | on-chip    | ADC Controller                      |
174+-----------+------------+-------------------------------------+
175| PWM       | on-chip    | PWM                                 |
176+-----------+------------+-------------------------------------+
177| RTC       | on-chip    | Real Time Clock                     |
178+-----------+------------+-------------------------------------+
179| I2C       | on-chip    | i2c bus                             |
180+-----------+------------+-------------------------------------+
181| SPI       | on-chip    | spi bus                             |
182+-----------+------------+-------------------------------------+
183| OCTOSPI   | on-chip    | octospi                             |
184+-----------+------------+-------------------------------------+
185| CAN       | on-chip    | can bus                             |
186+-----------+------------+-------------------------------------+
187| AES       | on-chip    | crypto                              |
188+-----------+------------+-------------------------------------+
189| SDMMC     | on-chip    | disk access                         |
190+-----------+------------+-------------------------------------+
191| USB       | on-chip    | USB full-speed host/device bus      |
192+-----------+------------+-------------------------------------+
193| RTC       | on-chip    | rtc                                 |
194+-----------+------------+-------------------------------------+
195| ETHERNET  | on-chip    | ethernet                            |
196+-----------+------------+-------------------------------------+
197
198Other hardware features are not yet supported on this Zephyr port.
199
200The default configuration can be found in the defconfig and dts files:
201
202- Secure target:
203
204  - :zephyr_file:`boards/st/stm32h573i_dk/stm32h573i_dk_defconfig`
205  - :zephyr_file:`boards/st/stm32h573i_dk/stm32h573i_dk.dts`
206
207Connections and IOs
208===================
209
210STM32H573I-DK Discovery Board has 9 GPIO controllers. These controllers are responsible for pin muxing,
211input/output, pull-up, etc.
212
213For more details please refer to `STM32H573I-DK Discovery board User Manual`_.
214
215Default Zephyr Peripheral Mapping:
216----------------------------------
217
218- USART_1 TX/RX : PA9/PA10 (VCP)
219- USART_3 TX/RX : PB11/PB10  (Arduino USART3)
220- USER_PB : PC13
221- LD1 (green) : PI9
222- DAC1 channel 1 output : PA4
223- ADC1 channel 6 input : PF12
224
225System Clock
226------------
227
228STM32H573I-DK System Clock could be driven by internal or external oscillator,
229as well as main PLL clock. By default System clock is driven by PLL clock at
230240MHz, driven by 25MHz external oscillator (HSE).
231
232Serial Port
233-----------
234
235STM32H573I-DK Discovery board has 3 U(S)ARTs. The Zephyr console output is
236assigned to USART1. Default settings are 115200 8N1.
237
238
239Programming and Debugging
240*************************
241
242STM32H573I-DK Discovery board includes an ST-LINK/V3E embedded debug tool interface.
243
244Applications for the ``stm32h573i_dk`` board configuration can be built and
245flashed in the usual way (see :ref:`build_an_application` and
246:ref:`application_run` for more details).
247
248OpenOCD Support
249===============
250
251For now, OpenOCD support  for STM32H5 is not available on upstream OpenOCD.
252You can check `OpenOCD official Github mirror`_.
253In order to use it though, you should clone from the cutomized
254`STMicroelectronics OpenOCD Github`_ and compile it following usual README guidelines.
255Once it is done, you can set the OPENOCD and OPENOCD_DEFAULT_PATH variables in
256:zephyr_file:`boards/st/stm32h573i_dk/board.cmake` to point the build
257to the paths of the OpenOCD binary and its scripts,  before
258including the common openocd.board.cmake file:
259
260   .. code-block:: none
261
262      set(OPENOCD "<path_to_openocd_repo>/src/openocd" CACHE FILEPATH "" FORCE)
263      set(OPENOCD_DEFAULT_PATH <path_to_opneocd_repo>/tcl)
264      include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
265
266
267Flashing
268========
269
270
271The board is configured to be flashed using west `STM32CubeProgrammer`_ runner,
272so its :ref:`installation <stm32cubeprog-flash-host-tools>` is required.
273
274Alternatively, OpenOCD or pyOCD can also be used to flash the board using
275the ``--runner`` (or ``-r``) option:
276
277.. code-block:: console
278
279   $ west flash --runner openocd
280   $ west flash --runner pyocd
281
282For pyOCD, additional target information needs to be installed
283by executing the following commands:
284
285.. code-block:: console
286
287   $ pyocd pack --update
288   $ pyocd pack --install stm32h5
289
290Flashing an application to STM32H573I-DK Discovery
291--------------------------------------------------
292
293Connect the STM32H573I-DK Discovery to your host computer using the USB port.
294Then build and flash an application. Here is an example for the
295:zephyr:code-sample:`hello_world` application.
296
297Run a serial host program to connect with your Nucleo board:
298
299.. code-block:: console
300
301   $ minicom -D /dev/ttyACM0
302
303Then build and flash the application.
304
305.. zephyr-app-commands::
306   :zephyr-app: samples/hello_world
307   :board: stm32h573i_dk
308   :goals: build flash
309
310You should see the following message on the console:
311
312.. code-block:: console
313
314   Hello World! stm32h573i_dk
315
316Debugging
317=========
318
319Waiting for OpenOCD support, debugging could be performed with pyOCD which
320requires to enable "pack" support with the following pyOCD command:
321
322.. code-block:: console
323
324   $ pyocd pack --update
325   $ pyocd pack --install stm32h5
326
327Once installed, you can debug an application in the usual way. Here is an
328example for the :zephyr:code-sample:`hello_world` application.
329
330.. zephyr-app-commands::
331   :zephyr-app: samples/hello_world
332   :board: stm32h573i_dk
333   :maybe-skip-config:
334   :goals: debug
335
336.. _STM32H573I-DK Discovery website:
337   https://www.st.com/en/evaluation-tools/stm32h573i-dk.html
338
339.. _STM32H573I-DK Discovery board User Manual:
340   https://www.st.com/en/evaluation-tools/stm32h573i-dk.html
341
342.. _STM32H573 on www.st.com:
343   https://www.st.com/en/microcontrollers/stm32h573ii.html
344
345.. _STM32H573 reference manual:
346   https://www.st.com/resource/en/reference_manual/rm0481-stm32h563h573-and-stm32h562-armbased-32bit-mcus-stmicroelectronics.pdf
347
348.. _STM32CubeProgrammer:
349   https://www.st.com/en/development-tools/stm32cubeprog.html
350
351.. _OpenOCD official Github mirror:
352   https://github.com/openocd-org/openocd/
353
354.. _STMicroelectronics OpenOCD Github:
355   https://github.com/STMicroelectronics/OpenOCD/tree/openocd-cubeide-r6
356