idf.py flash fails after flashing 93%

jmadsenee
Posts: 30
Joined: Tue Apr 19, 2022 1:16 am

idf.py flash fails after flashing 93%

Postby jmadsenee » Sat Dec 10, 2022 8:00 pm

I have been using the ESP32-S3 Korvo board for months with no problem. I have re-flashed it many times. All of a sudden the flashing fails:

Code: Select all

...
Writing at 0x00076c00... (92 %)
Writing at 0x00077000... (92 %)
Writing at 0x00077400... (92 %)
Writing at 0x00077800... (93 %)
Writing at 0x00077c00... (93 %)
Traceback (most recent call last):
  File "C:\Users\John\esp\esp-idf\components\esptool_py\esptool\esptool.py", line 458, in command
    self.write(pkt)
  File "C:\Users\John\esp\esp-idf\components\esptool_py\esptool\esptool.py", line 421, in write
    self._port.write(buf)
  File "C:\Users\John\esp\Espressif\python_env\idf4.4_py3.10_env\lib\site-packages\serial\serialwin32.py", line 325, in write
    raise SerialTimeoutException('Write timeout')
serial.serialutil.SerialTimeoutException: Write timeout

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\John\esp\esp-idf\components\esptool_py\esptool\esptool.py", line 5347, in <module>
    _main()
  File "C:\Users\John\esp\esp-idf\components\esptool_py\esptool\esptool.py", line 5340, in _main
    main()
  File "C:\Users\John\esp\esp-idf\components\esptool_py\esptool\esptool.py", line 4772, in main
    operation_func(esp, args)
  File "C:\Users\John\esp\esp-idf\components\esptool_py\esptool\esptool.py", line 3978, in write_flash
    esp.flash_block(block, seq)
  File "C:\Users\John\esp\esp-idf\components\esptool_py\esptool\esptool.py", line 801, in flash_block
    self.check_command("write to target Flash after seq %d" % seq,
  File "C:\Users\John\esp\esp-idf\components\esptool_py\esptool\esptool.py", line 495, in check_command
    val, data = self.command(op, data, chk, timeout=timeout)
  File "C:\Users\John\esp\esp-idf\components\esptool_py\esptool\esptool.py", line 484, in command
    self._port.timeout = saved_timeout
  File "C:\Users\John\esp\Espressif\python_env\idf4.4_py3.10_env\lib\site-packages\serial\serialutil.py", line 372, in timeout
    self._reconfigure_port()
  File "C:\Users\John\esp\Espressif\python_env\idf4.4_py3.10_env\lib\site-packages\serial\serialwin32.py", line 222, in _reconfigure_port
    raise SerialException(
serial.serialutil.SerialException: Cannot configure port, something went wrong. Original message: OSError(22, 'A device which does not exist was specified.', None, 433)
CMake Error at run_serial_tool.cmake:56 (message):
  python C:/Users/John/esp/esp-idf/components/esptool_py/esptool/esptool.py
  --chip esp32s3 failed


FAILED: CMakeFiles/flash 
cmd.exe /C "cd /D C:\Users\John\esp\esp-idf\components\esptool_py && C:\Users\John\esp\Espressif\tools\cmake\3.20.3\bin\cmake.exe -D IDF_PATH="C:/Users/John/esp/esp-idf" -D SERIAL_TOOL="python C:/Users/John/esp/esp-idf/components/esptool_py/esptool/esptool.py --chip esp32s3" -D SERIAL_TOOL_ARGS="--before=default_reset --after=hard_reset --no-stub write_flash @flash_args" -D WORKING_DIRECTORY="C:/Users/John/eclipse-workspace2/FortisKap/build" -P C:/Users/John/esp/esp-idf/components/esptool_py/run_serial_tool.cmake"
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
Executing action: flash
Running ninja in directory c:\users\john\eclipse-workspace2\fortiskap\build
Executing "ninja flash"...
I have not made any changes to the hardware between my last successful flash and the failure. Has my module died? Is htere anything else to look at?

Thanks for any help!

ESP_Sprite
Posts: 9766
Joined: Thu Nov 26, 2015 4:08 am

Re: idf.py flash fails after flashing 93%

Postby ESP_Sprite » Sun Dec 11, 2022 1:48 am

Could be a known bug in an older version of esptool.py. Can you try to manually make the ESP32 go into download mode by holding the boot button, pressing reset and releasing the boot button? If you try to program after, it should succeed.

jmadsenee
Posts: 30
Joined: Tue Apr 19, 2022 1:16 am

Re: idf.py flash fails after flashing 93%

Postby jmadsenee » Tue Dec 13, 2022 5:00 am

That seems to have fixed it!

Thanks so much!

ashesman
Posts: 20
Joined: Sun Jun 02, 2019 9:25 pm

Re: idf.py flash fails after flashing 93%

Postby ashesman » Mon Jan 09, 2023 9:50 pm

I also had this exact same issue. Was flashing fine for ages, then suddenly wouldn't flash. Except I could not get past 20-30% flashing. The ESP32-C3 was stuck in this state and could not be flashed.

Holding IO9 low solved the problem.

Now it is back to normal and can be flashed like usual.

My original post for this issue is https://esp32.com/viewtopic.php?f=13&t= ... 08#p107308

I would be interested to know more about this issue as I am worried about this problem happening in production programming!

ESP_Sprite
Posts: 9766
Joined: Thu Nov 26, 2015 4:08 am

Re: idf.py flash fails after flashing 93%

Postby ESP_Sprite » Tue Jan 10, 2023 12:58 am

Let me get back to you on that, I'll talk to the esptool team, see if I can find out if/when we released an esptool.py that fixes this issue.

Who is online

Users browsing this forum: No registered users and 79 guests