Skip to content

Commit cbfd59e

Browse files
authored
Merge pull request #1453 from fpistm/STM32U5
Add STM32U5xx support
2 parents ba1d5ee + 19496d9 commit cbfd59e

File tree

597 files changed

+386943
-143
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

597 files changed

+386943
-143
lines changed

CI/utils/stm32variant.py

Lines changed: 62 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
quadspidata1_list = [] # ['PIN','name','QUADSPIDATA1', ['af']]
3939
quadspidata2_list = [] # ['PIN','name','QUADSPIDATA2', ['af']]
4040
quadspidata3_list = [] # ['PIN','name','QUADSPIDATA3', ['af']]
41+
quadspidata4_list = [] # ['PIN','name','QUADSPIDATA4', ['af']]
42+
quadspidata5_list = [] # ['PIN','name','QUADSPIDATA5', ['af']]
43+
quadspidata6_list = [] # ['PIN','name','QUADSPIDATA6', ['af']]
44+
quadspidata7_list = [] # ['PIN','name','QUADSPIDATA7', ['af']]
4145
quadspisclk_list = [] # ['PIN','name','QUADSPISCLK', ['af']]
4246
quadspissel_list = [] # ['PIN','name','QUADSPISSEL', ['af']]
4347
syswkup_list = [] # ['PIN','name','SYSWKUP']
@@ -480,7 +484,7 @@ def store_eth(pin, name, signal):
480484
eth_list.append([pin, name, signal])
481485

482486

483-
# Store QSPI pins
487+
# Store O/QSPI pins
484488
def store_qspi(pin, name, signal):
485489
if "_IO0" in signal:
486490
quadspidata0_list.append([pin, name, signal])
@@ -490,6 +494,14 @@ def store_qspi(pin, name, signal):
490494
quadspidata2_list.append([pin, name, signal])
491495
if "_IO3" in signal:
492496
quadspidata3_list.append([pin, name, signal])
497+
if "_IO4" in signal:
498+
quadspidata4_list.append([pin, name, signal])
499+
if "_IO5" in signal:
500+
quadspidata5_list.append([pin, name, signal])
501+
if "_IO6" in signal:
502+
quadspidata6_list.append([pin, name, signal])
503+
if "_IO7" in signal:
504+
quadspidata7_list.append([pin, name, signal])
493505
if "_CLK" in signal:
494506
quadspisclk_list.append([pin, name, signal])
495507
if "_NCS" in signal:
@@ -858,6 +870,14 @@ def qspi_pinmap(lst):
858870
aname = name + "_DATA2"
859871
elif lst == quadspidata3_list:
860872
aname = name + "_DATA3"
873+
elif lst == quadspidata4_list:
874+
aname = name + "_DATA4"
875+
elif lst == quadspidata5_list:
876+
aname = name + "_DATA5"
877+
elif lst == quadspidata6_list:
878+
aname = name + "_DATA6"
879+
elif lst == quadspidata7_list:
880+
aname = name + "_DATA7"
861881
elif lst == quadspisclk_list:
862882
aname = name + "_SCLK"
863883
else:
@@ -1044,6 +1064,10 @@ def print_peripheral():
10441064
qspi_pinmap(quadspidata1_list),
10451065
qspi_pinmap(quadspidata2_list),
10461066
qspi_pinmap(quadspidata3_list),
1067+
qspi_pinmap(quadspidata4_list),
1068+
qspi_pinmap(quadspidata5_list),
1069+
qspi_pinmap(quadspidata6_list),
1070+
qspi_pinmap(quadspidata7_list),
10471071
qspi_pinmap(quadspisclk_list),
10481072
qspi_pinmap(quadspissel_list),
10491073
),
@@ -1056,32 +1080,21 @@ def print_peripheral():
10561080

10571081
# PinNamesVar.h generation
10581082
def manage_syswkup():
1059-
syswkup_pins_list = []
1083+
syswkup_pins_list = [[] for _ in range(8)]
10601084
if len(syswkup_list) != 0:
1061-
# H7xx and F446 start from 0, inc by 1
1062-
inc = 0
1085+
# H7xx and F446 start from 0
1086+
base_index = 1
10631087
if syswkup_list[0][2].replace("SYS_WKUP", "") == "0":
1064-
inc = 1
1065-
# Fill list with missing SYS_WKUPx set to NC
1066-
i = 0
1067-
while i < 8:
1068-
num = 0
1069-
if len(syswkup_list) > i:
1070-
n = syswkup_list[i][2].replace("SYS_WKUP", "")
1071-
if len(n) != 0:
1072-
num = int(n) if inc == 1 else int(n) - 1
1073-
x = i if inc == 1 else i + 1
1074-
if num != i:
1075-
syswkup_list.insert(i, ["NC", "NC_" + str(x), "SYS_WKUP" + str(x)])
1076-
i += 1
1088+
base_index = 0
10771089
for p in syswkup_list:
10781090
num = p[2].replace("SYS_WKUP", "")
1079-
if (inc == 1) and (p[0] != "NC"):
1080-
cmt = " /* " + p[2] + " */"
1081-
else:
1091+
num = int(num) if num else 1
1092+
if base_index == 1:
1093+
num -= 1
10821094
cmt = ""
1083-
syswkup_pins_list.append([p[0], cmt])
1084-
1095+
else:
1096+
cmt = " /* " + p[2] + " */"
1097+
syswkup_pins_list[num].append([p[0], cmt])
10851098
return syswkup_pins_list
10861099

10871100

@@ -1127,6 +1140,12 @@ def print_pinamevar():
11271140
usb_pins_list=sorted_usb_pins_list,
11281141
)
11291142
)
1143+
alt_syswkup_list = []
1144+
for idx, syswkup_list in enumerate(syswkup_pins_list, start=1):
1145+
if len(syswkup_list) > 1:
1146+
for idx2, lst in enumerate(syswkup_list[1:], start=1):
1147+
alt_syswkup_list.append("{}_{}".format(idx, idx2))
1148+
return alt_syswkup_list
11301149

11311150

11321151
# Variant files generation
@@ -1253,7 +1272,7 @@ def timer_variant():
12531272
return dict(tone=tone, servo=servo)
12541273

12551274

1256-
def print_variant(generic_list):
1275+
def print_variant(generic_list, alt_syswkup_list):
12571276
variant_h_template = j2_env.get_template(variant_h_filename)
12581277
variant_cpp_template = j2_env.get_template(variant_cpp_filename)
12591278

@@ -1344,6 +1363,7 @@ def print_variant(generic_list):
13441363
year=datetime.datetime.now().year,
13451364
pins_number_list=pins_number_list,
13461365
alt_pins_list=alt_pins_list,
1366+
alt_syswkup_list=alt_syswkup_list,
13471367
waltpin=max(waltpin),
13481368
num_digital_pins=num_digital_pins,
13491369
num_dualpad_pins=num_dualpad_pins,
@@ -1538,6 +1558,10 @@ def sort_my_lists():
15381558
quadspidata1_list.sort(key=natural_sortkey)
15391559
quadspidata2_list.sort(key=natural_sortkey)
15401560
quadspidata3_list.sort(key=natural_sortkey)
1561+
quadspidata4_list.sort(key=natural_sortkey)
1562+
quadspidata5_list.sort(key=natural_sortkey)
1563+
quadspidata6_list.sort(key=natural_sortkey)
1564+
quadspidata7_list.sort(key=natural_sortkey)
15411565
quadspisclk_list.sort(key=natural_sortkey)
15421566
quadspissel_list.sort(key=natural_sortkey)
15431567
syswkup_list.sort(key=natural_sortkey2)
@@ -1572,6 +1596,10 @@ def clean_all_lists():
15721596
del quadspidata1_list[:]
15731597
del quadspidata2_list[:]
15741598
del quadspidata3_list[:]
1599+
del quadspidata4_list[:]
1600+
del quadspidata5_list[:]
1601+
del quadspidata6_list[:]
1602+
del quadspidata7_list[:]
15751603
del quadspisclk_list[:]
15761604
del quadspissel_list[:]
15771605
del syswkup_list[:]
@@ -1602,6 +1630,10 @@ def manage_af_and_alternate():
16021630
add_af(quadspidata1_list)
16031631
add_af(quadspidata2_list)
16041632
add_af(quadspidata3_list)
1633+
add_af(quadspidata4_list)
1634+
add_af(quadspidata5_list)
1635+
add_af(quadspidata6_list)
1636+
add_af(quadspidata7_list)
16051637
add_af(quadspisclk_list)
16061638
add_af(quadspissel_list)
16071639
add_af(usb_list)
@@ -1631,6 +1663,10 @@ def manage_af_and_alternate():
16311663
update_alternate(quadspidata1_list)
16321664
update_alternate(quadspidata2_list)
16331665
update_alternate(quadspidata3_list)
1666+
update_alternate(quadspidata4_list)
1667+
update_alternate(quadspidata5_list)
1668+
update_alternate(quadspidata6_list)
1669+
update_alternate(quadspidata7_list)
16341670
update_alternate(quadspisclk_list)
16351671
update_alternate(quadspissel_list)
16361672
update_alternate(syswkup_list)
@@ -2375,8 +2411,9 @@ def manage_repo():
23752411
generic_list = print_boards_entry()
23762412
print_general_clock(generic_list)
23772413
print_peripheral()
2378-
print_pinamevar()
2379-
print_variant(generic_list)
2414+
alt_syswkup_list = print_pinamevar()
2415+
print_variant(generic_list, alt_syswkup_list)
2416+
del alt_syswkup_list[:]
23802417
del generic_list[:]
23812418
print(
23822419
"* Total I/O pins found: {}".format(

CI/utils/templates/PinNamesVar.h

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,42 @@
11
{% if dualpad_pins_list %}
22
/* Dual pad pin name */
3-
{% for dp in dualpad_pins_list %}
3+
{% for dp in dualpad_pins_list %}
44
{{"%s = %s | PDUAL,"|format(dp.name.ljust(waltpin), dp.base.ljust(waltpin-5))}}
5-
{% endfor %}
5+
{% endfor %}
66

77
{% endif %}
88
{% if remap_pins_list %}
99
/* Remap pin name */
10-
{% for dp in remap_pins_list %}
10+
{% for dp in remap_pins_list %}
1111
{{"%s = %s | PREMAP,"|format(dp.name.ljust(waltpin), dp.base.ljust(waltpin-5))}}
12-
{% endfor %}
12+
{% endfor %}
1313

1414
{% endif %}
1515
{% if alt_pins_list %}
1616
/* Alternate pin name */
17-
{% for alt in alt_pins_list %}
17+
{% for alt in alt_pins_list %}
1818
{{"%s = %s | %s,"|format(alt.name.ljust(waltpin), alt.base.ljust(waltpin-5), alt.num)}}
19-
{% endfor %}
19+
{% endfor %}
2020
{% else %}
2121
/* No alternate */
2222
{% endif %}
2323

2424
{% if syswkup_pins_list %}
2525
/* SYS_WKUP */
26-
{% for syswkup in syswkup_pins_list %}
26+
{% for syswkup_list in syswkup_pins_list %}
27+
{% set outer_loop = loop %}
28+
{% if syswkup_list %}
29+
{% for syswkup in syswkup_list %}
30+
#ifdef PWR_WAKEUP_PIN{{outer_loop.index}}
31+
SYS_WKUP{{outer_loop.index}}{{"_{}".format(loop.index - 1) if loop.index > 1}} = {{syswkup[0]}},{{syswkup[1]}}
32+
#endif
33+
{% endfor %}
34+
{% else %}
2735
#ifdef PWR_WAKEUP_PIN{{loop.index}}
28-
SYS_WKUP{{loop.index}} = {{syswkup[0]}},{{syswkup[1]}}
36+
SYS_WKUP{{loop.index}} = NC,
2937
#endif
30-
{% endfor %}
38+
{% endif %}
39+
{% endfor %}
3140
{% else %}
3241
/* No SYS_WKUP */
3342
{% endif %}

CI/utils/templates/variant_generic.h

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
{% if alt_pins_list %}
2222

2323
// Alternate pins number
24-
{% for alt in alt_pins_list %}
24+
{% for alt in alt_pins_list %}
2525
#define {{"%-23s (%s | %s)"|format(alt.name, alt.base.ljust(waltpin-5), alt.num)}}
26-
{% endfor %}
26+
{% endfor %}
2727
{% endif %}
2828

2929
#define NUM_DIGITAL_PINS {{num_digital_pins}}
@@ -101,11 +101,18 @@
101101

102102
{% if hal_modules_list %}
103103
// Extra HAL modules
104-
{% for hal_module in hal_modules_list %}
104+
{% for hal_module in hal_modules_list %}
105105
#if !defined(HAL_{{hal_module}}_MODULE_DISABLED)
106106
#define HAL_{{hal_module}}_MODULE_ENABLED
107107
#endif
108-
{% endfor %}
108+
{% endfor %}
109+
110+
{% endif %}
111+
{% if alt_syswkup_list %}
112+
// Alternate SYS_WKUP definition
113+
{% for def in alt_syswkup_list %}
114+
#define PWR_WAKEUP_PIN{{def}}
115+
{% endfor %}
109116

110117
{% endif %}
111118
/*----------------------------------------------------------------------------

README.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
6565
- [Generic STM32L1 boards](#generic-stm32l1-boards)
6666
- [Generic STM32L4 boards](#generic-stm32l4-boards)
6767
- [Generic STM32L5 boards](#generic-stm32l5-boards)
68+
- [Generic STM32U5 boards](#generic-stm32u5-boards)
6869
- [Generic STM32WB boards](#generic-stm32wb-boards)
70+
- [Generic STM32WL boards](#generic-stm32wb-boards)
6971
- [3D printer boards](#3d-printer-boards)
7072
- [LoRa boards](#lora-boards)
7173
- [Electronic Speed Controller boards](#electronic-speed-controller-boards)
@@ -90,6 +92,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
9092
| :green_heart: | STM32L4R5ZI-P | [Nucleo L4R5ZI-P](http://www.st.com/en/evaluation-tools/nucleo-l4r5zi-p.html) | *1.4.0* | |
9193
| :green_heart: | STM32L552ZE-Q | [Nucleo L552ZE-Q](https://www.st.com/en/evaluation-tools/nucleo-l552ze-q.html) | *2.0.0* | |
9294
| :green_heart: | STM32H743ZI | [Nucleo H743ZI(2)](https://www.st.com/en/evaluation-tools/nucleo-h743zi.html) | *1.5.0* | Nucleo H743ZI2 since 1.6.0 |
95+
| :yellow_heart: | STM32U575ZI-Q | [NUCLEO-U575ZI-Q](https://www.st.com/en/evaluation-tools/nucleo-u575zi-q.html) | **2.1.0** | |
9396

9497
### [Nucleo 64](https://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/mcu-eval-tools/stm32-mcu-eval-tools/stm32-nucleo-boards.html) boards
9598

@@ -141,15 +144,14 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
141144
| :green_heart: | STM32F030R8 | [32F0308DISCOVERY](http://www.st.com/en/evaluation-tools/32f0308discovery.html) | *1.3.0* | |
142145
| :green_heart: | STM32F072RB | [32F072BDISCOVERY](https://www.st.com/en/evaluation-tools/32f072bdiscovery.html) | *1.5.0* | |
143146
| :green_heart: | STM32F100RB | [STM32VLDISCOVERY](https://www.st.com/en/evaluation-tools/stm32vldiscovery.html) | 0.2.1 | |
144-
| :green_heart: | STM32F303VC | [STM32F3DISCOVERY](https://www.st.com/en/evaluation-tools/stm32f3discovery.html) | *2.0.0* | |
147+
| :green_heart: | STM32F303VC | [STM32F3DISCOVERY](https://www.st.com/en/evaluation-tools/stm32f3discovery.html) | *2.0.0* | |
145148
| :green_heart: | STM32F407VG | [STM32F407G-DISC1](http://www.st.com/en/evaluation-tools/stm32f4discovery.html) | *0.1.0* | |
149+
| :green_heart: | STM32F413ZH | [32F413HDISCOVERY](https://www.st.com/en/evaluation-tools/32f413hdiscovery.html) | *1.9.0* | |
146150
| :green_heart: | STM32F746NG | [STM32F746G-DISCOVERY](http://www.st.com/en/evaluation-tools/32f746gdiscovery.html) | *0.1.0* | |
147151
| :green_heart: | STM32G031J6 | [STM32G0316-DISCO](https://www.st.com/en/evaluation-tools/stm32g0316-disco.html) | *1.9.0* | |
148-
| :green_heart: | STM32G431CB | [B-G431B-ESC1](https://www.st.com/en/evaluation-tools/b-g431b-esc1.html) | *2.0.0* | |
149-
| :green_heart: | STM32L072CZ | [B-L072Z-LRWAN1](http://www.st.com/en/evaluation-tools/b-l072z-lrwan1.html) | *1.1.0* | |
150-
| :green_heart: | STM32L475VG | [B-L475E-IOT01A](http://www.st.com/en/evaluation-tools/b-l475e-iot01a.html) | *1.0.1* | |
151-
| :green_heart: | STM32F413ZH | [32F413HDISCOVERY](https://www.st.com/en/evaluation-tools/32f413hdiscovery.html) | *1.9.0* | |
152-
| :green_heart: | STM32L4S5VI | [B-L4S5I-IOT01A](https://www.st.com/en/evaluation-tools/b-l4s5i-iot01a.html) | *2.0.0* | |
152+
| :green_heart: | STM32G431CB | [B-G431B-ESC1](https://www.st.com/en/evaluation-tools/b-g431b-esc1.html) | *2.0.0* | |
153+
| :green_heart: | STM32L4S5VI | [B-L4S5I-IOT01A](https://www.st.com/en/evaluation-tools/b-l4s5i-iot01a.html) | *2.0.0* | |
154+
| :yellow_heart: | STM32U585AIIxQ | [B-U585I-IOT02A](https://www.st.com/en/evaluation-tools/b-u585i-iot02a.html) | **2.1.0** | |
153155
| :yellow_heart: | STM32WB5MMG | [STM32WB5MM-DK](https://www.st.com/en/evaluation-tools/stm32wb5mm-dk.html) | **2.1.0** | |
154156

155157
### [Eval](https://www.st.com/en/evaluation-tools/stm32-eval-boards.html) boards
@@ -414,6 +416,13 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
414416
| :green_heart: | STM32L552ZC-Q<br>STM32L552ZE-Q | Generic Board | *2.0.0* | |
415417
| :green_heart: | STM32L562ZE-Q | Generic Board | *2.0.0* | |
416418

419+
### Generic STM32U5 boards
420+
421+
| Status | Device(s) | Name | Release | Notes |
422+
| :----: | :-------: | ---- | :-----: | :---- |
423+
| :yellow_heart: | STM32U575AGIxQ<br>STM32U575AIIxQ<br>STM32U585AIIxQ | Generic Board | *2.1.0* | |
424+
| :yellow_heart: | STM32U575ZGTxQ<br>STM32U575ZITxQ<br>STM32U585ZETxQ | Generic Board | **2.1.0** | |
425+
417426
### Generic STM32WB boards
418427

419428
| Status | Device(s) | Name | Release | Notes |

0 commit comments

Comments
 (0)