Skip to content

Commit 7035390

Browse files
committed
Updated the STM32H7RS BSP
1 parent 1df993a commit 7035390

File tree

10 files changed

+2615
-20
lines changed

10 files changed

+2615
-20
lines changed

VendorSampleParsers/stm32/Program.cs

+13-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
namespace GeneratorSampleStm32
2020
{
21-
2221
class Program
2322
{
2423
static public List<string> ToAbsolutePaths(string dir, string topLevelDir, List<string> relativePaths)
@@ -301,7 +300,19 @@ public STM32SampleRelocator(ConstructedVendorSampleDirectory dir, ReverseConditi
301300
new FileBasedConfigEntry(@"usbx/common/usbx_host_classes/src/ux_host_class_(asix|audio|cdc_acm|cdc_ecm|gser|hid|hub|pima|printer|prolific|storage|swar|video)_.*", "com.sysprogs.bspoptions.stm32.usbx.host_class_{1}"),
302301
new FileBasedConfigEntry(@"usbx/common/usbx_(network|pictbridge)/.*", "com.sysprogs.bspoptions.stm32.usbx.{1}"),
303302
}
304-
}
303+
},
304+
305+
new AutoDetectedFramework {FrameworkID = "com.sysprogs.arm.stm32.extmem.manager",
306+
FileRegex = new Regex(@"\$\$SYS:BSP_ROOT\$\$/STM32_ExtMem_Manager/.*", RegexOptions.Compiled | RegexOptions.IgnoreCase),
307+
FileBasedConfig = new[]
308+
{
309+
new FileBasedConfigEntry(@"/stm32_boot_lrun\.c", "com.sysprogs.bspoptions.stm32.extmem.manager.lrun")
310+
}
311+
},
312+
313+
new AutoDetectedFramework {FrameworkID = "com.sysprogs.arm.stm32.bspdrv.lan8742",
314+
FileRegex = new Regex(@"\$\$SYS:BSP_ROOT\$\$/STM32[^/]+/BSP/Components/lan8742/lan8742.c", RegexOptions.Compiled | RegexOptions.IgnoreCase),
315+
},
305316
};
306317

307318

VendorSampleParsers/stm32/Reports/stm32h7rs/1_1_0.xml

+2,289
Large diffs are not rendered by default.

generators/stm32/DeviceListProvider.cs

+6-8
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,8 @@ static CortexCore ParseCore(string coreText)
348348
return CortexCore.M33;
349349
case "M4":
350350
return CortexCore.M4;
351+
case "M55":
352+
return CortexCore.M55;
351353
case "M7":
352354
return CortexCore.M7;
353355
case "A35":
@@ -478,12 +480,6 @@ public List<MCUBuilder> LoadDeviceList(Program.STM32BSPBuilder bspBuilder)
478480

479481
for (int i = 0; i < cores.Length; i++)
480482
{
481-
if ((db.STM32CubeTimestamp == 133657063208138291) && (m.GetAttribute("Name") == "STM32G473QETxZ" || m.GetAttribute("Name") == "STM32U5A5QIIxQ" || m.GetAttribute("Name").StartsWith("STM32U073")))
482-
continue;
483-
484-
if ((db.STM32CubeTimestamp == 133657063208138291) && m.GetAttribute("Name").StartsWith("STM32G411"))
485-
continue; //The startup file is missing as of SDK 1.6.0
486-
487483
try
488484
{
489485
lstMCUs.Add(new ParsedMCU(m, familyDir, db, cores, i));
@@ -495,9 +491,11 @@ public List<MCUBuilder> LoadDeviceList(Program.STM32BSPBuilder bspBuilder)
495491
}
496492
}
497493

498-
if (missingMCUs.Count > 0)
494+
File.WriteAllLines(Path.Combine(Path.GetDirectoryName(bspBuilder.Directories.RulesDir), "MissingMCUs.txt"), missingMCUs.ToArray());
495+
496+
if (missingMCUs.Count > 30)
499497
{
500-
throw new Exception($"Found {missingMCUs} MCUs with missing memory layouts");
498+
throw new Exception($"Found {missingMCUs.Count} MCUs with missing memory layouts");
501499
}
502500

503501
var rawMCUs = lstMCUs.ToArray();

generators/stm32/Program.cs

+16-9
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ This software is licensed under the Sysprogs BSP Generator License.
1919
using Microsoft.Win32;
2020
using stm32_bsp_generator.Rulesets;
2121
using System.Reflection;
22+
using System.Net.Mime;
2223

2324
namespace stm32_bsp_generator
2425
{
@@ -338,7 +339,7 @@ public int Prioritize(string left, string right)
338339

339340
}
340341

341-
//Usage: stm32.exe /rules:{Classic|STM32WB|STM32MP1} [/fetch] [/noperiph] [/nofixes]
342+
//Usage: stm32.exe /rules:{Classic|STM32WB|STM32MP1|stm32h7rs} [/fetch] [/noperiph] [/nofixes]
342343
static void Main(string[] args)
343344
{
344345
var regKey = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\Sysprogs\BSPGenerators\STM32");
@@ -376,7 +377,7 @@ static void Main(string[] args)
376377
else
377378
{
378379
devices = provider.LoadDeviceList(bspBuilder);
379-
var incompleteDevices = devices.Where(d => d.FlashSize == 0 && !d.Name.StartsWith("STM32MP")).ToArray();
380+
var incompleteDevices = devices.Where(d => d.FlashSize == 0 && !d.Name.StartsWith("STM32MP") && !d.Name.StartsWith("STM32N6")).ToArray();
380381
if (incompleteDevices.Length > 0)
381382
throw new Exception($"{incompleteDevices.Length} devices have FLASH Size = 0 ");
382383
}
@@ -572,15 +573,21 @@ static void Main(string[] args)
572573
{
573574
if (f.Contains("thread_secure_stack.c"))
574575
{
575-
var condRec = bspBuilder.MatchedFileConditions[f];
576-
condRec.ConditionToInclude = new Condition.And
576+
var cond = new Condition.Equals { Expression = $"$${fw.ConfigurableProperties.PropertyGroups[0].UniqueID}{secureModeOptionID}$$", ExpectedValue = "1" };
577+
578+
if (!bspBuilder.MatchedFileConditions.TryGetValue(f, out var condRec))
579+
bspBuilder.AddFileCondition(new FileCondition { FilePath = f, ConditionToInclude = cond });
580+
else
577581
{
578-
Arguments = new Condition[]
582+
condRec.ConditionToInclude = new Condition.And
579583
{
580-
condRec.ConditionToInclude ,
581-
new Condition.Equals{Expression = $"$${fw.ConfigurableProperties.PropertyGroups[0].UniqueID}{secureModeOptionID}$$", ExpectedValue = "1"}
582-
}
583-
};
584+
Arguments = new Condition[]
585+
{
586+
condRec.ConditionToInclude,
587+
cond,
588+
}
589+
};
590+
}
584591
}
585592
}
586593
}
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
STM32C051C6Ux
2+
STM32C051K6Tx
3+
STM32C092ECYx
4+
STM32U073C8Tx
5+
STM32U073C8Ux
6+
STM32U073CBTx
7+
STM32U073CBUx
8+
STM32U073CCTx
9+
STM32U073CCUx
10+
STM32U073H8Yx
11+
STM32U073HBYx
12+
STM32U073HCYx
13+
STM32U073K8Ux
14+
STM32U073KCUx
15+
STM32U073M8Ix
16+
STM32U073M8Tx
17+
STM32U073MBIx
18+
STM32U073MBTx
19+
STM32U073MCIx
20+
STM32U073MCTx
21+
STM32U073R8Ix
22+
STM32U073R8Tx
23+
STM32U073RBIx
24+
STM32U073RBTx
25+
STM32U073RCIx
26+
STM32U073RCTx
27+
STM32U5A5QIIxQ

generators/stm32/rules/classic/CommonFiles.xml

+2
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,8 @@ Source\\CMSIS_RTOS_V2\\.*=>v2[CMSIS_RTOS_V2];
347347
<string>ports\\cortex_m7\\.*:$$com.sysprogs.bspoptions.arm.core$$==M7</string>
348348
<string>ports\\cortex_m23\\.*:$$com.sysprogs.bspoptions.arm.core$$==M23</string>
349349
<string>ports\\cortex_m33\\.*:$$com.sysprogs.bspoptions.arm.core$$==M33</string>
350+
<string>ports\\cortex_m55\\.*:$$com.sysprogs.bspoptions.arm.core$$==M55</string>
351+
<string>ports\\cortex_m85\\.*:$$com.sysprogs.bspoptions.arm.core$$==M85</string>
350352
<string>common\\src\\tx_thread_stack_error_(handler|notify)\.[ch]:$$com.sysprogs.bspoptions.arm.core$$=~[AM][0-9]$</string>
351353
</SimpleFileConditions>
352354
</CopyJob>

generators/stm32/rules/classic/FrameworkTemplates.xml

+17-1
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,22 @@
211211
</PropertyGroups>
212212
</ConfigurableProperties>
213213
</Framework>
214-
214+
<Framework>
215+
<Name>STM32 USB Power Delivery Support</Name>
216+
<ID>com.sysprogs.arm.stm32.usbpd.$$STM32:FAMILY_EX$$</ID>
217+
<ClassID>com.sysprogs.arm.stm32.usbpd</ClassID>
218+
<ProjectFolderName>USB Power Delivery</ProjectFolderName>
219+
<DefaultEnabled>false</DefaultEnabled>
220+
<RequiredFrameworks>
221+
<string>com.sysprogs.arm.stm32.hal</string>
222+
</RequiredFrameworks>
223+
<CopyJobs>
224+
<CopyJob>
225+
<SourceFolder>$$STM32:FAMILY_DIR$$\Middlewares\ST\STM32_USBPD_Library</SourceFolder>
226+
<FilesToCopy>*</FilesToCopy>
227+
<ProjectInclusionMask>-*template.c;-*template.h;*.c;*.h</ProjectInclusionMask>
228+
</CopyJob>
229+
</CopyJobs>
230+
</Framework>
215231
</AdditionalFrameworks>
216232
</FamilyDefinition>

0 commit comments

Comments
 (0)