Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0359342777 | |||
| 1bf9e1779f | |||
| e2d99380ae |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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}",
|
||||
"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,26 @@
|
||||
"RelativeDocumentMoniker": "rp2040_Loader.py",
|
||||
"ToolTip": "C:\\Users\\william\\Documents\\Git\\RP2040_UPS_Loader\\rp2040_Loader.py",
|
||||
"RelativeToolTip": "rp2040_Loader.py",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAA8AAABNAAAAAAAAAA==",
|
||||
"ViewState": "AgIAAFQAAAAAAAAAAAAAAIIAAAASAAAAAAAAAA==",
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"$type": "Bookmark",
|
||||
"Name": "ST:0:0:{cce594b6-0c39-4442-ba28-10c64ac7e89f}"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -2,9 +2,17 @@
|
||||
"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\\Releases\\CHANGE LOG.txt||{8B382828-6202-11D1-8870-0000F87579D2}",
|
||||
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:Releases\\CHANGE LOG.txt||{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": [
|
||||
@@ -23,15 +31,41 @@
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 0,
|
||||
"Title": "CHANGE LOG.txt",
|
||||
"DocumentMoniker": "C:\\Users\\william\\Documents\\Git\\RP2040_UPS_Loader\\Releases\\CHANGE LOG.txt",
|
||||
"RelativeDocumentMoniker": "Releases\\CHANGE LOG.txt",
|
||||
"ToolTip": "C:\\Users\\william\\Documents\\Git\\RP2040_UPS_Loader\\Releases\\CHANGE LOG.txt",
|
||||
"RelativeToolTip": "Releases\\CHANGE LOG.txt",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAACEAAAAAAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003109|",
|
||||
"WhenOpened": "2025-10-06T12:33:48.161Z",
|
||||
"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": "AgIAAAAAAAAAAAAAAAAAAA8AAABNAAAAAAAAAA==",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAIIAAAASAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.002457|",
|
||||
"WhenOpened": "2025-07-10T14:11:57.024Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 2,
|
||||
"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": "AgIAAGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.002457|",
|
||||
"WhenOpened": "2025-07-23T11:07:29.706Z",
|
||||
"EditorCaption": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{
|
||||
"ExpandedNodes": [
|
||||
""
|
||||
"",
|
||||
"\\Resources",
|
||||
"\\Resources\\RP2040"
|
||||
],
|
||||
"SelectedNode": "\\rp2040_Loader.py",
|
||||
"PreviewInSolutionExplorer": false
|
||||
|
||||
Binary file not shown.
+15
-1
@@ -16,4 +16,18 @@ 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
|
||||
- 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`
|
||||
|
||||
RP Loader V1.1.2 - 06/10/2025
|
||||
|
||||
Improvements:
|
||||
- Added support for the RP2350-ETH (Pico 2 platform)
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
+38
-24
@@ -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,17 +16,15 @@ 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...")
|
||||
self.label = tk.Label(master, text="Searching for board...")
|
||||
self.label.pack(pady=10)
|
||||
|
||||
self.port = self.find_rp2040_port()
|
||||
self.port, self.board_name = self.find_supported_port()
|
||||
if self.port:
|
||||
self.label.config(text=f"RP2040 detected on {self.port}")
|
||||
self.label.config(text=f"{self.board_name} detected on {self.port}")
|
||||
else:
|
||||
self.label.config(text="RP2040 not found.")
|
||||
self.label.config(text="No supported board found.")
|
||||
|
||||
# Config entry fields
|
||||
self.ip_entry = self.create_labeled_entry("IP Address:")
|
||||
@@ -32,7 +33,13 @@ class RP2040UploaderApp:
|
||||
|
||||
self.load_config()
|
||||
|
||||
self.upload_button = ttk.Button(master, text="Upload Files", style="Accent.TButton", command=self.upload_files, state=tk.NORMAL if self.port else tk.DISABLED)
|
||||
self.upload_button = ttk.Button(
|
||||
master,
|
||||
text="Upload Files",
|
||||
style="Accent.TButton",
|
||||
command=self.upload_files,
|
||||
state=tk.NORMAL if self.port else tk.DISABLED
|
||||
)
|
||||
self.upload_button.pack(pady=10)
|
||||
|
||||
def create_labeled_entry(self, label_text):
|
||||
@@ -44,17 +51,20 @@ class RP2040UploaderApp:
|
||||
entry.pack(side=tk.RIGHT)
|
||||
return entry
|
||||
|
||||
def find_rp2040_port(self):
|
||||
target_vid = 0x239A
|
||||
target_pid = 0x80F2
|
||||
def find_supported_port(self):
|
||||
# List of supported boards (VID, PID, Name)
|
||||
supported_boards = [
|
||||
(0x239A, 0x80F2, "RP2040"),
|
||||
(0x2E8A, 0x0009, "RP2350"),
|
||||
]
|
||||
|
||||
ports = serial.tools.list_ports.comports()
|
||||
for port in ports:
|
||||
if port.vid == target_vid and port.pid == target_pid:
|
||||
return port.device
|
||||
|
||||
return None
|
||||
for vid, pid, name in supported_boards:
|
||||
if port.vid == vid and port.pid == pid:
|
||||
return port.device, name
|
||||
|
||||
return None, None
|
||||
|
||||
def load_config(self):
|
||||
if os.path.isfile(self.config_path):
|
||||
@@ -94,27 +104,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("RP Loader V1.1.0")
|
||||
|
||||
root.iconbitmap(r'Resources/icon1.ico')
|
||||
|
||||
@@ -129,7 +143,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 06/10/2025", anchor="e", justify="right", font=("TkDefaultFont", 7, "bold"))
|
||||
footer_label.pack(side=tk.RIGHT, padx=10, pady=5)
|
||||
|
||||
root.mainloop()
|
||||
|
||||
Reference in New Issue
Block a user