@@ -156,20 +156,22 @@ Copy paste, and update!
156
156
157
157
It is recommended to use a python script to generate those files
158
158
159
- https://github.com/ARMmbed/mbed-os/blob/master/tools/ targets/STM32_gen_PeripheralPins.py
159
+ https://github.com/ARMmbed/mbed-os/blob/master/targets/TARGET_STM/tools /STM32_gen_PeripheralPins.py
160
160
161
161
STM32CubeMX has to be installed first. Path has to be specified in the ` cube_path.json ` file.
162
162
163
163
```
164
- $ python tools/ targets/STM32_gen_PeripheralPins.py -h
164
+ $ python targets/TARGET_STM/tools /STM32_gen_PeripheralPins.py -h
165
165
166
- Script version 1.9
167
- usage: STM32_gen_PeripheralPins.py [-h] [ -l | -b | -m xml | -t HW | -c CUSTOM]
166
+ Script version 1.17
167
+ usage: STM32_gen_PeripheralPins.py [-h] ( -l | -b | -m xml | -t HW | -c CUSTOM)
168
168
169
169
Script will generate PeripheralPins.c thanks to the xml files description available in
170
170
STM32CubeMX directory defined in 'cube_path.json':
171
171
C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeMX
172
172
173
+ More information in targets/TARGET_STM/README.md
174
+
173
175
optional arguments:
174
176
-h, --help show this help message and exit
175
177
-l, --list list available mcu xml files description in STM32CubeMX
@@ -182,26 +184,33 @@ optional arguments:
182
184
specify a custom board .ioc file description to use (use double quotes).
183
185
184
186
Once generated, you have to check and comment pins that can not be used (specific HW, internal ADC channels, remove PWM using us ticker timer, ...)
187
+
185
188
```
186
189
187
190
How to generate files for a custom boards based on a STM32F427 MCU:
188
191
```
189
- $ python tools/ targets/STM32_gen_PeripheralPins.py -l | grep F427
192
+ $ python targets/TARGET_STM/tools /STM32_gen_PeripheralPins.py -l | grep F427
190
193
STM32F427A(G-I)Hx.xml
191
194
STM32F427I(G-I)Hx.xml
192
195
STM32F427I(G-I)Tx.xml
193
196
STM32F427V(G-I)Tx.xml
194
197
STM32F427Z(G-I)Tx.xml
195
198
196
- $ python tools/ targets/STM32_gen_PeripheralPins.py -m "STM32F427V(G-I)Tx.xml"
199
+ $ python targets/TARGET_STM/tools /STM32_gen_PeripheralPins.py -m "STM32F427V(G-I)Tx.xml"
197
200
198
- Script version 1.9
199
- CubeMX DB version DB.5 .0.60
201
+ Script version 1.17
202
+ CubeMX DB version DB.6 .0.0
200
203
201
- * Output directory: C:\github\mbed\STM32F427V(G-I)Tx
202
- * Generating PeripheralPins.c and PinNames.h with 'STM32F427V(G-I)Tx.xml'
204
+ * Output directory: targets_custom\TARGET_STM\TARGET_STM32F4\TARGET_STM32F427xG\TARGET_STM32F427VGT
205
+ * Generating PeripheralPins.c and PinNames.h with 'C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeMX\db\mcu\ STM32F427V(G-I)Tx.xml'
203
206
* GPIO file: C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeMX\db\mcu\IP\GPIO-STM32F427_gpio_v1_0_Modes.xml
204
- * I/O pins found: 82 connected: 0
207
+ * I/O pins found: 135 connected: 0
208
+
209
+ * Output directory: targets_custom\TARGET_STM\TARGET_STM32F4\TARGET_STM32F427xI\TARGET_STM32F427VIT
210
+ * Generating PeripheralPins.c and PinNames.h with 'C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeMX\db\mcu\STM32F427V(G-I)Tx.xml'
211
+ * GPIO file: C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeMX\db\mcu\IP\GPIO-STM32F427_gpio_v1_0_Modes.xml
212
+ * I/O pins found: 135 connected: 0
213
+
205
214
```
206
215
207
216
### Use of custom_targets.json
@@ -212,10 +221,10 @@ Example with a board based on STM32F103C8 (like BluePill):
212
221
- MCU_STM32F103x8 generic configuration is already available in targets.json file
213
222
214
223
```
215
- $ python tools/ targets/STM32_gen_PeripheralPins.py -m "STM32F103C(8-B)Tx.xml"
216
- // PeripheralPins.c and PinNames.h template files are created in STM32H745ZITx directory
224
+ $ python targets/TARGET_STM/tools /STM32_gen_PeripheralPins.py -m "STM32F103C(8-B)Tx.xml"
225
+ // PeripheralPins.c and PinNames.h template files are created in targets_custom/TARGET_STM/TARGET_STM32F1/TARGET_STM32F103x8/TARGET_STM32F103C8T directory
217
226
218
- $ mv STM32F103C\(8-B\)Tx/ TARGET_BLUEPILL_F103C8
227
+ $ mv TARGET_STM32F103C8T TARGET_BLUEPILL_F103C8
219
228
// Edit PeripheralPins.c and PinNames.h to match your board configuration
220
229
221
230
// Create a custom_targets.json with:
@@ -240,10 +249,10 @@ Example with a board based on STM32H745ZI
240
249
- MCU_STM32H745I_CM4 and MCU_STM32H745I_CM7 generic configuration is already available in targets.json file
241
250
242
251
```
243
- $ python tools/ targets/STM32_gen_PeripheralPins.py -m "STM32H745ZITx.xml"
244
- // PeripheralPins.c and PinNames.h template files are created in STM32H745ZITx directory
252
+ $ python targets/TARGET_STM/tools /STM32_gen_PeripheralPins.py -m "STM32H745ZITx.xml"
253
+ // PeripheralPins.c and PinNames.h template files are created in targets_custom/TARGET_STM/TARGET_STM32H7/TARGET_STM32H745xI/TARGET_STM32H745ZIT directory
245
254
246
- $ mv STM32H745ZITx TARGET_H745ZI_BOARD
255
+ $ mv TARGET_STM32H745ZIT TARGET_H745ZI_BOARD
247
256
// Edit PeripheralPins.c and PinNames.h to match your board configuration
248
257
249
258
// Create a custom_targets.json with:
0 commit comments