Com port disconnects when open Arduino IDE

Even if COM7 appears with correct parameters in cmd MODE, as soon as I open Arduino IDE, the same command do not show COM7 anymore and upload gives an error (avrdude: ser_open(): can't open device "\.\COM7": Access is denied. Failed uploading: uploading error: exit status 1).
Closing IDE brings COM7 again.
Does anyone had this issue before? Thanks for any help.
Windows 11 and Arduino 2.3.2

Hi @pauloscheidegger.

Please provide a detailed description of what you mean by this. Make sure to provide enough information to allow us to reproduce the problem.

Only one process can have control over a serial port at a time. So it might be that whatever you are doing "in cmd MODE" is interfering with Arduino IDE's ability to upload to the port, and likewise Arduino IDE might be interfering with the use of the port "in cmd MODE".

Thank you for your reply, @ptillisch.

Run> cmd> mode> Enter is my short way to say I called the command line editor, typed MODE and hit Enter key.

If I turn the PC on with nothing connected to the port used by my Arduino PRO Mini (via an USB-TTL adapter) and Run cmd > mode > Enter, it shows just the CONsole device.

After connecting the adapter to the USB port and Run cmd> mode> Enter again, it shows the CON device and the COM7 device with 1200 bps setting. After adjusting to 9600 bps, COM7 still appears with the new configuration.

But after opening Arduino IDE and Run cmd> mode> Enter again, it shows only the CON device. Understandably, trying to upload any code produces the can't open COM7 device error. I must say Arduino IDE shows Arduino PRO Mini on COM7 at the lower right banner all the time.

Closing Arduino IDE and repeating Run mode command it shows both CONsole and COM7 devices normally.

Is there another info required? My PC has 3 USB ports, one has the wireless mouse dongle, another has an external HD and the third one has the Arduino. I could attach screenshots if my description is not clear enough.

Thanks for the clarification.

I can reproduce this by opening the Arduino IDE Serial Monitor. You might not notice that it is open because it is a tab in the bottom panel of the Arduino IDE window. Arduino IDE remembers whether you had Serial Monitor open the last time you had the sketch open, so when you start Arduino IDE, it will automatically open Serial Monitor.

Close Serial Monitor by clicking the X icon on the "Serial Monitor" tab in the bottom panel of the Arduino IDE window:

image

After doing that, run the mode command again. You should now see the COM7 listed, even while Serial Monitor is running.

Please tell us which USB to serial bridge chip is on the adapter you are using with the Pro Mini board. This will be the largest black chip on the adapter.

The chip will usually be identified by writing on the top. This might say something like "WCH CH340G" or "FTDI FT232RL".

Examples:

WCH CH340

CH340

📷

SparkFun - CC BY-SA 4.0 (cropped)

FTDI FT232R

📷

ICIC-SS28-X-K232-01 by oomlout - CC BY-SA 2.0 (cropped)


If it isn't clear, alternatively you can provide the link to where you bought the adapter from and we'll see if we can determine the chip from the product listing.

Thank you very much @ptillisch! You nailed it!
Now it uploads perfectly. And my adapter uses a FTDI FT232RL chip.
From now on I'll always close the Serial Monitor before leaving IDE.
Thank you!

You are welcome. I'm glad it is working now.

Although Arduino IDE is designed to allow uploading while Serial Monitor is open (it automatically closes the port in Serial Monitor at the start of the upload, then opens it again after), there is a bug that causes uploads to fail with this "Access is denied" error when using an FTDI FT232R chip:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.