@@ -527,7 +527,7 @@ def __run(self, file_path=None, baudrate=921600, port=None, resume=False, load_f
527527 time .sleep (.5 )
528528 self .__serial .read (100 )
529529 print ('Going into MIRROR mode... please close this terminal to resume the upgrade via UART' )
530- self .uart_mirror (rgbled )
530+ return self .uart_mirror (rgbled )
531531
532532 elif bootrom :
533533 if verbose : print ('Starting STP' )
@@ -570,10 +570,10 @@ def __run(self, file_path=None, baudrate=921600, port=None, resume=False, load_f
570570 time .sleep (.5 )
571571 self .__serial .read (100 )
572572 print ('Going into MIRROR mode... please close this terminal to resume the upgrade via UART' )
573- self .uart_mirror (rgbled )
573+ return self .uart_mirror (rgbled )
574574 else :
575575 self .__serial .write (b"AT+STP\n " )
576- response = self .read_rsp (size = 6 )
576+ response = self .read_rsp (size = 2 )
577577 if not b'OK' in response :
578578 print ('Failed to start STP mode!' )
579579 reconnect_uart ()
@@ -584,7 +584,7 @@ def __run(self, file_path=None, baudrate=921600, port=None, resume=False, load_f
584584 else :
585585 if debug : print ('Starting STP mode...' )
586586 self .__serial .write (b"AT+STP\n " )
587- response = self .read_rsp (size = 6 )
587+ response = self .read_rsp (size = 2 )
588588 if not b'OK' in response :
589589 print ('Failed to start STP mode!' )
590590 reconnect_uart ()
@@ -871,6 +871,7 @@ def uart_mirror(self, color):
871871 time .sleep (.5 )
872872 pycom .rgbled (color )
873873 LTE .modem_upgrade_mode ()
874+ return True
874875
875876 def success_message (self , port = None , verbose = False , debug = False ):
876877 print ("Your modem has been successfully updated." )
0 commit comments