@@ -156,20 +156,22 @@ Copy paste, and update!
156156
157157It is recommended to use a python script to generate those files
158158
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
160160
161161STM32CubeMX has to be installed first. Path has to be specified in the ` cube_path.json ` file.
162162
163163```
164- $ python tools/ targets/STM32_gen_PeripheralPins.py -h
164+ $ python targets/TARGET_STM/tools /STM32_gen_PeripheralPins.py -h
165165
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)
168168
169169Script will generate PeripheralPins.c thanks to the xml files description available in
170170STM32CubeMX directory defined in 'cube_path.json':
171171 C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeMX
172172
173+ More information in targets/TARGET_STM/README.md
174+
173175optional arguments:
174176 -h, --help show this help message and exit
175177 -l, --list list available mcu xml files description in STM32CubeMX
@@ -182,26 +184,33 @@ optional arguments:
182184 specify a custom board .ioc file description to use (use double quotes).
183185
184186Once 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+
185188```
186189
187190How to generate files for a custom boards based on a STM32F427 MCU:
188191```
189- $ python tools/ targets/STM32_gen_PeripheralPins.py -l | grep F427
192+ $ python targets/TARGET_STM/tools /STM32_gen_PeripheralPins.py -l | grep F427
190193STM32F427A(G-I)Hx.xml
191194STM32F427I(G-I)Hx.xml
192195STM32F427I(G-I)Tx.xml
193196STM32F427V(G-I)Tx.xml
194197STM32F427Z(G-I)Tx.xml
195198
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"
197200
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
200203
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'
203206 * 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+
205214```
206215
207216### Use of custom_targets.json
@@ -212,10 +221,10 @@ Example with a board based on STM32F103C8 (like BluePill):
212221- MCU_STM32F103x8 generic configuration is already available in targets.json file
213222
214223```
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
217226
218- $ mv STM32F103C\(8-B\)Tx/ TARGET_BLUEPILL_F103C8
227+ $ mv TARGET_STM32F103C8T TARGET_BLUEPILL_F103C8
219228// Edit PeripheralPins.c and PinNames.h to match your board configuration
220229
221230// Create a custom_targets.json with:
@@ -240,10 +249,10 @@ Example with a board based on STM32H745ZI
240249- MCU_STM32H745I_CM4 and MCU_STM32H745I_CM7 generic configuration is already available in targets.json file
241250
242251```
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
245254
246- $ mv STM32H745ZITx TARGET_H745ZI_BOARD
255+ $ mv TARGET_STM32H745ZIT TARGET_H745ZI_BOARD
247256// Edit PeripheralPins.c and PinNames.h to match your board configuration
248257
249258// Create a custom_targets.json with:
0 commit comments