diff --git a/.vs/RP2040_UPS_Loader/FileContentIndex/0ac3d3cc-dfa5-465d-8a92-c936a883a417.vsidx b/.vs/RP2040_UPS_Loader/FileContentIndex/0ac3d3cc-dfa5-465d-8a92-c936a883a417.vsidx new file mode 100644 index 0000000..87fa1cd Binary files /dev/null and b/.vs/RP2040_UPS_Loader/FileContentIndex/0ac3d3cc-dfa5-465d-8a92-c936a883a417.vsidx differ diff --git a/.vs/RP2040_UPS_Loader/FileContentIndex/1b953f1f-d3cd-4738-9bc4-944f3a8e10fa.vsidx b/.vs/RP2040_UPS_Loader/FileContentIndex/1b953f1f-d3cd-4738-9bc4-944f3a8e10fa.vsidx new file mode 100644 index 0000000..36c7d97 Binary files /dev/null and b/.vs/RP2040_UPS_Loader/FileContentIndex/1b953f1f-d3cd-4738-9bc4-944f3a8e10fa.vsidx differ diff --git a/.vs/RP2040_UPS_Loader/FileContentIndex/28c18771-0472-47cf-8262-8db38b9a4ae1.vsidx b/.vs/RP2040_UPS_Loader/FileContentIndex/28c18771-0472-47cf-8262-8db38b9a4ae1.vsidx deleted file mode 100644 index 7c59ec3..0000000 Binary files a/.vs/RP2040_UPS_Loader/FileContentIndex/28c18771-0472-47cf-8262-8db38b9a4ae1.vsidx and /dev/null differ diff --git a/.vs/RP2040_UPS_Loader/FileContentIndex/20cb81d3-a174-405f-ac53-a524feac5c0b.vsidx b/.vs/RP2040_UPS_Loader/FileContentIndex/362ecf09-7e5e-44d5-a91d-c39c95da67fc.vsidx similarity index 77% rename from .vs/RP2040_UPS_Loader/FileContentIndex/20cb81d3-a174-405f-ac53-a524feac5c0b.vsidx rename to .vs/RP2040_UPS_Loader/FileContentIndex/362ecf09-7e5e-44d5-a91d-c39c95da67fc.vsidx index 666a19a..db9df7e 100644 Binary files a/.vs/RP2040_UPS_Loader/FileContentIndex/20cb81d3-a174-405f-ac53-a524feac5c0b.vsidx and b/.vs/RP2040_UPS_Loader/FileContentIndex/362ecf09-7e5e-44d5-a91d-c39c95da67fc.vsidx differ diff --git a/.vs/RP2040_UPS_Loader/FileContentIndex/87500d22-f269-4954-a050-ad3b103d3f8e.vsidx b/.vs/RP2040_UPS_Loader/FileContentIndex/87500d22-f269-4954-a050-ad3b103d3f8e.vsidx deleted file mode 100644 index 1a79d6f..0000000 Binary files a/.vs/RP2040_UPS_Loader/FileContentIndex/87500d22-f269-4954-a050-ad3b103d3f8e.vsidx and /dev/null differ diff --git a/.vs/RP2040_UPS_Loader/FileContentIndex/c4bef1d1-dd78-4752-a9c8-7996bc80c939.vsidx b/.vs/RP2040_UPS_Loader/FileContentIndex/c4bef1d1-dd78-4752-a9c8-7996bc80c939.vsidx deleted file mode 100644 index ce22b65..0000000 Binary files a/.vs/RP2040_UPS_Loader/FileContentIndex/c4bef1d1-dd78-4752-a9c8-7996bc80c939.vsidx and /dev/null differ diff --git a/.vs/RP2040_UPS_Loader/FileContentIndex/e0378374-4432-4148-ae0a-6021ba1f270b.vsidx b/.vs/RP2040_UPS_Loader/FileContentIndex/e0378374-4432-4148-ae0a-6021ba1f270b.vsidx new file mode 100644 index 0000000..9d1c3f5 Binary files /dev/null and b/.vs/RP2040_UPS_Loader/FileContentIndex/e0378374-4432-4148-ae0a-6021ba1f270b.vsidx differ diff --git a/.vs/RP2040_UPS_Loader/v17/.wsuo b/.vs/RP2040_UPS_Loader/v17/.wsuo index 321b05c..9e9c53b 100644 Binary files a/.vs/RP2040_UPS_Loader/v17/.wsuo and b/.vs/RP2040_UPS_Loader/v17/.wsuo differ diff --git a/.vs/RP2040_UPS_Loader/v17/DocumentLayout.backup.json b/.vs/RP2040_UPS_Loader/v17/DocumentLayout.backup.json index 03566f9..c9dfbad 100644 --- a/.vs/RP2040_UPS_Loader/v17/DocumentLayout.backup.json +++ b/.vs/RP2040_UPS_Loader/v17/DocumentLayout.backup.json @@ -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}", "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": [ @@ -28,10 +32,22 @@ "RelativeDocumentMoniker": "rp2040_Loader.py", "ToolTip": "C:\\Users\\william\\Documents\\Git\\RP2040_UPS_Loader\\rp2040_Loader.py", "RelativeToolTip": "rp2040_Loader.py", - "ViewState": "AgIAAAAAAAAAAAAAAAAAAA8AAABNAAAAAAAAAA==", + "ViewState": "AgIAAAAAAAAAAAAAAAAAAG4AAAA8AAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.002457|", "WhenOpened": "2025-07-10T14:11:57.024Z", "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" } ] } diff --git a/.vs/RP2040_UPS_Loader/v17/DocumentLayout.json b/.vs/RP2040_UPS_Loader/v17/DocumentLayout.json index fab02c8..5dc5b06 100644 --- a/.vs/RP2040_UPS_Loader/v17/DocumentLayout.json +++ b/.vs/RP2040_UPS_Loader/v17/DocumentLayout.json @@ -2,13 +2,13 @@ "Version": 1, "WorkspaceRootPath": "C:\\Users\\william\\Documents\\Git\\RP2040_UPS_Loader\\", "Documents": [ - { - "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}" - }, { "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}" + }, + { + "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": [ @@ -27,28 +27,27 @@ { "$type": "Document", "DocumentIndex": 0, - "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": "AgIAAHgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.002457|", - "WhenOpened": "2025-07-23T11:07:29.706Z", - "EditorCaption": "" - }, - { - "$type": "Document", - "DocumentIndex": 1, "Title": "rp2040_Loader.py", "DocumentMoniker": "C:\\Users\\william\\Documents\\Git\\RP2040_UPS_Loader\\rp2040_Loader.py", "RelativeDocumentMoniker": "rp2040_Loader.py", "ToolTip": "C:\\Users\\william\\Documents\\Git\\RP2040_UPS_Loader\\rp2040_Loader.py", "RelativeToolTip": "rp2040_Loader.py", - "ViewState": "AgIAAAAAAAAAAAAAAAAAAC4AAAAfAAAAAAAAAA==", + "ViewState": "AgIAAAAAAAAAAAAAAAAAAHoAAAAkAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.002457|", "WhenOpened": "2025-07-10T14:11:57.024Z", "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" } ] } diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json index bad3a18..a9f04ca 100644 --- a/.vs/VSWorkspaceState.json +++ b/.vs/VSWorkspaceState.json @@ -4,6 +4,6 @@ "\\Resources", "\\Resources\\RP2040" ], - "SelectedNode": "\\Resources\\RP2040\\main.py", + "SelectedNode": "\\rp2040_Loader.py", "PreviewInSolutionExplorer": false } \ No newline at end of file diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite index 704dea4..ad72801 100644 Binary files a/.vs/slnx.sqlite and b/.vs/slnx.sqlite differ diff --git a/Releases/CHANGE LOG.txt b/Releases/CHANGE LOG.txt index f3d223d..877d491 100644 --- a/Releases/CHANGE LOG.txt +++ b/Releases/CHANGE LOG.txt @@ -16,4 +16,12 @@ RP2040 Loader V1.0.0 - 22/07/2025 RP2040 Loader V1.0.1 - 23/07/2025 Improvements: -- Integrated `mpremote` into the application package to support mp file uploads without requiring external installation \ No newline at end of file +- 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` \ No newline at end of file diff --git a/Releases/RP2040 Loader V1.0.2.zip b/Releases/RP2040 Loader V1.0.2.zip new file mode 100644 index 0000000..c17a781 Binary files /dev/null and b/Releases/RP2040 Loader V1.0.2.zip differ diff --git a/rp2040_Loader.py b/rp2040_Loader.py index 9fe61c7..afa3a0a 100644 --- a/rp2040_Loader.py +++ b/rp2040_Loader.py @@ -5,6 +5,9 @@ import tkinter as tk from tkinter import ttk from tkinter import filedialog, messagebox import serial.tools.list_ports +import sys +from mpremote.main import main as mpremote_main + class RP2040UploaderApp: @@ -13,7 +16,6 @@ class RP2040UploaderApp: self.folder_path = os.path.join(os.getcwd(), "Resources/RP2040") 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...") @@ -94,27 +96,31 @@ class RP2040UploaderApp: if os.path.isfile(full_path): self.label.config(text=f"Uploading {filename}...") 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 - 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 + finally: + sys.argv = original_argv # Always restore original argv if success: - self.label.config(text=f"DONE") + self.label.config(text="DONE") self.master.update() messagebox.showinfo("Success", "All files uploaded successfully!") + if __name__ == "__main__": root = tk.Tk() app = RP2040UploaderApp(root) - root.title("RP2040 Loader V1.0.1") + root.title("RP2040 Loader V1.0.2") root.iconbitmap(r'Resources/icon1.ico') @@ -129,7 +135,7 @@ if __name__ == "__main__": # Footer label in bottom right footer_frame = tk.Frame(root) 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) root.mainloop()