blob: 61650bc80117ea7f9c4a74192caa1c30fd1fe5cf [file] [log] [blame]
Patrice Chotard458966c2022-04-27 13:54:01 +02001.. SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
2.. sectionauthor:: Patrice Chotard <patrice.chotardy@foss.st.com>
3
4STM32 MCU boards
Heinrich Schuchardtb72160b2023-10-28 11:59:32 +02005================
Patrice Chotard458966c2022-04-27 13:54:01 +02006
7This is a quick instruction for setup STM32 MCU boards.
8
9Supported devices
10-----------------
11
12U-Boot supports the following STMP32 MCU SoCs:
13
14 - STM32F429
15 - STM32F469
16 - STM32F746
17 - STM32F769
18 - STM32H743
19 - STM32H750
20
21SoCs information:
22-----------------
23STM32F4 series are Cortex-M4 MCU.
24STM32F7 and STM32H7 series are Cortex-M7 MCU.
25
26 + STM32F4 series: https://www.st.com/en/microcontrollers-microprocessors/stm32f4-series.html
27 + STM32F7 series: https://www.st.com/en/microcontrollers-microprocessors/stm32f7-series.html
28 + STM32H7 series: https://www.st.com/en/microcontrollers-microprocessors/stm32h7-series.html
29
30Currently the following boards are supported:
31
32 + stm32f429-discovery
33 + stm32f469-discovery
34 + stm32746g-evaluation
35 + stm32f746-discovery
36 + stm32f769-discovery
37 + stm32h743i-discovery
38 + stm32h743i-evaluation
39 + stm32h750i-art-pi
40
41Boot Sequences
42--------------
43
44For STM32F7 series, 2 boot configurations are supported with and without SPL
45
46+------------------------+-------------------------+--------------+
47| **FSBL** | **SSBL** | **OS** |
48+------------------------+-------------------------+--------------+
49| First Stage Bootloader | Second Stage Bootloader | Linux Kernel |
50+------------------------+-------------------------+--------------+
51| embedded Flash | DDR |
52+------------------------+-------------------------+--------------+
53
54The boot chain with SPL
55```````````````````````
56
57defconfig_file :
58 + **stm32746g-eval_spl_defconfig**
59 + **stm32f746-disco_spl_defconfig**
60 + **stm32f769-disco_spl_defconfig**
61
62+------------+------------+-------+
63| FSBL | SSBL | OS |
64+------------+------------+-------+
65|U-Boot SPL | U-Boot | Linux |
66+------------+------------+-------+
67
68The boot chain without SPL
69``````````````````````````
70
71defconfig_file :
72 + **stm32f429-discovery_defconfig**
73 + **stm32f429-evaluation_defconfig**
74 + **stm32f469-discovery_defconfig**
75 + **stm32746g-eval_defconfig**
76 + **stm32f746-disco_defconfig**
77 + **stm32f769-disco_defconfig**
78 + **stm32h743-disco_defconfig**
79 + **stm32h743-eval_defconfig**
80 + **stm32h750-art-pi_defconfig**
81
82+-----------+-------+
83| FSBL | OS |
84+-----------+-------+
85|U-Boot | Linux |
86+-----------+-------+
87
88Build Procedure
89---------------
90
911. Install the required tools for U-Boot
92
93 * install package needed in U-Boot makefile
94 (libssl-dev, swig, libpython-dev...)
95
96 * install ARMv7 toolchain for 32bit Cortex-A (from Linaro,
97 from SDK for STM32MP15x, or any crosstoolchains from your distribution)
98 (you can use any gcc cross compiler compatible with U-Boot)
99
1002. Set the cross compiler::
101
102 # export CROSS_COMPILE=/path/to/toolchain/arm-linux-gnueabi-
103
1043. Select the output directory (optional)::
105
106 # export KBUILD_OUTPUT=/path/to/output
107
108 for example: use one output directory for each configuration::
109
110 # export KBUILD_OUTPUT=stm32f4
111 # export KBUILD_OUTPUT=stm32f7
112 # export KBUILD_OUTPUT=stm32h7
113
114 you can build outside of code directory::
115
116 # export KBUILD_OUTPUT=../build/stm32f4
117
1184. Configure U-Boot::
119
120 # make <defconfig_file>
121
122 For example with <defconfig_file>:
123
124 - For **stm32f429 discovery** board : **stm32f429-discovery_defconfig**
125 - For **stm32f769 discovery** board with SPL: **stm32f769-disco_spl_defconfig**
126 - For **stm32f769 discovery** board without SPL: **stm32f769-disco_defconfig**
127
1285. Configure the device-tree and build the U-Boot image::
129
130 # make DEVICE_TREE=<name> all
131
132 Examples:
133
134 a) boot with SPL on stm32f746 discovery board::
135
136 # export KBUILD_OUTPUT=stm32f746-disco
137 # make stm32f746-disco_spl_defconfig
138 # make all
139
140 b) boot without SPL on stm32f746 discovery board::
141
142 # export KBUILD_OUTPUT=stm32f746-disco
143 # make stm32f746-disco_defconfig
144 # make all
145
146 c) boot on stm32h743 discovery board::
147
148 # export KBUILD_OUTPUT=stm32h743-disco
149 # make stm32h743-disco_defconfig
150 # make all
151
152 d) boot on stm32h743 evaluation board::
153
154 # export KBUILD_OUTPUT=stm32h743-disco
155 # make stm32h743-eval_defconfig
156 # make all
157
1586. U-Boot Output files
159
160 So in the output directory (selected by KBUILD_OUTPUT),
161 you can found the needed U-Boot files, for example::
162
163 - stm32f746-disco_defconfig = **u-boot-dtb.bin** and **u-boot.dtb**
164
165 - FSBL = u-boot-dtb.bin
166
167 - stm32f746-disco_spl_defconfig = **u-boot-dtb.bin**, **u-boot.dtb** and **u-boot-with-spl.bin**
168
169 - FSBL + SSBL = u-boot-with-spl.bin
170 - SSBL = u-boot-dtb.bin
171
1727. Flash U-Boot files
173
174Plug STM32 MCUs board using the USB ST-Link connector, hence it will expose
175the flash area as a mass-storage. In this mass-storage you will find the
176following files:
177
178- DETAILS.TXT: give the bootrom version and build
179- MBED.HTM: shortcul to the hardware board description web page from st.com.
180
181Copy/paste the u-boot.bin or u-boot-with-spl.bin (in case of bootchain with SPL)
182to this mass-storage. The "COM" LED will blink alternatively red and green during
183the flash process. When done the board will reboot automatically.
184
185In case of boot with SPL, by default SPL will try to load either a Linux
186kernel (falcon mode) or, if the key "c" is maintained pressed, the main U-Boot.