esp32tool 1.6.0 → 1.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -135,7 +135,7 @@ December 2025 – Now with full LittleFS, SPIFFS, and FATFS support, plus file a
135
135
 
136
136
  January 2026 – Added Android mobile devices support, standalone CLI.
137
137
 
138
- February 2026 - Added IMPROV support, NEW Feature: Flash Hex Editor.
138
+ February 2026 - Added IMPROV support, NEW Features: Flash Hex Editor and NVS Parser / Editor
139
139
 
140
140
  ---
141
141
 
Binary file
@@ -841,56 +841,44 @@ export class ESPLoader extends EventTarget {
841
841
  * Classic reset with shorter delays for WebUSB (Android)
842
842
  */
843
843
  async hardResetClassicShortDelayWebUSB() {
844
- await this.setDTRWebUSB(false); // IO0=HIGH
845
- await this.setRTSWebUSB(true); // EN=LOW, chip in reset
846
- await sleep(50);
847
- await this.setDTRWebUSB(true); // IO0=LOW
848
- await this.setRTSWebUSB(false); // EN=HIGH, chip out of reset
849
- await sleep(25);
850
- await this.setDTRWebUSB(false); // IO0=HIGH, done
851
- await sleep(100);
844
+ await this.runSignalSequence([
845
+ { dtr: false, rts: true, delayMs: 50 },
846
+ { dtr: true, rts: false, delayMs: 25 },
847
+ { dtr: false, delayMs: 100 },
848
+ ]);
852
849
  }
853
850
  /**
854
851
  * @name hardResetInvertedWebUSB
855
852
  * Inverted reset sequence for WebUSB (Android) - both signals inverted
856
853
  */
857
854
  async hardResetInvertedWebUSB() {
858
- await this.setDTRWebUSB(true); // IO0=HIGH (inverted)
859
- await this.setRTSWebUSB(false); // EN=LOW, chip in reset (inverted)
860
- await sleep(100);
861
- await this.setDTRWebUSB(false); // IO0=LOW (inverted)
862
- await this.setRTSWebUSB(true); // EN=HIGH, chip out of reset (inverted)
863
- await sleep(50);
864
- await this.setDTRWebUSB(true); // IO0=HIGH, done (inverted)
865
- await sleep(200);
855
+ await this.runSignalSequence([
856
+ { dtr: true, rts: false, delayMs: 100 },
857
+ { dtr: false, rts: true, delayMs: 50 },
858
+ { dtr: true, delayMs: 200 },
859
+ ]);
866
860
  }
867
861
  /**
868
862
  * @name hardResetInvertedDTRWebUSB
869
863
  * Only DTR inverted for WebUSB (Android)
870
864
  */
871
865
  async hardResetInvertedDTRWebUSB() {
872
- await this.setDTRWebUSB(true); // IO0=HIGH (DTR inverted)
873
- await this.setRTSWebUSB(true); // EN=LOW, chip in reset (RTS normal)
874
- await sleep(100);
875
- await this.setDTRWebUSB(false); // IO0=LOW (DTR inverted)
876
- await this.setRTSWebUSB(false); // EN=HIGH, chip out of reset (RTS normal)
877
- await sleep(50);
878
- await this.setDTRWebUSB(true); // IO0=HIGH, done (DTR inverted)
879
- await sleep(200);
866
+ await this.runSignalSequence([
867
+ { dtr: true, rts: true, delayMs: 100 },
868
+ { dtr: false, rts: false, delayMs: 50 },
869
+ { dtr: true, delayMs: 200 },
870
+ ]);
880
871
  }
881
872
  /**
882
873
  * @name hardResetInvertedRTSWebUSB
883
874
  * Only RTS inverted for WebUSB (Android)
884
875
  */
885
876
  async hardResetInvertedRTSWebUSB() {
886
- await this.setDTRWebUSB(false); // IO0=HIGH (DTR normal)
887
- await this.setRTSWebUSB(false); // EN=LOW, chip in reset (RTS inverted)
888
- await sleep(100);
889
- await this.setDTRWebUSB(true); // IO0=LOW (DTR normal)
890
- await this.setRTSWebUSB(true); // EN=HIGH, chip out of reset (RTS inverted)
891
- await sleep(50);
892
- await this.setDTRWebUSB(false); // IO0=HIGH, done (DTR normal)
893
- await sleep(200);
877
+ await this.runSignalSequence([
878
+ { dtr: false, rts: false, delayMs: 100 },
879
+ { dtr: true, rts: true, delayMs: 50 },
880
+ { dtr: false, delayMs: 200 },
881
+ ]);
894
882
  }
895
883
  /**
896
884
  * Check if we're using WebUSB (Android) or Web Serial (Desktop)
@@ -3595,7 +3583,7 @@ export class ESPLoader extends EventTarget {
3595
3583
  }
3596
3584
  catch (err) {
3597
3585
  if (err instanceof SlipReadError) {
3598
- this.logger.debug(`SLIP read error at ${resp.length} bytes: ${err.message}`);
3586
+ this.logger.debug(`${err.message} at byte 0x${resp.length.toString(16)}`);
3599
3587
  // Send empty SLIP frame to abort the stub's read operation
3600
3588
  // The stub expects 4 bytes (ACK), if we send less it will break out
3601
3589
  try {
@@ -3705,18 +3693,8 @@ export class ESPLoader extends EventTarget {
3705
3693
  // Check if it's a timeout error or SLIP error
3706
3694
  if (err instanceof SlipReadError) {
3707
3695
  if (retryCount <= MAX_RETRIES) {
3708
- this.logger.debug(`${err.message} at 0x${currentAddr.toString(16)}. Draining buffer and retrying (attempt ${retryCount}/${MAX_RETRIES})...`);
3709
- try {
3710
- await this.drainInputBuffer(200);
3711
- // Clear application buffer
3712
- await this.flushSerialBuffers();
3713
- // Wait before retry to let hardware settle
3714
- await sleep(SYNC_TIMEOUT);
3715
- // Continue to retry the same chunk (will send NEW read command)
3716
- }
3717
- catch (drainErr) {
3718
- this.logger.debug(`Buffer drain error: ${drainErr}`);
3719
- }
3696
+ this.logger.debug(`Cleared buffer and retrying (attempt ${retryCount}/${MAX_RETRIES})...`);
3697
+ // Continue to retry the same chunk (will send NEW read command)
3720
3698
  }
3721
3699
  else {
3722
3700
  // All retries exhausted - attempt recovery by reloading stub