A fatal error occurred: Failed to write to target RAM

I tried 20 times today, setting up the upload speed to the lowest, changing different tools and yet I downloaded many drivers and still couldn't solve this problem, can somebody tell me help to fix this, thanks!

I moved your topic to an appropriate forum category @horus_poon.

In the future, when creating a topic please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.

This is an important part of responsible forum usage, as explained in the "How to get the best out of this forum" guide. The guide contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

Of course, thanks for reminding, I appreciate it :slight_smile: :grinning_face:

Your picture is not readable, please use copy the data and past using code tags.

Output:
Sketch uses 958170 bytes (73%) of program storage space. Maximum is 1310720 bytes.
Global variables use 33792 bytes (10%) of dynamic memory, leaving 293888 bytes for local variables. Maximum is 327680 bytes.
esptool v5.0.0
Serial port /dev/cu.usbmodem5A7C1543991:
Connecting............
A fatal error occurred: Failed to write to target RAM (result was 0107: Operation timed out)

Connected to ESP32-C3 on /dev/cu.usbmodem5A7C1543991:
Chip type: ESP32-C3 (QFN32) (revision v0.4)
Features: Wi-Fi, BT 5 (LE), Single Core, 160MHz
Crystal frequency: 40MHz
MAC: :::::

Uploading stub flasher...
Failed uploading: uploading error: exit status 2

code:

#include<WiFi.h>
const char* id="AT2-22A2";
const char* psw="KM5O0Y35PC";

void setup() {
  delay(2000);
  Serial.begin(115200);  // Start serial communication at 115200 baud
  while (!Serial);       // Wait for Serial Monitor to open (optional)
  Serial.println("ESP32-C3 Ready! Send me a message.");
}

void loop() {
  if (Serial.available()) {               // Check if data is received
    String received = Serial.readString(); // Read the incoming message
    Serial.print("Echo: ");               // Echo it back
    Serial.println(received);
  }
}

My upload speed was 115200, I enabled the USB CDC, and I still can't find why