2 Commits

Author SHA1 Message Date
William Henderson 1bf9e1779f V1.0.3 2025-07-23 22:17:21 +01:00
William Henderson e2d99380ae VS 2025-07-23 12:14:39 +01:00
16 changed files with 63 additions and 15 deletions
Binary file not shown.
@@ -5,6 +5,10 @@
{ {
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\william\\Documents\\Git\\RP2040_UPS_Loader\\rp2040_Loader.py||{8B382828-6202-11D1-8870-0000F87579D2}", "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\william\\Documents\\Git\\RP2040_UPS_Loader\\rp2040_Loader.py||{8B382828-6202-11D1-8870-0000F87579D2}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:rp2040_Loader.py||{8B382828-6202-11D1-8870-0000F87579D2}" "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:rp2040_Loader.py||{8B382828-6202-11D1-8870-0000F87579D2}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\william\\Documents\\Git\\RP2040_UPS_Loader\\Resources\\RP2040\\main.py||{8B382828-6202-11D1-8870-0000F87579D2}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:Resources\\RP2040\\main.py||{8B382828-6202-11D1-8870-0000F87579D2}"
} }
], ],
"DocumentGroupContainers": [ "DocumentGroupContainers": [
@@ -28,10 +32,22 @@
"RelativeDocumentMoniker": "rp2040_Loader.py", "RelativeDocumentMoniker": "rp2040_Loader.py",
"ToolTip": "C:\\Users\\william\\Documents\\Git\\RP2040_UPS_Loader\\rp2040_Loader.py", "ToolTip": "C:\\Users\\william\\Documents\\Git\\RP2040_UPS_Loader\\rp2040_Loader.py",
"RelativeToolTip": "rp2040_Loader.py", "RelativeToolTip": "rp2040_Loader.py",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAA8AAABNAAAAAAAAAA==", "ViewState": "AgIAAAAAAAAAAAAAAAAAAG4AAAA8AAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.002457|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.002457|",
"WhenOpened": "2025-07-10T14:11:57.024Z", "WhenOpened": "2025-07-10T14:11:57.024Z",
"EditorCaption": "" "EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "main.py",
"DocumentMoniker": "C:\\Users\\william\\Documents\\Git\\RP2040_UPS_Loader\\Resources\\RP2040\\main.py",
"RelativeDocumentMoniker": "Resources\\RP2040\\main.py",
"ToolTip": "C:\\Users\\william\\Documents\\Git\\RP2040_UPS_Loader\\Resources\\RP2040\\main.py",
"RelativeToolTip": "Resources\\RP2040\\main.py",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.002457|",
"WhenOpened": "2025-07-23T11:07:29.706Z"
} }
] ]
} }
+17 -1
View File
@@ -5,6 +5,10 @@
{ {
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\william\\Documents\\Git\\RP2040_UPS_Loader\\rp2040_Loader.py||{8B382828-6202-11D1-8870-0000F87579D2}", "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\william\\Documents\\Git\\RP2040_UPS_Loader\\rp2040_Loader.py||{8B382828-6202-11D1-8870-0000F87579D2}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:rp2040_Loader.py||{8B382828-6202-11D1-8870-0000F87579D2}" "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:rp2040_Loader.py||{8B382828-6202-11D1-8870-0000F87579D2}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\william\\Documents\\Git\\RP2040_UPS_Loader\\Resources\\RP2040\\main.py||{8B382828-6202-11D1-8870-0000F87579D2}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:Resources\\RP2040\\main.py||{8B382828-6202-11D1-8870-0000F87579D2}"
} }
], ],
"DocumentGroupContainers": [ "DocumentGroupContainers": [
@@ -28,10 +32,22 @@
"RelativeDocumentMoniker": "rp2040_Loader.py", "RelativeDocumentMoniker": "rp2040_Loader.py",
"ToolTip": "C:\\Users\\william\\Documents\\Git\\RP2040_UPS_Loader\\rp2040_Loader.py", "ToolTip": "C:\\Users\\william\\Documents\\Git\\RP2040_UPS_Loader\\rp2040_Loader.py",
"RelativeToolTip": "rp2040_Loader.py", "RelativeToolTip": "rp2040_Loader.py",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAA8AAABNAAAAAAAAAA==", "ViewState": "AgIAAAAAAAAAAAAAAAAAAHoAAAAkAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.002457|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.002457|",
"WhenOpened": "2025-07-10T14:11:57.024Z", "WhenOpened": "2025-07-10T14:11:57.024Z",
"EditorCaption": "" "EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "main.py",
"DocumentMoniker": "C:\\Users\\william\\Documents\\Git\\RP2040_UPS_Loader\\Resources\\RP2040\\main.py",
"RelativeDocumentMoniker": "Resources\\RP2040\\main.py",
"ToolTip": "C:\\Users\\william\\Documents\\Git\\RP2040_UPS_Loader\\Resources\\RP2040\\main.py",
"RelativeToolTip": "Resources\\RP2040\\main.py",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.002457|",
"WhenOpened": "2025-07-23T11:07:29.706Z"
} }
] ]
} }
+3 -1
View File
@@ -1,6 +1,8 @@
{ {
"ExpandedNodes": [ "ExpandedNodes": [
"" "",
"\\Resources",
"\\Resources\\RP2040"
], ],
"SelectedNode": "\\rp2040_Loader.py", "SelectedNode": "\\rp2040_Loader.py",
"PreviewInSolutionExplorer": false "PreviewInSolutionExplorer": false
BIN
View File
Binary file not shown.
+8
View File
@@ -17,3 +17,11 @@ RP2040 Loader V1.0.1 - 23/07/2025
Improvements: Improvements:
- Integrated `mpremote` into the application package to support mp file uploads without requiring external installation - Integrated `mpremote` into the application package to support mp file uploads without requiring external installation
RP2040 Loader V1.0.2 - 23/07/2025
Improvements:
- Added logging to see which files get uploaded or skipped (if unchanged)
Bug Fixes:
- Fixed `mpremote`
Binary file not shown.
+17 -11
View File
@@ -5,6 +5,9 @@ import tkinter as tk
from tkinter import ttk from tkinter import ttk
from tkinter import filedialog, messagebox from tkinter import filedialog, messagebox
import serial.tools.list_ports import serial.tools.list_ports
import sys
from mpremote.main import main as mpremote_main
class RP2040UploaderApp: class RP2040UploaderApp:
@@ -13,7 +16,6 @@ class RP2040UploaderApp:
self.folder_path = os.path.join(os.getcwd(), "Resources/RP2040") self.folder_path = os.path.join(os.getcwd(), "Resources/RP2040")
self.config_path = os.path.join(self.folder_path, "config.json") self.config_path = os.path.join(self.folder_path, "config.json")
self.mpremote_path = os.path.join(os.getcwd(), "Resources", "mpremote.exe")
self.label = tk.Label(master, text="Searching for RP2040...") self.label = tk.Label(master, text="Searching for RP2040...")
@@ -94,27 +96,31 @@ class RP2040UploaderApp:
if os.path.isfile(full_path): if os.path.isfile(full_path):
self.label.config(text=f"Uploading {filename}...") self.label.config(text=f"Uploading {filename}...")
self.master.update() self.master.update()
result = subprocess.run(
[self.mpremote_path, "connect", self.port, "fs", "cp", full_path, f":{filename}"],
capture_output=True,
text=True
)
if result.returncode != 0: # Save original sys.argv and replace it with mpremote-style args
original_argv = sys.argv
sys.argv = ["mpremote", "connect", self.port, "fs", "cp", full_path, f":{filename}"]
try:
mpremote_main()
except SystemExit as e:
success = False success = False
messagebox.showerror("Upload Failed", f"Failed to upload {filename}:\n{result.stderr}") messagebox.showerror("Upload Failed", f"Failed to upload {filename} (mpremote exited with code {e.code}).")
break break
finally:
sys.argv = original_argv # Always restore original argv
if success: if success:
self.label.config(text=f"DONE") self.label.config(text="DONE")
self.master.update() self.master.update()
messagebox.showinfo("Success", "All files uploaded successfully!") messagebox.showinfo("Success", "All files uploaded successfully!")
if __name__ == "__main__": if __name__ == "__main__":
root = tk.Tk() root = tk.Tk()
app = RP2040UploaderApp(root) app = RP2040UploaderApp(root)
root.title("RP2040 Loader V1.0.1") root.title("RP2040 Loader V1.0.2")
root.iconbitmap(r'Resources/icon1.ico') root.iconbitmap(r'Resources/icon1.ico')
@@ -129,7 +135,7 @@ if __name__ == "__main__":
# Footer label in bottom right # Footer label in bottom right
footer_frame = tk.Frame(root) footer_frame = tk.Frame(root)
footer_frame.pack(side=tk.BOTTOM, fill=tk.X) footer_frame.pack(side=tk.BOTTOM, fill=tk.X)
footer_label = tk.Label(footer_frame, text="Made by Hendo 22/07/2025", anchor="e", justify="right", font=("TkDefaultFont", 7, "bold")) footer_label = tk.Label(footer_frame, text="Made by Hendo 23/07/2025", anchor="e", justify="right", font=("TkDefaultFont", 7, "bold"))
footer_label.pack(side=tk.RIGHT, padx=10, pady=5) footer_label.pack(side=tk.RIGHT, padx=10, pady=5)
root.mainloop() root.mainloop()