Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .vs/STM32 Flash Loader/project-colors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"Version": 1,
"ProjectMap": {
"f2a80228-9234-4748-a61b-f26d3c1ec7fa": {
"ProjectGuid": "f2a80228-9234-4748-a61b-f26d3c1ec7fa",
"DisplayName": "STM32 Flash Loader",
"ColorIndex": 0
},
"8ec66a52-5978-481d-a80d-d75cbc6de918": {
"ProjectGuid": "8ec66a52-5978-481d-a80d-d75cbc6de918",
"DisplayName": "STBootLib",
"ColorIndex": 1
}
},
"NextColorIndex": 2
}
3 changes: 3 additions & 0 deletions STBootLib/STBoot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ public async Task Initialize()

/* get product id */
await GetID();


}

/* unprotect memory */
Expand Down Expand Up @@ -349,6 +351,7 @@ private async Task GetID()
rx = new byte[nbytes];
/* receive response */
await SerialRead(rx, 0, rx.Length);

/* oops, something baaad happened! */
} catch (Exception) {
/* release semaphore */
Expand Down
3 changes: 2 additions & 1 deletion STBootLib/STBootLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>STBootLib</RootNamespace>
<AssemblyName>STBootLib</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down
Binary file added STBootLibver1.2.rar
Binary file not shown.
17 changes: 10 additions & 7 deletions STM32 Flash Loader.sln
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 2013 for Windows Desktop
VisualStudioVersion = 12.0.21005.1
# Visual Studio Version 17
VisualStudioVersion = 17.1.32319.34
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "STM32 Flash Loader", "STM32 Flash Loader\STM32 Flash Loader.csproj", "{975D7D83-56AE-4A64-865E-BCD9096B05C7}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "STM32 Flash Loader", "STM32 Flash Loader\STM32 Flash Loader.csproj", "{F2A80228-9234-4748-A61B-F26D3C1EC7FA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "STBootLib", "STBootLib\STBootLib.csproj", "{8EC66A52-5978-481D-A80D-D75CBC6DE918}"
EndProject
Expand All @@ -13,10 +13,10 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{975D7D83-56AE-4A64-865E-BCD9096B05C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{975D7D83-56AE-4A64-865E-BCD9096B05C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{975D7D83-56AE-4A64-865E-BCD9096B05C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{975D7D83-56AE-4A64-865E-BCD9096B05C7}.Release|Any CPU.Build.0 = Release|Any CPU
{F2A80228-9234-4748-A61B-F26D3C1EC7FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F2A80228-9234-4748-A61B-F26D3C1EC7FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F2A80228-9234-4748-A61B-F26D3C1EC7FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F2A80228-9234-4748-A61B-F26D3C1EC7FA}.Release|Any CPU.Build.0 = Release|Any CPU
{8EC66A52-5978-481D-A80D-D75CBC6DE918}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8EC66A52-5978-481D-A80D-D75CBC6DE918}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8EC66A52-5978-481D-A80D-D75CBC6DE918}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -25,4 +25,7 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D97571A4-3B65-4B5B-8A41-15F2194B0516}
EndGlobalSection
EndGlobal
6 changes: 3 additions & 3 deletions STM32 Flash Loader/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
</configuration>
</configuration>
72 changes: 45 additions & 27 deletions STM32 Flash Loader/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 29 additions & 5 deletions STM32 Flash Loader/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public fMainForm()
/* set default baurate selection */
cbBauds.SelectedIndex = 6;
cbPSize.SelectedIndex = 0;
tbAddress.SelectedIndex = 0;
/* set defaul address */
address = baseAddress;
}
Expand Down Expand Up @@ -202,8 +203,8 @@ private async Task UploadFile(string portName, uint baudRate,
/* initialize communication */
await uc.Initialize();
/* update the status */
UpdateStatus(false, string.Format("Connected: Ver: {0}, PID: 0x{1:X4}",
uc.Version, uc.ProductID));
//UpdateStatus2(false, string.Format("Ver: {0}, PID: 0x{1:X4}", uc.Version, uc.ProductID));
UpdateStatus2(false, string.Format("Connected: Ver: {0}, PID: 0x{1:X4}", uc.Version, uc.ProductID));
/* give some chance see the message */
await Task.Delay(500);

Expand Down Expand Up @@ -231,9 +232,9 @@ private async Task UploadFile(string portName, uint baudRate,
await uc.WriteMemory(address, bin, 0, bin.Length, p,
CancellationToken.None);
/* update the status */
UpdateStatus(false, string.Format("Success: {0} bytes written",
UpdateStatus(false, string.Format("Success:{0} bytes",
bin.Length));

// UpdateStatus2(false, string.Format("Ver: {0}, PID: 0x{1:X4}", uc.Version, uc.ProductID));
/* go! */
await uc.Jump(jumpAddress);

Expand Down Expand Up @@ -285,7 +286,17 @@ private void UpdateStatus(bool ding, string text)
SystemSounds.Exclamation.Play();
}
}

private void UpdateStatus2(bool ding, string text)
{
/* text */
tsslPID.Text = text;
/* play a system sound? */
if (ding)
{
/* ^^ ding! */
SystemSounds.Exclamation.Play();
}
}
private void cbxErase_CheckedChanged(object sender, EventArgs e)
{

Expand All @@ -296,6 +307,19 @@ private void cbPSize_SelectedIndexChanged(object sender, EventArgs e)

}

private void tbAddress_TextChanged(object sender, EventArgs e)
{

}

private void statusStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{

}

private void textBox1_TextChanged(object sender, EventArgs e)
{

}
}
}
Loading