ESP 32 Fatal Error

I'm Having a fatal error when uploading my code to the ESP32.
Sketch uses 893410 bytes (68%) of program storage space. Maximum is 1310720 bytes.
Global variables use 45060 bytes (13%) of dynamic memory, leaving 282620 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.8.1
Serial port COM5

A fatal error occurred: Could not open COM5, the port is busy or doesn't exist.
(could not open port 'COM5': OSError(22, 'The semaphore timeout period has expired.', None, 121))

Failed uploading: uploading error: exit status 2

This is my error code.
I don't understand what to do.

Is your ESP32 on COM5? You can check in device manager:


If your ESP32 is COM5, then when it's plugged into your PC's USB port you should see COM5 in the list, and when you unplug it, it should disappear from the list.
If it is showing up correctly in device manager then check that the serial monitor / plotter are not open. IIRC some versions of the IDE give that error when the serial monitor is open and an upload is attempted.
If that doesn't fix it then check nothing else is using COM5. It's unlikely, but if e.g. you have some other code running that's opened COM5, that would also cause the problem.

What OS? It is much more likely that this is due to the native OS messing up, but we have nothing to work on. Maybe provide the normal data.

Some ESP32 based board (which one exactly) or the Arduino Nano ESP32?

I have checked the Ports and it doesn't show up as any COM.


It shows up in Other Devices with an error. Has this ever happened to you? I don't exactly know what to do to fix this issue.

I guess you don't have the driver installed for CP2102, but that's only a guess.