Skip to content

Commit a35ad6b

Browse files
committed
before default_reset , after no_reset
1 parent f208398 commit a35ad6b

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

RTK_Firmware_Uploader/RTK_Firmware_Uploader.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

606614
def startUploaderGUI():
607615
"""Start the GUI"""

RTK_Firmware_Uploader/au_act_esptool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def run_job(self, job:AxJob):
4848
class AUxEsptoolResetESP32(AxAction):
4949

5050
ACTION_ID = "esptool-reset-esp32"
51-
NAME = "ESP32 Reset"
51+
NAME = "ESP32 Restart"
5252

5353
def __init__(self) -> None:
5454
super().__init__(self.ACTION_ID, self.NAME)

images/RTK_Uploader_Windows_1.png

0 Bytes
Loading

images/RTK_Uploader_Windows_2.png

0 Bytes
Loading

0 commit comments

Comments
 (0)