I'm unable to upload code because of a problem of unable to connect with laptop
Hi @arsh217. This error can occur when the port is open in another application. Only one application can have a serial port open at a time so Arduino IDE can't perform an upload under these conditions.
Check to see whether you have any applications running on your computer that might use the port. If they are, close them and then try the upload again.
If there aren't any other applications using the port, add a reply here on this forum thread to let us know.
No it's the only app opened what other options can I do
Restart your computer and then try the upload again. In rare occasions, a glitch causes the port to get stuck open. This is one possible cause of the upload error. Restarting your computer restores the port to the normal working state and so fixes that particular cause of the error.
If the upload still fails after restarting your computer, add a reply here on this forum thread to let us know.
Linux or Windows on the laptop?
Windows
Yes I have done it all
Please tell us which USB to serial bridge chip your Nano board has. This is the largest black chip on the bottom of the board.
The chip will usually be identified by writing on the top. This might say something like "WCH CH340G" or "FTDI FT232RL".
Examples:
WCH CH340
FTDI FT232R
If it isn't clear, alternatively you can provide the link to where you bought the board from and we'll see if we can determine the chip from the product listing.
I can tell from the IC package that it is the WCH CH340 (or a CH340 clone/counterfeit).
Microsoft provides a free tool named Process Explorer that can be used to identify the process that is using the port and causing the upload error.
- Click the following link to open the documentation page for Process Explorer in your web browser:
https://learn.microsoft.com/sysinternals/downloads/process-explorer - Click the "Download Process Explorer" link on that page.
- Wait for the download to finish.
- Extract the downloaded file.
- Double click on the file named
procexp.exe
in the extracted folder.
The Process Explorer application will start. - Select Find > Find Handle or DLL..." from the Process Explorer menus.
"Process Explorer Search" dialog will open. - Type
\Device\Serial
in the "Handle or DLL substring:" field of the dialog. - Click the "Search" button.
A search will start, as indicated by the presence of the text "Searching..." at the bottom of the dialog. - Wait for the search to finish.
You should now see a process listed in the search results. Hopefully the name of the process will give you enough of a clue to identify the application that is blocking the serial port. If so, either close the port in the application, or else close the application, then try uploading again. Hopefully the upload will be successful this time.
If you aren't able to identify the application from the process name, add a reply here on this forum thread to let us know, including the name of the process.
It is showing on IDe that Access to COM8 was denied
Is my board statically damaged
????? Please reply
That's good. What does Windows device manager think of your board? You should see a USB-Serial CH340 like the last entry below when the board is connected; ignore that it's a different port.
It's detecting my esp32 but in the case of Arduino nano It's showing USB serial port. I think I should delete the drivers and Install them again
I wouldn't say this is definite proof that the chip is identifying as an FTDI brand device. An alternative explanation would be that the author of this "Terminal" app wrote their code to inaccurately refer to any general purpose USB to serial adapter as "FTDI device". This colloquialism is fairly common since, in the past, FTDI was the leader in making this type of chip before other companies such as Silicon Labs and WCH started making competing products in more recent years.
However, this is interesting because there was a previous report of someone who had a cheap Chinese board with an unlabeled USB to serial chip in a SOIC-16 package like yours, and also having inexplicable upload failures. They verified that their chip was identifying as an FTDI device:
Try this:
- Connect the board to your computer with a USB cable.
- Open Windows Device Manager.
- Expand the "Ports (COM & LPT)" section of the device tree.
- Right click on the "USB Serial Port (COM8)" device.
A context menu will open. - Select "Properties" from the menu.
The "USB Serial Port (COM8) Properties" dialog will open.
Now add a reply here on the forum thread to tell us what it says in the "Manufacturer" field of that dialog (e.g., "FTDI", "wch.cn")
I think the cable is the issue