0

i have simple circuit for controlling the dc motor by bjt BC869 like this:

pro and this code:

/*
  ESP8266 Blink by Simon Peter
  Blink the blue LED on the ESP-01 module
  This example code is in the public domain

  The blue LED on the ESP-01 module is connected to GPIO1
  (which is also the TXD pin; so we cannot use Serial.print() at the same time)

  Note that this sketch uses LED_BUILTIN to find the pin with the internal LED
*/
#define dd 1
void setup() {
  pinMode(LED_BUILTIN, OUTPUT);     // Initialize the LED_BUILTIN pin as an output
   pinMode(dd, OUTPUT);     // Initialize the LED_BUILTIN pin as an output
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, LOW);   // Turn the LED on (Note that LOW is the voltage level
  // but actually the LED is on; this is because
  // it is active low on the ESP-01)
  delay(1000);                      // Wait for a second
  digitalWrite(LED_BUILTIN, HIGH);  // Turn the LED off by making the voltage HIGH
  delay(2000);   
//  loop1() ;// Wait for two seconds (to demonstrate the active low LED)
}
void loop1() {
  digitalWrite(dd, LOW);   // Turn the LED on (Note that LOW is the voltage level
  // but actually the LED is on; this is because
  // it is active low on the ESP-01)
  delay(1000);                      // Wait for a second
  digitalWrite(dd, HIGH);  // Turn the LED off by making the voltage HIGH
  delay(2000);                      // Wait for two seconds (to demonstrate the active low LED)
}

it was working days before but it stopped from working by connecting to prototype circuit by breadboard, but after connecting to this circuit it programmed for two or three times and after that it showing this error:

Arduino

Executable segment sizes:
IROM   : 227612          - code in flash         (default or ICACHE_FLASH_ATTR) 
IRAM   : 26768   / 32768 - code in IRAM          (ICACHE_RAM_ATTR, ISRs...) 
DATA   : 1252  )         - initialized variables (global, static) in RAM/HEAP 
RODATA : 672   ) / 81920 - constants             (global, static) in RAM/HEAP 
BSS    : 24880 )         - zeroed variables      (global, static) in RAM/HEAP 
Sketch uses 256304 bytes (26%) of program storage space. Maximum is 958448 bytes.
Global variables use 26804 bytes (32%) of dynamic memory, leaving 55116 bytes for local variables. Maximum is 81920 bytes.
esptool.py v2.8
Serial port /dev/ttyUSB1
Connecting........_____....._____.
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: d8:bf:c0:ff:6f:30
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Flash params set to 0x0340
Compressed 260464 bytes to 190649...
Writing at 0x00004000... (16 %)Traceback (most recent call last):
  File "/home/so/snap/arduino/41/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/upload.py", line 65, in <module>
    esptool.main(cmdline)
  File "/home/so/snap/arduino/41/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool/esptool.py", line 2938, in main
    operation_func(esp, args)
  File "/home/so/snap/arduino/41/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool/esptool.py", line 2374, in write_flash
    esp.flash_defl_block(block, seq, timeout=DEFAULT_TIMEOUT * ratio * 2)
  File "/home/so/snap/arduino/41/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool/esptool.py", line 104, in inner
    return func(*args, **kwargs)
  File "/home/so/snap/arduino/41/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool/esptool.py", line 672, in flash_defl_block
    self.ESP_FLASH_DEFL_DATA, struct.pack('<IIII', len(data), seq, 0, 0) + data, self.checksum(data), timeout=timeout)
  File "/home/so/snap/arduino/41/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool/esptool.py", line 379, in check_command
    raise FatalError.WithResult('Failed to %s' % op_description, status_bytes)
esptool.FatalError: Failed to write compressed data to flash after seq 1 (result was C100)
esptool.FatalError: Failed to write compressed data to flash after seq 1 (result was C100)

So i have seen some suggestion like changing the USB port and dont worked for me, so i like to know why this happened and how could be solved ( by flashing the esp8266 or ...)

Update:

I have tried by the comment suggestion this code : void setup() {} void loop() {}

And get again that error:

Executable segment sizes:
IROM   : 227372          - code in flash         (default or ICACHE_FLASH_ATTR) 
IRAM   : 26360   / 32768 - code in IRAM          (ICACHE_RAM_ATTR, ISRs...) 
DATA   : 1252  )         - initialized variables (global, static) in RAM/HEAP 
RODATA : 672   ) / 81920 - constants             (global, static) in RAM/HEAP 
BSS    : 24848 )         - zeroed variables      (global, static) in RAM/HEAP 
Sketch uses 255656 bytes (24%) of program storage space. Maximum is 1044464 bytes.
Global variables use 26772 bytes (32%) of dynamic memory, leaving 55148 bytes for local variables. Maximum is 81920 bytes.
esptool.py v2.8
Serial port /dev/ttyUSB1
Connecting........_____.
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: d8:bf:c0:ff:6f:30
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 259808 bytes to 190257...
Writing at 0x00004000... (16 %)Traceback (most recent call last):
  File "/home/so/snap/arduino/41/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/upload.py", line 65, in <module>
    esptool.main(cmdline)
  File "/home/so/snap/arduino/41/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool/esptool.py", line 2938, in main
    operation_func(esp, args)
  File "/home/so/snap/arduino/41/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool/esptool.py", line 2374, in write_flash
    esp.flash_defl_block(block, seq, timeout=DEFAULT_TIMEOUT * ratio * 2)
  File "/home/so/snap/arduino/41/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool/esptool.py", line 104, in inner
    return func(*args, **kwargs)
  File "/home/so/snap/arduino/41/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool/esptool.py", line 672, in flash_defl_block
    self.ESP_FLASH_DEFL_DATA, struct.pack('<IIII', len(data), seq, 0, 0) + data, self.checksum(data), timeout=timeout)
  File "/home/so/snap/arduino/41/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool/esptool.py", line 379, in check_command
    raise FatalError.WithResult('Failed to %s' % op_description, status_bytes)
esptool.FatalError: Failed to write compressed data to flash after seq 1 (result was C100)
esptool.FatalError: Failed to write compressed data to flash after seq 1 (result was C100)


Thanks.

  • with problems like this, you should always start with minimal sketch void setup() {} void loop() {} .... the sketch is probably irrelevant and only clutters up the post .... also remove all of the external hardware – jsotola Jul 14 '20 at 17:05
  • i have done that but not solved! – Soheil Paper Jul 14 '20 at 17:54
  • Does it work when disconnecting the NodeMCU from the breadboard so that there are no externally connected components anymore? – Maximilian Gerhardt Jul 14 '20 at 21:34
  • I have had that error when the internal capacitance of the ESP32 module isn't enough by itself to run the module properly. You should add a 10uF capacitor across the 3.3V and GND pins on the module (direct on the module, not the PCB pins). – Majenko Jul 14 '20 at 22:40
  • it was working days before but it stopped from working by connecting to prototype circuit by breadboard, so ... – Soheil Paper Jul 15 '20 at 17:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.