diff --git a/.vs/STM32 Flash Loader/project-colors.json b/.vs/STM32 Flash Loader/project-colors.json
new file mode 100644
index 0000000..f62ba4f
--- /dev/null
+++ b/.vs/STM32 Flash Loader/project-colors.json
@@ -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
+}
\ No newline at end of file
diff --git a/STBootLib/STBoot.cs b/STBootLib/STBoot.cs
index 5618136..e358a9e 100644
--- a/STBootLib/STBoot.cs
+++ b/STBootLib/STBoot.cs
@@ -83,6 +83,8 @@ public async Task Initialize()
/* get product id */
await GetID();
+
+
}
/* unprotect memory */
@@ -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 */
diff --git a/STBootLib/STBootLib.csproj b/STBootLib/STBootLib.csproj
index 0ed7706..760ea88 100644
--- a/STBootLib/STBootLib.csproj
+++ b/STBootLib/STBootLib.csproj
@@ -9,8 +9,9 @@
Properties
STBootLib
STBootLib
- v4.5
+ v4.8
512
+
true
diff --git a/STBootLibver1.2.rar b/STBootLibver1.2.rar
new file mode 100644
index 0000000..8a6e44c
Binary files /dev/null and b/STBootLibver1.2.rar differ
diff --git a/STM32 Flash Loader.sln b/STM32 Flash Loader.sln
index cecbd18..bc8c42d 100644
--- a/STM32 Flash Loader.sln
+++ b/STM32 Flash Loader.sln
@@ -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
@@ -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
@@ -25,4 +25,7 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {D97571A4-3B65-4B5B-8A41-15F2194B0516}
+ EndGlobalSection
EndGlobal
diff --git a/STM32 Flash Loader/App.config b/STM32 Flash Loader/App.config
index 8e15646..4bfa005 100644
--- a/STM32 Flash Loader/App.config
+++ b/STM32 Flash Loader/App.config
@@ -1,6 +1,6 @@
-
+
-
+
-
\ No newline at end of file
+
diff --git a/STM32 Flash Loader/MainForm.Designer.cs b/STM32 Flash Loader/MainForm.Designer.cs
index 0eaaa3e..6f17232 100644
--- a/STM32 Flash Loader/MainForm.Designer.cs
+++ b/STM32 Flash Loader/MainForm.Designer.cs
@@ -36,17 +36,18 @@ private void InitializeComponent()
this.cbPorts = new System.Windows.Forms.ComboBox();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.tsslStatus = new System.Windows.Forms.ToolStripStatusLabel();
+ this.tsslPID = new System.Windows.Forms.ToolStripStatusLabel();
this.groupBox3 = new System.Windows.Forms.GroupBox();
- this.bJump = new System.Windows.Forms.Button();
this.lProgress = new System.Windows.Forms.Label();
this.bWrite = new System.Windows.Forms.Button();
this.pbProgress = new System.Windows.Forms.ProgressBar();
+ this.bJump = new System.Windows.Forms.Button();
this.ofdOpen = new System.Windows.Forms.OpenFileDialog();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.cbPSize = new System.Windows.Forms.ComboBox();
this.label5 = new System.Windows.Forms.Label();
this.cbxErase = new System.Windows.Forms.CheckBox();
- this.tbAddress = new System.Windows.Forms.TextBox();
+ this.tbAddress = new System.Windows.Forms.ComboBox();
this.label4 = new System.Windows.Forms.Label();
this.ttToolTip = new System.Windows.Forms.ToolTip(this.components);
this.bOpenFile = new System.Windows.Forms.Button();
@@ -109,7 +110,7 @@ private void InitializeComponent()
this.cbBauds.Size = new System.Drawing.Size(88, 21);
this.cbBauds.TabIndex = 1;
this.ttToolTip.SetToolTip(this.cbBauds, "Baudrate used for communication");
- this.cbBauds.SelectedIndexChanged += new System.EventHandler(this.cbBauds_SelectedIndexChanged);
+ this.cbBauds.SelectedIndexChanged += new System.EventHandler(this.tbAddress_TextChanged);
//
// cbPorts
//
@@ -127,12 +128,14 @@ private void InitializeComponent()
// statusStrip1
//
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.tsslStatus});
- this.statusStrip1.Location = new System.Drawing.Point(0, 310);
+ this.tsslStatus,
+ this.tsslPID});
+ this.statusStrip1.Location = new System.Drawing.Point(0, 362);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Size = new System.Drawing.Size(315, 22);
this.statusStrip1.TabIndex = 2;
this.statusStrip1.Text = "statusStrip1";
+ this.statusStrip1.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.statusStrip1_ItemClicked);
//
// tsslStatus
//
@@ -140,31 +143,24 @@ private void InitializeComponent()
this.tsslStatus.Size = new System.Drawing.Size(16, 17);
this.tsslStatus.Text = " ";
//
+ // tsslPID
+ //
+ this.tsslPID.Name = "tsslPID";
+ this.tsslPID.Size = new System.Drawing.Size(16, 17);
+ this.tsslPID.Text = " ";
+ //
// groupBox3
//
- this.groupBox3.Controls.Add(this.bJump);
this.groupBox3.Controls.Add(this.lProgress);
this.groupBox3.Controls.Add(this.bWrite);
this.groupBox3.Controls.Add(this.pbProgress);
this.groupBox3.Location = new System.Drawing.Point(12, 224);
this.groupBox3.Name = "groupBox3";
- this.groupBox3.Size = new System.Drawing.Size(293, 80);
+ this.groupBox3.Size = new System.Drawing.Size(293, 133);
this.groupBox3.TabIndex = 3;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Actions";
//
- // bJump
- //
- this.bJump.Enabled = false;
- this.bJump.Location = new System.Drawing.Point(149, 48);
- this.bJump.Name = "bJump";
- this.bJump.Size = new System.Drawing.Size(133, 23);
- this.bJump.TabIndex = 3;
- this.bJump.Text = "Jump";
- this.ttToolTip.SetToolTip(this.bJump, "Uploads the firmware and jumps to it.");
- this.bJump.UseVisualStyleBackColor = true;
- this.bJump.Click += new System.EventHandler(this.bJump_Click);
- //
// lProgress
//
this.lProgress.AutoSize = true;
@@ -179,7 +175,7 @@ private void InitializeComponent()
this.bWrite.Enabled = false;
this.bWrite.Location = new System.Drawing.Point(9, 48);
this.bWrite.Name = "bWrite";
- this.bWrite.Size = new System.Drawing.Size(133, 23);
+ this.bWrite.Size = new System.Drawing.Size(242, 59);
this.bWrite.TabIndex = 0;
this.bWrite.Text = "Write Firmware && Jump";
this.ttToolTip.SetToolTip(this.bWrite, "Uploads the firmware and jumps to it.");
@@ -193,8 +189,21 @@ private void InitializeComponent()
this.pbProgress.Size = new System.Drawing.Size(242, 23);
this.pbProgress.TabIndex = 0;
//
+ // bJump
+ //
+ this.bJump.Enabled = false;
+ this.bJump.Location = new System.Drawing.Point(194, 53);
+ this.bJump.Name = "bJump";
+ this.bJump.Size = new System.Drawing.Size(84, 21);
+ this.bJump.TabIndex = 3;
+ this.bJump.Text = "EXIT BOOT";
+ this.ttToolTip.SetToolTip(this.bJump, "Uploads the firmware and jumps to it.");
+ this.bJump.UseVisualStyleBackColor = true;
+ this.bJump.Click += new System.EventHandler(this.bJump_Click);
+ //
// groupBox4
//
+ this.groupBox4.Controls.Add(this.bJump);
this.groupBox4.Controls.Add(this.cbPSize);
this.groupBox4.Controls.Add(this.label5);
this.groupBox4.Controls.Add(this.cbxErase);
@@ -213,6 +222,7 @@ private void InitializeComponent()
this.cbPSize.Items.AddRange(new object[] {
"256",
"128",
+ "512",
"2048"});
this.cbPSize.Location = new System.Drawing.Point(66, 53);
this.cbPSize.Name = "cbPSize";
@@ -234,6 +244,8 @@ private void InitializeComponent()
// cbxErase
//
this.cbxErase.AutoSize = true;
+ this.cbxErase.Checked = true;
+ this.cbxErase.CheckState = System.Windows.Forms.CheckState.Checked;
this.cbxErase.Location = new System.Drawing.Point(194, 22);
this.cbxErase.Name = "cbxErase";
this.cbxErase.Size = new System.Drawing.Size(86, 17);
@@ -245,11 +257,16 @@ private void InitializeComponent()
//
// tbAddress
//
+ this.tbAddress.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.tbAddress.FormattingEnabled = true;
+ this.tbAddress.Items.AddRange(new object[] {
+ "0x08000000",
+ "0x08008000"});
this.tbAddress.Location = new System.Drawing.Point(66, 20);
this.tbAddress.Name = "tbAddress";
- this.tbAddress.Size = new System.Drawing.Size(112, 20);
- this.tbAddress.TabIndex = 0;
- this.tbAddress.Text = "0x08000000";
+ this.tbAddress.Size = new System.Drawing.Size(112, 21);
+ this.tbAddress.TabIndex = 1;
+ this.ttToolTip.SetToolTip(this.tbAddress, "tbAddress used for communication");
this.tbAddress.Leave += new System.EventHandler(this.tbAddress_Leave);
//
// label4
@@ -309,7 +326,7 @@ private void InitializeComponent()
this.AcceptButton = this.bWrite;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(315, 332);
+ this.ClientSize = new System.Drawing.Size(315, 384);
this.Controls.Add(this.groupBox4);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.statusStrip1);
@@ -319,7 +336,7 @@ private void InitializeComponent()
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.Name = "fMainForm";
- this.Text = "STM32 Flash Loader";
+ this.Text = "Flash bootoader TVN";
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.statusStrip1.ResumeLayout(false);
@@ -351,7 +368,8 @@ private void InitializeComponent()
private System.Windows.Forms.ComboBox cbBauds;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.CheckBox cbxErase;
- private System.Windows.Forms.TextBox tbAddress;
+ private System.Windows.Forms.ComboBox tbAddress;
+ //private System.Windows.Forms.TextBox tbAddress;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.ToolTip ttToolTip;
private System.Windows.Forms.Label label1;
@@ -361,7 +379,7 @@ private void InitializeComponent()
private System.Windows.Forms.Button bJump;
private System.Windows.Forms.ComboBox cbPSize;
private System.Windows.Forms.Label label5;
-
+ private System.Windows.Forms.ToolStripStatusLabel tsslPID;
}
}
diff --git a/STM32 Flash Loader/MainForm.cs b/STM32 Flash Loader/MainForm.cs
index 8539872..29e73f8 100644
--- a/STM32 Flash Loader/MainForm.cs
+++ b/STM32 Flash Loader/MainForm.cs
@@ -40,6 +40,7 @@ public fMainForm()
/* set default baurate selection */
cbBauds.SelectedIndex = 6;
cbPSize.SelectedIndex = 0;
+ tbAddress.SelectedIndex = 0;
/* set defaul address */
address = baseAddress;
}
@@ -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);
@@ -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);
@@ -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)
{
@@ -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)
+ {
+
+ }
}
}
diff --git a/STM32 Flash Loader/Properties/Resources.Designer.cs b/STM32 Flash Loader/Properties/Resources.Designer.cs
index f3af9cf..366729a 100644
--- a/STM32 Flash Loader/Properties/Resources.Designer.cs
+++ b/STM32 Flash Loader/Properties/Resources.Designer.cs
@@ -1,17 +1,17 @@
//------------------------------------------------------------------------------
//
// This code was generated by a tool.
-// Runtime Version:4.0.30319.34209
+// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
//------------------------------------------------------------------------------
-namespace STM32_Flash_Loader.Properties
-{
-
-
+namespace STM32_Flash_Loader.Properties {
+ using System;
+
+
///
/// A strongly-typed resource class, for looking up localized strings, etc.
///
@@ -19,50 +19,43 @@ namespace STM32_Flash_Loader.Properties
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Resources
- {
-
+ internal class Resources {
+
private static global::System.Resources.ResourceManager resourceMan;
-
+
private static global::System.Globalization.CultureInfo resourceCulture;
-
+
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Resources()
- {
+ internal Resources() {
}
-
+
///
/// Returns the cached ResourceManager instance used by this class.
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager
- {
- get
- {
- if ((resourceMan == null)) {
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("STM32_Flash_Loader.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
-
+
///
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture
- {
- get
- {
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
return resourceCulture;
}
- set
- {
+ set {
resourceCulture = value;
}
}
diff --git a/STM32 Flash Loader/Properties/Settings.Designer.cs b/STM32 Flash Loader/Properties/Settings.Designer.cs
index b89fc34..a18821d 100644
--- a/STM32 Flash Loader/Properties/Settings.Designer.cs
+++ b/STM32 Flash Loader/Properties/Settings.Designer.cs
@@ -1,28 +1,24 @@
//------------------------------------------------------------------------------
//
// This code was generated by a tool.
-// Runtime Version:4.0.30319.34209
+// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
//------------------------------------------------------------------------------
-namespace STM32_Flash_Loader.Properties
-{
-
-
+namespace STM32_Flash_Loader.Properties {
+
+
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
- {
-
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.1.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
- public static Settings Default
- {
- get
- {
+
+ public static Settings Default {
+ get {
return defaultInstance;
}
}
diff --git a/STM32 Flash Loader/STM32 Flash Loader.csproj b/STM32 Flash Loader/STM32 Flash Loader.csproj
index 3e040dd..d5151b2 100644
--- a/STM32 Flash Loader/STM32 Flash Loader.csproj
+++ b/STM32 Flash Loader/STM32 Flash Loader.csproj
@@ -9,8 +9,24 @@
Properties
STM32_Flash_Loader
STM32 Flash Loader
- v4.5
+ v4.8
512
+
+ publish\
+ true
+ Disk
+ false
+ Foreground
+ 7
+ Days
+ false
+ false
+ true
+ 0
+ 1.0.0.%2a
+ false
+ false
+ true
AnyCPU
@@ -66,6 +82,7 @@
True
Resources.resx
+ True
SettingsSingleFileGenerator
@@ -89,6 +106,18 @@
STBootLib
+
+
+ False
+ Microsoft .NET Framework 4.8 %28x86 and x64%29
+ true
+
+
+ False
+ .NET Framework 3.5 SP1
+ false
+
+