@@ -634,6 +634,7 @@ def on_finished(self, status, action_type, job_id) -> None:
634
634
# If the reset is finished, re-enable the UX
635
635
if action_type == AUxEsptoolResetESP32 .ACTION_ID :
636
636
self .writeMessage ("Reset complete..." )
637
+ self .writeMessage ("DONE: Firmware file copied to ESP32 device.\n " )
637
638
self .disable_interface (False )
638
639
639
640
if action_type == AUxRp2UploadRp2 .ACTION_ID :
@@ -851,7 +852,7 @@ def on_discover_btn_pressed(self) -> None:
851
852
return
852
853
853
854
mpr = self .get_mpremote_session ()
854
- if mpr . is_connected () :
855
+ if mpr is not None :
855
856
try :
856
857
boardName = mpr .get_short_board_name ()
857
858
if boardName is None :
@@ -1059,7 +1060,14 @@ def get_mpremote_session(self) -> MPRemoteSession:
1059
1060
else :
1060
1061
portName = self .port_button .text ()
1061
1062
1062
- return MPRemoteSession (portName )
1063
+ mpr = MPRemoteSession (portName )
1064
+
1065
+ if mpr .validate_session ():
1066
+ self .writeMessage ("MPRemote session validated.\n " )
1067
+ return mpr
1068
+ else :
1069
+ self .writeMessage ("MPRemote session failed to validate.\n " )
1070
+ return None
1063
1071
1064
1072
def do_upload_rp2 (self , fwFile = None ) -> None :
1065
1073
"""Upload the firmware to the RP2."""
@@ -1074,7 +1082,7 @@ def do_upload_rp2(self, fwFile = None) -> None:
1074
1082
1075
1083
# If we are able to use mpremote to enter bootloader mode, do so
1076
1084
# Otherwise, prompt the user to press the correct button sequence to enter bootloader mode
1077
- if mpr . is_connected () :
1085
+ if mpr is not None :
1078
1086
self .writeMessage ("Able to automatically enter bootloader mode...\n " )
1079
1087
mpr .enter_bootloader ()
1080
1088
self .writeMessage ("Entering bootloader mode...\n " )
0 commit comments