Giter VIP home page Giter VIP logo

Comments (12)

themadinventor avatar themadinventor commented on September 15, 2024

I can't say I have seen this error before but I'll look into it. There's some changes in the pipeline that I'll try to publish soon :)

from esptool.

0ff avatar 0ff commented on September 15, 2024

Exactly the same thing also happens for me. The update always runs smoothly, but I get this error.
Maybe this is related to the fact that I'm using an esp8266EX instead of the non-EX variant?

from esptool.

zarya avatar zarya commented on September 15, 2024

0ff i am able to upload the wi07c.rom to a EX without issues but the stuff coming from the compiler in the vm i am not able to upload

from esptool.

0ff avatar 0ff commented on September 15, 2024

Oh, you have to write both the .output/eagle/debug/image/eagle.app.v6.flash.bin (dest=0x0) AND the .output/eagle/debug/image/eagle.app.v6.irom0text.bin (dest=0x40000) to the module, then it works fine :)
You might need to reboot the module between the two files.

from esptool.

zarya avatar zarya commented on September 15, 2024

check

from esptool.

zarya avatar zarya commented on September 15, 2024

oke i can indeed confirm that it work

from esptool.

i7sid avatar i7sid commented on September 15, 2024

I can confirm this issue.
Just recently installed the SDK using this tutorial: https://github.com/esp8266/esp8266-wiki/wiki

Within the Makefile the code is as follows:

flash: firmware/0x00000.bin firmware/0x40000.bin
        -$(ESPTOOL) --port $(ESPPORT) write_flash 0x00000 firmware/0x00000.bin
        sleep 3
        -$(ESPTOOL) --port $(ESPPORT) write_flash 0x40000 firmware/0x40000.bin

make flash has the following output (always, not from time to time):

/home/sid/esp8266/esptool/esptool.py --port /dev/ttyUSB0 write_flash 0x00000 firmware/0x00000.bin
Connecting...
Erasing flash...

Writing at 0x00000000... (0 %) 
Writing at 0x00000400... (3 %) 
[...]
Writing at 0x00007800... (93 %) 
Writing at 0x00007c00... (96 %) 
Leaving...
Traceback (most recent call last):
  File "/home/sid/esp8266/esptool/esptool.py", line 351, in <module>
    esp.flash_finish(False)
  File "/home/sid/esp8266/esptool/esptool.py", line 188, in flash_finish
    raise Exception('Failed to leave Flash mode')
Exception: Failed to leave Flash mode
make: [flash] Error 1 (ignored)
sleep 3
/home/sid/esp8266/esptool/esptool.py --port /dev/ttyUSB0 write_flash 0x40000 firmware/0x40000.bin
Traceback (most recent call last):
Connecting...
  File "/home/sid/esp8266/esptool/esptool.py", line 299, in <module>
    esp.connect()
  File "/home/sid/esp8266/esptool/esptool.py", line 136, in connect
    raise Exception('Failed to connect')
Exception: Failed to connect
make: [flash] Error 1 (ignored)

It does not seem to leave the flash mode correctly. From that point on, I can not upload code anymore until the next power circle (or reset I suppose).

However, there is a trick: If I manage to do a power circle within the 3 second sleep then the program uploads fine (although the errors appear) and the program works.

Any ideas how I can circumvent this hack?

Note that, I also got the EX version of the chip. And I also tried to upload the original firmware, resulting in the same issue.

from esptool.

sej7278 avatar sej7278 commented on September 15, 2024

i have this exact same problem on a v1 (00160901) board, it was running ok accepting AT commands until i used esptool.py, now it seems stuck in flash mode as it won't accept AT commands and returns gibberish and then "ready" on boot.

power cycling makes no difference and the only way to get to the 2nd flash is to power cycle in the sleep(3) bit, but it still doesn't actually complete:

$ esptool.py --port /dev/ttyUSB0 write_flash 0x00000 firmware/0x00000.bin
Connecting...
Erasing flash...
Writing at 0x00008400... (97 %) 
Leaving...
Traceback (most recent call last):
  File "esptool.py", line 351, in <module>
    esp.flash_finish(False)
  File "esptool.py", line 188, in flash_finish
    raise Exception('Failed to leave Flash mode')
Exception: Failed to leave Flash mode
Makefile:139: recipe for target 'flash' failed
make: [flash] Error 1 (ignored)
sleep 3
esptool.py --port /dev/ttyUSB0 write_flash 0x40000 firmware/0x40000.bin
Connecting...
Erasing flash...
Writing at 0x00063c00... (99 %) 
Leaving...
Traceback (most recent call last):
  File "esptool.py", line 351, in <module>
    esp.flash_finish(False)
  File "esptool.py", line 188, in flash_finish
    raise Exception('Failed to leave Flash mode')
Exception: Failed to leave Flash mode
Makefile:139: recipe for target 'flash' failed
make: [flash] Error 1 (ignored)

from esptool.

3s1d avatar 3s1d commented on September 15, 2024

Hi,
I forked the project and extended it so that you do not need to power cycle manually. No more reset and bootloader buttons are required. U only need two more wires.
Check it out: https://github.com/3s1d/esp_prog

Juergen

from esptool.

JoanPeturPetersen avatar JoanPeturPetersen commented on September 15, 2024

I experienced the same problem.

Erasing flash...
Writing at 0x00008400... (97 %)
Leaving...
Traceback (most recent call last):
  File "esptool.py", line 353, in <module>
    esp.flash_finish(False)
  File "esptool.py", line 190, in flash_finish
    raise Exception('Failed to leave Flash mode')
Exception: Failed to leave Flash mode

Put a print statement in the code, and the command(ESPROM.ESP_FLASH_END, ...) method returned:

(538052359, '\x01\x06')

from esptool.

pfalcon avatar pfalcon commented on September 15, 2024

#5 fixes this properly (based on several independent reports of '\x01\x06' being returned).

from esptool.

themadinventor avatar themadinventor commented on September 15, 2024

merged #5

from esptool.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.