Error when uploading code to ESP32 WROOM

I'm trying to upload some code to a ESP32 WROOM but I keep getting this error

Sketch uses 506870 bytes (38%) of program storage space. Maximum is 1310720 bytes.
Global variables use 28160 bytes (8%) of dynamic memory, leaving 299520 bytes for local variables. Maximum is 327680 bytes.
esptool v5.3.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': PermissionError(13, 'Access is denied.', None, 5))

Hint: Check if the port is not used by another task

Failed uploading: uploading error: exit status 2

How it goes if you reboot your computer and try again?

the problem persists

Are you sure com5 is your arduino? If you disconnect usb-cable, com 5 disappears?

  1. If you have the serial monitor open, close it.
  2. If you have active system monitoring (security software), disable it.

Common issue with Windows, just search the forum.

im positive com5 is my board

i disabled real time protection and the issue persisted

Which O.S.? Also, see Post #4.

windows, and yes com5 is my esp32

Does Device Manager show ESP32 as you attach the USB?

Windows 10? 11?

Device manager shows it as "USB-SERIAL CH340"

Windows 11

Well. I am at the end of what I would do (have done).

Your OS sees the port. The driver identifies the device... if only the OS would allow the IDE to use the resource.

Reboot the IDE.
Reboot the O.S.

And have you downloaded the appropiate library to cope with this device?

Does ESP32 with a CH340 need a driver other than the driver used for a knick-off Nano with a CH340?

yes, i believe i have the correct driver considering it was working fine before

If the driver that was installed and worked was not "certified" by Windows, the "working" driver would have been removed by Windows on the next Windows update, leaving the non-working driver there now... and selecting "best driver" is not the right choice, rather "let me find my driver" will allow you to chose that "old-old" driver that once worked.

Windows does not keep COM port numbers static. My computer has ONE USB COM port that is changed among COM3, COM4, COM5 and I think COM6. I don't know why, but I do find myself, daily, selecting the current COM number in the IDE.

In forty years of fixing other people's stuff, "was working" and "nothing has changed" really means "I did something special that I have forgotten, but shouldn't be considered as special, and I've done other things since, but I feel none of the changes should cause a difference."

Do you still get these ACCESS errors? Security software blocking the COM ports is also suspect. If you could find a non-secure computer to get a basic installation of IDE and driver to work, that would be nice to verify you have the right stuff.

Find the right driver. Make Windows use the driver you find. Verify the IDE has the COM port IN BOLD LETTERS.

If you could get a screen-shot of the IDE >> TOOLS dropdown menu, that might show something.

Hi @maxeem.

Please do a close visual examination of the USB chip on your board and comment here to tell us whether it has labeling. This will be a rectangular black chip near the USB socket on the board.

The labeled chip would look something like this:

šŸ“·

SparkFun - CC BY-SA 4.0 (cropped)

(note there is writing on the top surface of the chip)

Alternatively, your chip might not have labeling, like this:

šŸ“·

NodeMCU Lua Lol1n V3.jpg by Popolon - CC BY-SA 4.0 (cropped)

(note the top surface of the chip in the picture is just black, without any writing)

There "probably" is "writing" but not with ink or embossing, rather by LASER.

Use a "raking" light or flash photo to read the top surface at an oblique angle.

I don't think so. Unfortunately I haven't managed to get my hands on one of these chips, but I've seen dozens of pictures of these chips and none of them have any sign whatsoever of marking.

Here are a few decent quality pictures:

https://github.com/SHWotever/FakeCH340DriverFixer#how-to-recognise-a-fake-ch340g-chip-