Esp32-s upload problem

Hello
I am working on firmware using Ai-thinker esp32-s.
I am testing the upload with only very simple code.
At this point, the following error occurs:

Processing esp32cam (platform: espressif32; board: esp32cam; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32cam.html
PLATFORM: Espressif 32 (3.5.0) > AI Thinker ESP32-CAM
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (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.10006.210326 (1.0.6)
 - tool-esptoolpy 1.30100.210531 (3.1.0)
 - tool-mkspiffs 2.230.0 (2.30)
 - tool-openocd-esp32 2.1000.20210721 (10.0)
 - toolchain-xtensa32 2.50200.97 (5.2.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 29 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <ESP32 AnalogWrite> 0.2.0
Building in release mode
Retrieving maximum program size .pio\build\esp32cam\firmware.elf
Checking size .pio\build\esp32cam\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   4.3% (used 14076 bytes from 327680 bytes)
Flash: [=         ]   8.9% (used 278846 bytes from 3145728 bytes)
Configuring upload protocol...
AVAILABLE: 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...
Use manually specified: COM3
Uploading .pio\build\esp32cam\firmware.bin
esptool.py v3.1
Serial port COM3
Connecting........_____....._____....._____....._____....._____
Chip is ESP32-D0WD (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 8c:ce:4e:9a:33:98
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Warning: Could not auto-detect Flash size (FlashID=0x0, SizeID=0x0), defaulting to 4MB
Flash will be erased from 0x00001000 to 0x00005fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x00054fff...
Compressed 17104 bytes to 11191...
Writing at 0x00001000... (100 %)

A fatal error occurred: Timed out waiting for packet header
*** [upload] Error 2
========================================================================================================================== [FAILED] Took 28.94 seconds ==========================================================================================================================The terminal process "C:\Users\ilk48\.platformio\penv\Scripts\platformio.exe 'run', '--target', 'upload'" terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

commonly
It starts with Writing at 0x00001000… (07 %).
I got the first message
It is displayed as 100% like Writing at 0x00001000… (100 %).
And Time out is displayed.
I can’t predict what kind of problem there is.

I think it’s a problem with PlatformIO.
If anyone knows what the problem is, please help.