espressif / esptool

Espressif SoC serial bootloader utility
https://docs.espressif.com/projects/esptool
GNU General Public License v2.0
5.55k stars 1.38k forks source link

[ESPTOOL4.3] Error: "\Python\lib\asyncio\windows_events.py", line 439, in select self._poll(timeout)" (ESPTOOL-520) #780

Closed GTCLive closed 2 years ago

GTCLive commented 2 years ago

Operating System

WIN10

Esptool Version

4.3

Python Version

3.10

Full Esptool Command Line that Was Run

No response

Esptool Output

Executing action: flash
Running ninja in directory d:\ides\eclipse\workspace\expressif\esp-idf_master\hello_world_c2\build
Executing "ninja flash"...
[1/5] cmd.exe /C "cd /D D:\IDEs\Eclipse\Workspace\Expressif\ESP-IDF_master\hello_world_C2\build\esp-idf\esptool_py && python D:/IDEs/Eclipse/Expressif/idf/master/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 partition --type app D:/IDEs/Eclipse/Workspace/Expressif/ESP-IDF_master/hello_world_C2/build/partition_table/partition-table.bin D:/IDEs/Eclipse/Workspace/Expressif/ESP-IDF_master/hello_world_C2/build/hello_world_C2.bin"

hello_world_C2.bin binary size 0x18f50 bytes. Smallest app partition is 0x100000 bytes. 0xe70b0 bytes (90%) free.

[2/5] Performing build step for 'bootloader'

[1/1] cmd.exe /C "cd /D D:\IDEs\Eclipse\Workspace\Expressif\ESP-IDF_master\hello_world_C2\build\bootloader\esp-idf\esptool_py && python D:/IDEs/Eclipse/Expressif/idf/master/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x0 D:/IDEs/Eclipse/Workspace/Expressif/ESP-IDF_master/hello_world_C2/build/bootloader/bootloader.bin"

Bootloader binary size 0x47a0 bytes. 0x3860 bytes (44%) free.

[2/3] cmd.exe /C "cd /D D:\IDEs\Eclipse\Expressif\idf\master\esp-idf\components\esptool_py && D:\IDEs\Eclipse\Expressif\tools\cmake\3.24.0\bin\cmake.exe -D IDF_PATH=D:/IDEs/Eclipse/Expressif/idf/master/esp-idf -D SERIAL_TOOL=python;;D:/IDEs/Eclipse/Expressif/idf/master/esp-idf/components/esptool_py/esptool/esptool.py;--chip;esp32c2 -D SERIAL_TOOL_ARGS=--before=default_reset;--after=hard_reset;write_flash;@flash_args -D WORKING_DIRECTORY=D:/IDEs/Eclipse/Workspace/Expressif/ESP-IDF_master/hello_world_C2/build -P D:/IDEs/Eclipse/Expressif/idf/master/esp-idf/components/esptool_py/run_serial_tool.cmake"

esptool esp32c2 -p COM7 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 60m --flash_size 2MB 0x0 bootloader/bootloader.bin 0x10000 hello_world_C2.bin 0x8000 partition_table/partition-table.bin

esptool.py v4.3

Serial port COM7

Connecting....

Chip is ESP32-C2 (revision v1.0)

Features: WiFi, BLE

Crystal is 40MHz

MAC: 10:97:bd:f1:c4:f8

Uploading stub...

Running stub...

Stub running...

Changing baud rate to 460800

Changed.

Configuring flash size...

Flash will be erased from 0x00000000 to 0x00004fff...

Flash will be erased from 0x00010000 to 0x00028fff...

Flash will be erased from 0x00008000 to 0x00008fff...

Compressed 18336 bytes to 11163...

Writing at 0x00000000... (100 %)

Wrote 18336 bytes (11163 compressed) at 0x00000000 in 0.6 seconds (effective 229.3 kbit/s)...

Hash of data verified.

Compressed 102224 bytes to 54702...

Writing at 0x00010000... (25 %)

Writing at 0x00019070... (50 %)

Writing at 0x0001fddc... (75 %)

Writing at 0x00026885... (100 %)

Wrote 102224 bytes (54702 compressed) at 0x00010000 in 1.8 seconds (effective 447.1 kbit/s)...

Hash of data verified.

Compressed 3072 bytes to 103...

Writing at 0x00008000... (100 %)

Wrote 3072 bytes (103 compressed) at 0x00008000 in 0.1 seconds (effective 315.2 kbit/s)...

Hash of data verified.

Leaving...

Hard resetting via RTS pin...

Traceback (most recent call last):
  File "D:\IDEs\Python\lib\asyncio\windows_events.py", line 439, in select
    self._poll(timeout)
RuntimeError: <_overlapped.Overlapped object at 0x00000206BC09B990> still has pending operation at deallocation, the process may crash
Traceback (most recent call last):
  File "D:\IDEs\Python\lib\asyncio\windows_events.py", line 439, in select
    self._poll(timeout)
RuntimeError: <_overlapped.Overlapped object at 0x00000206BC09B990> still has pending operation at deallocation, the process may crash
Done

What is the Expected Behaviour?

Flashing without error (warning in this case, as the flashing works)

More Information

Having an issue with esptool since upgrading from 4.1. Same error was present in 4.2 and recently upgraded to 4.3 and this did not rid of the issue. Therefore I'm reporting this in case anyone else has the same issue.

Note that this does not prevent flashing and neither an operational issue. Both the flash and application functions correctly. Just a nuisance really and can't figure out what cause it.

Error: "\Python\lib\asyncio\windows_events.py", line 439, in select self._poll(timeout)" Screengrab: https://i.postimg.cc/Dz8vWdVX/ESPTOOL43.jpg

Other Steps to Reproduce

No response

GTCLive commented 2 years ago

Error occurs for C2, C3 and S3 modules. Addition note: Esptool 4.1 works perfectly fine. This error does not occur. (e.g. environment: ESP-IDF 4.4.2 and Esptool 4.1)

dobairoland commented 2 years ago

Hi @GTCLive. ESP-IDF 4.4.2 is bundled with esptool==3.3.x. Esptool v4.0 is not supported there. This should be a wrongly setup environment for Eclipse. Please report the issue for the eclipse plugin. Actually, the reported backtrace is not happening from esptool. Esptool doesn't use asyncio.

dobairoland commented 2 years ago

https://github.com/espressif/idf-eclipse-plugin