@@ -468,6 +468,7 @@ def on_upload_btn_pressed(self) -> None:
468468 command .extend (["--chip" ,"esp32" ])
469469 command .extend (["--port" ,self .port ])
470470 command .extend (["--baud" ,self .baudRate ])
471+ command .extend (["--before" ,"default_reset" ,"--after" ,"no_reset" ])
471472 command .extend (["flash_id" ])
472473
473474 # Create a job and add it to the job queue. The worker thread will pick this up and
@@ -489,6 +490,7 @@ def do_upload(self) -> None:
489490 portAvailable = True
490491 if (portAvailable == False ):
491492 self .writeMessage ("Port No Longer Available" )
493+ self .disable_interface (False )
492494 return
493495
494496 fileExists = False
@@ -500,6 +502,7 @@ def do_upload(self) -> None:
500502 finally :
501503 if (fileExists == False ):
502504 self .writeMessage ("File Not Found" )
505+ self .disable_interface (False )
503506 return
504507 f .close ()
505508
@@ -540,16 +543,19 @@ def do_upload(self) -> None:
540543 if firmwareSizeCorrect == False :
541544 reply = QMessageBox .warning (self , "Firmware size mismatch" , "Do you want to continue?" , QMessageBox .Yes | QMessageBox .No , QMessageBox .No )
542545 if reply == QMessageBox .No :
546+ self .disable_interface (False )
543547 return
544548
549+ sleep (1.0 );
545550 self .writeMessage ("Uploading firmware\n " )
546551
547552 command = []
548553 #command.extend(["--trace"]) # Useful for debugging
549554 command .extend (["--chip" ,"esp32" ])
550555 command .extend (["--port" ,self .port ])
551556 command .extend (["--baud" ,self .baudRate ])
552- command .extend (["--before" ,"default_reset" ,"--after" ,"hard_reset" ,"write_flash" ,"-z" ,"--flash_mode" ,"dio" ,"--flash_freq" ,"80m" ,"--flash_size" ,"detect" ])
557+ #command.extend(["--before","default_reset","--after","hard_reset","write_flash","-z","--flash_mode","dio","--flash_freq","80m","--flash_size","detect"])
558+ command .extend (["--before" ,"default_reset" ,"--after" ,"no_reset" ,"write_flash" ,"-z" ,"--flash_mode" ,"dio" ,"--flash_freq" ,"80m" ,"--flash_size" ,"detect" ])
553559 command .extend (["0x1000" ,resource_path ("RTK_Surveyor.ino.bootloader.bin" )])
554560 command .extend (["0x8000" ,thePartitionFileName ])
555561 command .extend (["0xe000" ,resource_path ("boot_app0.bin" )])
@@ -566,7 +572,7 @@ def do_upload(self) -> None:
566572 # Send the job to the worker to process
567573 self ._worker .add_job (theJob )
568574
569- self .disable_interface (True )
575+ self .disable_interface (True ) # Redundant... Interface is still disabled from flash detect
570576
571577 def do_restart (self ) -> None :
572578 """Tell the ESP32 to restart"""
@@ -576,21 +582,23 @@ def do_restart(self) -> None:
576582 portAvailable = True
577583 if (portAvailable == False ):
578584 self .writeMessage ("Port No Longer Available" )
585+ self .disable_interface (False )
579586 return
580587
581588 try :
582589 self ._save_settings () # Save the settings in case the command fails
583590 except :
584591 pass
585592
593+ sleep (1.0 );
586594 self .writeMessage ("Restarting ESP32\n " )
587595
588596 # ---- The esptool method -----
589597
590598 command = []
591599 command .extend (["--chip" ,"esp32" ])
592600 command .extend (["--port" ,self .port ])
593- command .extend (["--before" ,"no_reset " ,"run" ])
601+ command .extend (["--before" ,"default_reset " ,"run" ])
594602
595603 # Create a job and add it to the job queue. The worker thread will pick this up and
596604 # process the job. Can set job values using dictionary syntax, or attribute assignments
@@ -601,7 +609,7 @@ def do_restart(self) -> None:
601609 # Send the job to the worker to process
602610 self ._worker .add_job (theJob )
603611
604- self .disable_interface (True )
612+ self .disable_interface (True ) # Redundant... Interface is still disabled from flash detect
605613
606614def startUploaderGUI ():
607615 """Start the GUI"""
0 commit comments