sufit
April 20, 2023, 10:56pm
1
Hi All,
I am having issue with flashing dev kit for ESP32. For some reason I was able to flash it for the firs time with Hello World serial.println but after that I am keep getting following error.
When I look at serial monitor it is keep populating Hello World..
This is strange as it looks like it is communicating but i cant upload anything...
I Would appreciate your help.
Here are details of the kit I am using.
https://www.aliexpress.com/item/1005004632953455.html?spm=a2g0o.order_list.order_list_main.11.51791802xvgh7Y
Regards,
D
Hi @sufit .
Please try this:
Click the X icon on the "Serial Monitor " tab in the bottom panel of the Arduino IDE window to close Serial Monitor :
Try uploading again.
I don't have any specific reason to think Serial Monitor is the cause of the "Access is denied" error you got while uploading, but it is worth a try just in case.
The "Access is denied" error occurs when you try to upload while some other application or process has the COM3 port open. Serial Monitor is designed to automatically close the port when you start an upload so that it won't cause this error, however, there is a known bug that will cause this error when uploading to a board that has an FTDI FT232R USB chip. From the pictures on the Aliexpress listing, it appears your board has the WCH CH340 USB chip, which has never been reported to be affected by that bug (I've even tested it personally) so the problem maybe something completely different, but it's easy enough to run a quick experiment to be certain.
sufit
April 21, 2023, 8:33am
3
You were dead right !!! and I though I burned something cos I've soldered wires
Thanks a lot...
You are welcome. I'm glad we identified the problem. For reference, here is the formal bug report used by the Arduino IDE developers to track this problem:
opened 07:07AM - 23 Dec 22 UTC
topic: code
type: imperfection
### Describe the problem
In order to upload to an Arduino board via a serial … port, the upload tool (e.g., [**AVRDUDE**](https://github.com/avrdudes/avrdude)) must be able to open the port. This is not possible if another process already has control of the port.
Arduino IDE's "Serial Monitor" and and "Serial Plotter" components also use the serial port of the board. Arduino IDE handles this potential conflict of port usage automagically by closing the port in Serial Monitor/Plotter when an upload process is triggered, then opening it again after the upload is finished. This means no special action is needed from the user to upload while Serial Monitor/Plotter is open.
🐛 The upload fails with an "`Access is denied`" error under the following conditions:
- The board uses an FTDI FT232R USB chip
- Arduino IDE is running on a Windows machine
- Serial Monitor or Serial Plotter is open
I've been using Arduino IDE 2.0.3 with Nano without issues when uploading on Ubuntu. Now I've tried it on Windows 11, and most of the time, it gives me this error:
```text
avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Users\macie\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"
Using Port : COM5
Using Programmer : arduino
Overriding Baud Rate : 115200
avrdude: ser_open(): can't open device "\\.\COM5": Access is denied.
```
But I can see logs from the serial monitor in Arduino IDE -> serial monitor.
### To reproduce
#### Equipment
A board or other device that has an [FTDI FT232R USB chip](https://ftdichip.com/products/ft232rl/)
The [classic **Arduino Nano**](https://docs.arduino.cc/hardware/nano) is a common board that uses this chip.
FT232R modules ([example](https://docs.arduino.cc/retired/other/usb-serial-converter)) or cables ([example](https://www.sparkfun.com/products/9717)) are also often used to upload to boards such as the [**Arduino Pro Mini**](https://www.sparkfun.com/products/11113) that don't have an integrated USB chip.
The fault can be reproduced even if the FT232R-based device is not an Arduino board. In this case, the upload is expected to fail, but it would fail with a "`not in sync`" error instead of "`Access is denied`".
#### Steps
1. Select **File > New Sketch** from the Arduino IDE menus.
1. Connect the Arduino board to your computer.
1. Select the board and port from the Arduino IDE menus.
1. If the Serial Monitor view is not already open, select **Tools > Serial Monitor** from the Arduino IDE menus to open it.
1. Select **Sketch > Upload** from the Arduino IDE menus.
1. Wait for the upload process to finish.
🐛 The upload fails:
```text
avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Users\macie\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"
Using Port : COM5
Using Programmer : arduino
Overriding Baud Rate : 115200
avrdude: ser_open(): can't open device "\\.\COM5": Access is denied.
```
1. Click the **X** icon on the "**Serial Monitor**" view tab in the bottom panel.
1. Select **Sketch > Upload** from the Arduino IDE menus.
1. Wait for the upload process to finish.
🙂 The upload is successful.
1. Select **Tools > Serial Plotter** from the Arduino IDE menus.
1. Select **Sketch > Upload** from the Arduino IDE menus.
1. Wait for the upload process to finish.
🐛 The upload fails:
```text
avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Users\macie\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"
Using Port : COM5
Using Programmer : arduino
Overriding Baud Rate : 115200
avrdude: ser_open(): can't open device "\\.\COM5": Access is denied.
```
1. Close the "**Serial Plotter**" window.
1. Select **Sketch > Upload** from the Arduino IDE menus.
1. Wait for the upload process to finish.
🐛 The upload fails:
```text
avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Users\macie\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"
Using Port : COM5
Using Programmer : arduino
Overriding Baud Rate : 115200
avrdude: ser_open(): can't open device "\\.\COM5": Access is denied.
```
**ⓘ** This unexpected result is caused by a separate bug: https://github.com/arduino/arduino-ide/issues/1423
### Expected behavior
Serial Monitor and Serial Plotter do not interfere with upload process.
### Arduino IDE version
#### Original report
2.0.3
#### Last verified with
692f29f
### Operating system
Windows
### Operating system version
Edition Windows 11 Pro
Version 22H2
Installed on 07/11/2022
OS build 22621.963
Experience Windows Feature Experience Pack 1000.22638.1000.0
### Additional context
I bisected the introduction of the fault to df8658e
---
I have no problems uploading sketches on Arduino IDE 1.8.19 from Microsoft Store on the same system. I can quit 2.0.3, start 1.8.19, and it's working immediately.
---
I cannot reproduce the fault on Linux (Ubuntu 22.04) or macOS (Ventura).
---
I cannot reproduce the fault when using native USB boards (e.g., [**Leonardo**](https://docs.arduino.cc/hardware/leonardo), [**MKR**](https://docs.arduino.cc/#mkr-family)) or boards that use other models of dedicated USB chip (e.g., ATmega16U2 on Uno and Mega, WCH CH340 on derivative boards).
#### Workaround
##### Serial Monitor
1. Click the **X** icon on the "**Serial Monitor**" tab in the bottom panel of the Arduino IDE window to close the tab:

1. Upload the sketch.
1. 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
1. Close the "**Serial Plotter**" window.
1. 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](https://github.com/arduino/arduino-ide/issues/1423) in **Serial Plotter**
1. Click the **X** icon on the "**Serial Monitor**" tab in the bottom panel of the Arduino IDE window to close the tab:

1. Upload the sketch.
1. Open **Serial Monitor** and/or **Serial Plotter** again if needed after the upload is finished.
#### Additional reports
- https://forum.arduino.cc/t/arduino-nano-not-able-to-upload-comx-port-access-denied/1081669/15
- https://forum.arduino.cc/t/elusive-uno-upload-error-access-is-denied/1067785/5
- https://forum.arduino.cc/t/port-issues-with-ide-2-0-3/1069090
- https://forum.arduino.cc/t/fdti-breakout-2-types-cause-usb-acess-denial/1088005
- https://forum.arduino.cc/t/port-access-is-denied/1089761
- https://github.com/arduino/arduino-ide/issues/1937
- https://github.com/arduino/arduino-ide/issues/726#issuecomment-1464313325
### Issue checklist
- [X] I searched for previous reports in [the issue tracker](https://github.com/arduino/arduino-ide/issues?q=)
- [X] I verified the problem still occurs when using the latest [nightly build](https://www.arduino.cc/en/software#nightly-builds)
- [X] My report contains all necessary details
As I mentioned in my previous reply, I have only ever seen and experienced this fault when using boards with the FT232R USB chip. So your report is very interesting. Would you mind telling me whether or not your ESP32 board has a chip that looks like this on it?:
(note the "WCH" logo and the "CH340" model name marked on the chip)
sufit
April 21, 2023, 2:56pm
5
Yes, this one looks exactly the same as the one I have.
If you are familiar with this board maybe I could ask for some info on wiring GPS Module SAM-M8Q and Rotary encoder KY-040. besides that I want to use P1 slot for powering it with battery but I will only use GND and V Pins still have Rx and Tx left for the GPS, I just wonder if will this work.
Regards,
Thanks for the information! That is very useful for me to know. Hopefully this bug in Arduino IDE will be fixed soon. Until then, you can use the workaround of closing the "Serial Monitor " tab before uploading, then if you need it, opening Serial Monitor again after that.
You might also experience the same interference if you have the Serial Plotter open when uploading. In this case, the procedure for freeing the port is a little more involved. It is explained here:
https://github.com/arduino/arduino-ide/issues/1783#serial-plotter
If you have a GitHub account, you can subscribe to that issue to get notifications of any new developments related to this subject.
Unfortunately I am not familiar with the board. I only took a quick look at the Aliexpress product listing you linked (the picture I posted is from one of the product reviews on that page).
Since it is unrelated to the original subject of this topic I recommend you create a new topic to ask this question. That will ensure the helpers here who are knowledgeable on the subject matter will see it.
Regards,
Per
system
Closed
October 18, 2023, 3:54pm
7
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.