Uploading using 5V FTDI and IDE 2.3.4 when I suddenly get a COM 4 access denied message between one upload and the next.
avrdude: ser_open(): can't open device "\.\COM4": Access is denied.
I've been uploading all day to the same embedded Mega 328P chip. No changes to the PC, no new device plugged into a port just a very sudden failure to communicate. On Device Manager I can see the cable and it detects properly, drivers are good.
I've loaded hundreds of sketches with this FTDI cable so it's possibly a failure however would it be detected by the PC if it was a dud?
Hi @CopperDog. To follow up on what @van_der_decken already wrote, there is a known bug in Arduino IDE 2.x that causes uploads to fail with this "Access is denied" error if you try uploading to a board using an FTDI FT232R USB chip while the Arduino IDE Serial Monitor or Serial Plotter is open.
A port can only be used by one process at a time, so Arduino IDE must automatically close the port in Serial Monitor and Serial Plotter during an upload, automatically opening it again after. For some reason, that juggling of the port control is not working with boards that have the FTDI USB chip.
If that bug is the cause of the problem you are having, the workaround will be to manually close the port in Serial Monitor/Serial Plotter before doing an upload. Please give that a try and then let me know if you still have the error while uploading:
Serial Monitor
Click the X icon on the "Serial Monitor" tab in the bottom panel of the Arduino IDE window to close the tab:
Open Serial Monitor again if needed (by clicking the icon on the IDE toolbar or the Tools > Serial Monitor menu item) after the upload is finished.
Serial Plotter
If you have the "Serial Plotter" window open, the procedure is a bit different from closing the Serial Monitor connection:
Close the "Serial Plotter" window.
If the "Serial Monitor" view is not already open, select Tools > Serial Monitor from the Arduino IDE menus to open it. ⓘ We must do an open/close cycle on Serial Monitor as a workaround for a bug in Serial Plotter
Click the X icon on the "Serial Monitor" tab in the bottom panel of the Arduino IDE window to close the tab:
An open serial monitor was the issue. Not sure why it opened because I don't have any outputs to monitor and it happened between uploads but now I know what to look for.