Hello,
While using an arduino pro mini (Atmega 328p 3,3V 8mhz) connected to my pc via a FTDI serial to usb converter, the first times I upload my code it works without issue but then sometimes, it begins returning the error message :
avrdude: ser_open(): can't open device "\.\COM8": Acc�s refus�.
Failed uploading: uploading error: exit status 1
and then decides to continue not working until I wait for a day or two, sometimes it doesn't even fix the issue to restart the computer.
After a while I can succesfully reupload code and then it continues to show the same error.
It isn't like any of the similar problems I saw, in that sometimes it do work so it's very frustrating.
if it helps, I'm using the decawave DW1000 sensor connected to the arduino, maybe the issue starts when I upload a program using this sensor but I'm not sure, and after the issue occur I can't upload even a blink.
The issue doesn't happen at all while using an arduino uno so my pc is not the problem
I already tested the FTDI module with a loopback test and it works fine
I tried changing the usb cable
I tried changing the name of the com port being used to no avail
I tried everything I could think of, I don't even know how to start fixing this issue anymore.
Please help me
Thank you,
Edit : I found a temporary fix : by opening an exemple and copying the code I want to upload instead of it, it uploads fine, I don't know if it can help someone find what the issue is
Hi @herisfal. Which version of Arduino IDE are you using (e.g., "2.0.1")? The version is shown on the window title bar and also in the Help > About (or Arduino IDE > About Arduino IDE for macOS users) dialog.
I ask for this information because I want to give you the appropriate support for the IDE version you are using.
There is a known bug in Arduino IDE 2.x that can cause uploads to fail with this "Access is denied" error if you try uploading to a board using an FTDI chip while 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 when the FTDI USB chip is used.
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:
Upload the sketch.
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:
Upload the sketch.
Open Serial Monitor and/or Serial Plotter again if needed after the upload is finished.
Please let me know if you have any questions or problems while following those instructions.
Thanks a lot, it would explain all the issues I add and why it would work when I open a new example and closed the previous instance, and also why the issue wouldn't occur by just uploading a blink, because I wouldn't open the serial monitor.
Unfortunaly I can't test it yet because I don't have acess to the material at this moment.
When I can and if it works I will mark it as solved.
Thank you