Skip to content

Commit 64b11c5

Browse files
committed
STM32 PeripheralPins generation script: add OSPI parsing
1 parent f130724 commit 64b11c5

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

tools/targets/STM32_gen_PeripheralPins.py

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
* mbed Microcontroller Library
33
* Copyright (c) 2006-2018 ARM Limited
4+
* Copyright (c) 2019 STMicroelectronics
45
*
56
* Licensed under the Apache License, Version 2.0 (the "License");
67
* you may not use this file except in compliance with the License.
@@ -26,7 +27,7 @@
2627
from xml.dom.minidom import parse, Node
2728
from argparse import RawTextHelpFormatter
2829

29-
GENPINMAP_VERSION = "1.5"
30+
GENPINMAP_VERSION = "1.7"
3031

3132
ADD_DEVICE_IF = 0
3233
ADD_QSPI_FEATURE = 1
@@ -79,6 +80,7 @@
7980
"NUCLEO_F446RE":"TIM5",
8081
"NUCLEO_F410RB":"TIM5",
8182
"NUCLEO_F429ZI":"TIM5",
83+
"STM32F427V(G-I)Tx":"TIM5",
8284
"NUCLEO_F446ZE":"TIM5",
8385
"NUCLEO_F412ZG":"TIM5",
8486
"NUCLEO_F413ZH":"TIM5",
@@ -99,6 +101,7 @@
99101
"NUCLEO_L4R5ZI":"TIM5",
100102
"NUCLEO_L4R5ZI_P":"TIM5",
101103

104+
"NUCLEO_WB55R":"TIM16",
102105
"DISCO_F051R8":"TIM1",
103106
"DISCO_F100RB":"TIM4",
104107
"DISCO_F303VC":"TIM2",
@@ -114,7 +117,8 @@
114117
"DISCO_L072CZ_LRWAN1":"TIM21",
115118
"DISCO_L475VG_IOT01A":"TIM5",
116119
"DISCO_L476VG":"TIM5",
117-
"DISCO_L496AG":"TIM5"
120+
"DISCO_L496AG":"TIM5",
121+
"DISCO_L4R9A":"TIM5"
118122
}
119123

120124

@@ -852,7 +856,10 @@ def print_qspi(l):
852856
CommentedLine = "//"
853857
s1 = "%-16s" % (CommentedLine + " {" + p[0] + ',')
854858
# p[2] : QUADSPI_BK1_IO3 / QUADSPI_CLK / QUADSPI_NCS
855-
s1 += "%-8s" % ('QSPI_1,')
859+
if "OCTOSPIM_P2" in p[2]:
860+
s1 += "%-8s" % ('QSPI_2,')
861+
else:
862+
s1 += "%-8s" % ('QSPI_1,')
856863
result = result.replace("GPIO_AF10_OTG_FS", "GPIO_AF10_QSPI")
857864
s1 += 'STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, ' + result +')},'
858865
s1 += ' // ' + p[2]
@@ -1001,13 +1008,13 @@ def parse_pins():
10011008
store_can(pin, name, sig)
10021009
if "ETH" in sig:
10031010
store_eth(pin, name, sig)
1004-
if "QUADSPI" in sig:
1011+
if "QUADSPI" in sig or "OCTOSPI" in sig:
10051012
store_qspi(pin, name, sig)
10061013
if "USB" in sig:
10071014
store_usb(pin, name, sig)
10081015
if "RCC_OSC" in sig:
10091016
store_osc(pin, name, sig)
1010-
if "SYS_" in sig:
1017+
if "SYS_" in sig or "PWR_" in sig or "DEBUG_" in sig:
10111018
store_sys(pin, name, sig)
10121019

10131020

@@ -1072,6 +1079,8 @@ def parse_BoardFile(fileName):
10721079
PinLabel[EachPin] = "STDIO_UART_RX"
10731080
else:
10741081
PinLabel[EachPin] = "STDIO_UART_TX"
1082+
elif "_RESERVED" in PinLabel[EachPin]:
1083+
PinLabel[EachPin] = "RESERVED_RADIO"
10751084
except:
10761085
pass
10771086

@@ -1225,16 +1234,22 @@ def parse_BoardFile(fileName):
12251234
TargetName += "DISCO_"
12261235
elif "Evaluation" in board_file_name:
12271236
TargetName += "EVAL_"
1228-
m = re.search(r'STM32([\w][\dR]{3}[\w]{0,2})[\w]*_Board', board_file_name)
1237+
m = re.search(r'STM32([\w]{1,2}[\dR]{3}[\w]{0,2})[\w]*_Board', board_file_name)
12291238
if m:
12301239
TargetName += "%s" % m.group(1)
12311240
# specific case
12321241
if "-P" in args.target:
12331242
TargetName += "_P"
1243+
1244+
if "H743ZI2" in board_file_name:
1245+
TargetName += "2"
1246+
12341247
if TargetName == "DISCO_L072C":
12351248
TargetName += "Z_LRWAN1"
1236-
if TargetName == "DISCO_L475V":
1249+
elif TargetName == "DISCO_L475V":
12371250
TargetName += "G_IOT01A"
1251+
elif TargetName == "DISCO_G071RBT":
1252+
TargetName = "DISCO_G071RB"
12381253
else:
12391254
quit()
12401255

0 commit comments

Comments
 (0)