Skip to content

Commit d9f5492

Browse files
authored
Merge pull request #2987 from fpistm/c5_support
STMC5xx support based on HALv2
2 parents c2974f9 + 7747661 commit d9f5492

668 files changed

Lines changed: 488303 additions & 1811 deletions

File tree

Some content is hidden

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

‎.github/workflows/Cmake.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
matrix:
3333
boardname:
3434
- NUCLEO_C092RC
35+
- NUCLEO_C562RE
3536
- NUCLEO_F091RC
3637
- NUCLEO_F103RB
3738
- NUCLEO_F207ZG

‎CI/build/examples/BareMinimum/BareMinimum.ino‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
* It allows to test build of built-in libraries
44
* and can not be executed.
55
*/
6-
6+
#if defined(HAL_FLASH_MODULE_ENABLED)
77
#include <EEPROM.h>
8+
#endif
89
#ifndef STM32MP1xx
910
#include <IWatchdog.h>
1011
#endif
@@ -14,7 +15,7 @@
1415
#include <SPI.h>
1516
#include <SoftwareSerial.h>
1617
#include <Wire.h>
17-
#if defined(I3C1_BASE) || defined(I3C2_BASE)
18+
#if (defined(I3C1_BASE) || defined(I3C2_BASE)) && defined(HAL_I3C_MODULE_ENABLED)
1819
#include <I3C.h>
1920
#endif
2021

@@ -91,10 +92,11 @@ void setup() {
9192
}
9293
swSerial.end();
9394

95+
#if defined(HAL_FLASH_MODULE_ENABLED)
9496
// EEPROM
9597
byte value = EEPROM.read(0x01);
9698
EEPROM.write(EEPROM.length() - 1, value);
97-
99+
#endif
98100
#ifndef STM32MP1xx
99101
// IWDG
100102
if (!IWatchdog.isReset(true)) {
@@ -135,7 +137,7 @@ void setup() {
135137
Wire.requestFrom(2, 1);
136138
Wire.end();
137139

138-
#if defined(I3C1_BASE) || defined(I3C2_BASE)
140+
#if (defined(I3C1_BASE) || defined(I3C2_BASE)) && defined(HAL_I3C_MODULE_ENABLED)
139141
// I3C
140142
I3C.setBusType(I3CBusType::Pure);
141143
I3C.setMixedBusOpenDrainFrequency(1000000U);

‎CI/update/stm32_series.json‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,8 @@
2424
"WB": "xx",
2525
"WL3": "x",
2626
"WL": "xx"
27+
},
28+
"seriesv2": {
29+
"C5": "xx"
2730
}
28-
}
31+
}

‎CI/update/stm32cube.py‎

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
getRepoBranchName,
2525
commitFiles,
2626
loadSTM32Series,
27+
addSeriesToConfig,
2728
)
2829

2930
if sys.platform.startswith("win32"):
@@ -138,7 +139,7 @@ def checkConfig():
138139
else:
139140
defaultConfig(config_file_path, {"REPO_LOCAL_PATH": str(repo_local_path)})
140141
createFolder(repo_local_path)
141-
stm32_dict = loadSTM32Series(script_path)
142+
stm32_dict = loadSTM32Series(script_path, True, False)
142143

143144

144145
def updateStm32Def(series):
@@ -903,17 +904,6 @@ def updateOpenAmp():
903904
copyFolder(OpenAmp_cube_path, OpenAmp_core_path)
904905

905906

906-
def addSeriesToConfig(series, nx):
907-
stm32_series_file = stm32_series_json_path / "stm32_series.json"
908-
with open(stm32_series_file, "r") as fp:
909-
stm32_series_data = json.load(fp)
910-
if series not in stm32_series_data:
911-
stm32_series_data["series"][series] = nx
912-
with open(stm32_series_file, "w") as fp:
913-
json.dump(stm32_series_data, fp, indent=2)
914-
print(f"Added series {series} with nx={nx} to stm32_series.json")
915-
916-
917907
def updateCore():
918908
global nx
919909
for series in stm32_list:
@@ -1046,7 +1036,7 @@ def updateCore():
10461036
print("No stm32_def file were updated!")
10471037
sys.exit(1)
10481038
# Add the new series to the json config file
1049-
addSeriesToConfig(series, nx)
1039+
addSeriesToConfig(stm32_series_json_path, series, nx, "series")
10501040
if not commitFiles(core_path, series_commit_msg):
10511041
print("No stm32_series.json file were updated!")
10521042

0 commit comments

Comments
 (0)