I had the same problem. When I tried to program using VSCode + PlatformIO, it didn't accept programming, it gave me a flash size error, I got another prototyping board with the same processor and programmed it. I went back to the board, tried to reset the flash, but without success. After many attempts, I managed to program, then after some programming the defect returned, I tried to do the same procedure and I can't program anymore. The cable is fine because I have serial communication with the PC. I've already updated the driver and it didn't work.
LOG:
Processing nodemcu-esp32 (platform: espressif32; board: esp32dev; framework: arduino)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION:
https://docs.platformio.org/page/boards/...32dev.html
PLATFORM: Espressif 32 (2024.9.30) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-arduinoespressif32 @ 3.1.0+sha.22a3b096
- tool-esptoolpy @ 4.8.0
- tool-mkfatfs @ 2.0.1
- tool-mklittlefs @ 3.2.0
- tool-riscv32-esp-elf-gdb @ 11.2.0+20220823
- tool-xtensa-esp-elf-gdb @ 11.2.0+20230208
- toolchain-xtensa-esp-elf @ 13.2.0+20240530
LDF: Library Dependency Finder ->
https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 29 compatible libraries
Scanning dependencies...
Dependency Graph
|-- ArduinoOTA @ 3.1.0
|-- WiFi @ 3.1.0
Building in release mode
Retrieving maximum program size .pio\build\nodemcu-esp32\firmware.elf
Checking size .pio\build\nodemcu-esp32\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [= ] 13.6% (used 44420 bytes from 327680 bytes)
Flash: [===== ] 47.8% (used 626068 bytes from 1310720 bytes)
Configuring upload protocol...
AVAILABLE: cmsis-dap, esp-bridge, esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
CURRENT: upload_protocol = esptool
Looking for upload port...
Auto-detected: COM5
Uploading .pio\build\nodemcu-esp32\firmware.bin
esptool.py v4.8.0
Serial port COM5
Connecting....
Chip is ESP32-D0WD-V3 (revision v3.1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
Traceback (most recent call last):
MAC: 14:33:5c:45:9d:70
File "C:\Users\Carlos\.platformio\packages\tool-esptoolpy@src-55e1438d6344232122195269b383659a\esptool.py", line 37, in <module>
Uploading stub...
esptool._main()
Running stub...
File "C:\Users\Carlos\.platformio\packages\tool-esptoolpy@src-55e1438d6344232122195269b383659a\esptool\__init__.py", line 1314, in _main
Stub running...
main()
WARNING: Failed to communicate with the flash chip, read/write operations will fail. Try checking the chip connections or removing any other hardware connected to IOs.
Configuring flash size...
File "C:\Users\Carlos\.platformio\packages\tool-esptoolpy@src-55e1438d6344232122195269b383659a\esptool\__init__.py", line 1036, in main
WARNING: Could not auto-detect Flash size (FlashID=0x0, SizeID=0x0), defaulting to 4MB
operation_func(esp, args)
File "C:\Users\Carlos\.platformio\packages\tool-esptoolpy@src-55e1438d6344232122195269b383659a\esptool\cmds.py", line 491, in write_flash
if set_flash_size and set_flash_size > flash_end:
^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '>' not supported between instances of 'int' and 'NoneType'
*** [upload] Error 1
======================================================================================= [FAILED] Took 7.03 seconds =======================================================================================
Environment Status Duration
------------- -------- ------------
nodemcu-esp32 FAILED 00:00:07.031
================================================================================== 1 failed, 0 succeeded in 00:00:07.031 ==================================================================================