Arduino IDE stuck on Uploading

Hi Guys.
I am currently working with Arduino Nano but I cannot upload any code on it.
I have been working with my Arduino UNO from the past 1 month and faced no problem.
I Recently switched to Nano when the problem began.
Primarily when I hit upload it gives the error :
avrdude: ser_open(): can't open device "\\.\COM3": Access is denied.
As suggested by some people on the net I tried

  1. unplugging the Nano
    2.Uploading the code
    3.Plugging in the Nano
    4.Uploading the code
    Then it does not give the previous error instead it goes on an infinite uploading task which does not stop.
    I am Unable to upload even the Bare-Minimum code

Hi @fredi999. Please tell us which USB to serial adapter 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

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 board from and we'll see if we can determine the chip from the product listing.

I think it is WCH CH340G by looking at the number of Connections it has with the board.It has no label on it and I bought it offline so I cannot provide a link to it.Moreover When I connect it to my PC the nano shows up as USB-SERIAL CH340

Is COM3 indeed the Nano? Does it disapoear from the IDE and Windows device manager when disconnecting?

Have you tried the various options under tools -> processor. Clone Nanos often implement the old boot loader.

This happens to me with an earlier version of the IDE. I close the IDE, reopen it, check in tools that the correct Nano is selected and change the boot loader. if upload does not work. If it is a china clone you most likely need the old bootloader.

1 Like

Switching the bootloader to an older version did the job.
Thank you, everyone.
I also had an Arduino Pro Mini with the same issue. Although switching to an older bootloader did the job for Nano I still face the same issue with the pro mini.
Can you guys with this?
What I don't get is that I had already tried the older version of the bootloader using the online Arduino editor and it did not work but It works with the Arduino IDE.
does anyone know why?

Does your TTL-to-USB adapter that you use with the Pro Mini provide the DTR signal? If not, you need to manually reset the board at exactly the right time.

No idea. Try it again and see if it works now.

I use FT232RL as TTL-to-USB adapter. As for the DTR signal I don't know whether it provides or not.

This is the common wiring between a FTDI adapter and a Pro Mini; image copied from How to connect an Arduino Pro Mini to a PC via a USB to Serial module | B4X Programming Forum

Note the grey wire.

Yeah being wiring it up like this only

One other point; there is a bug in IDE 2.x that prevents uploads "through" a FTDI chip when serial monitor is open. Close serial monitor.

Might only apply to Windows, not sure.

I had my serial monitor closed from the beginning , Still tried again and it didn't work

Hi @fredi999. I'm going to ask you to post the full verbose output from an attempt to upload to your Pro Mini board.


:exclamation: This procedure is not intended to solve the problem. The purpose is to gather more information.


Please do this:

  1. Select File > Preferences... from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Uncheck the box next to Show verbose output during: compilation in the "Preferences" dialog.
  3. Check the box next to Show verbose output during: ☐ upload.
  4. Click the OK button.
  5. Attempt an upload, as you did before.
  6. Wait for the upload to fail.
  7. You will see a "Upload error: ..." notification at the bottom right corner of the Arduino IDE window. Click the COPY ERROR MESSAGES button on that notification.
  8. Open a forum reply here by clicking the Reply button.
  9. Click the <CODE/> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
    Code tags icon on toolbar
  10. Press Ctrl+V.
    This will paste the error output from the upload into the code block.
  11. Move the cursor outside of the code tags before you add any additional text to your reply.
  12. Click the Reply button to post the output.
Sketch uses 444 bytes (1%) of program storage space. Maximum is 30720 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
"C:\Users\user\AppData\Local\Arduino15\packages\arduino\tools\avrdude\include/bin/avrdude" "-CC:\Users\user\AppData\Local\Arduino15\packages\arduino\tools\avrdude\include/etc/avrdude.conf" -v -V -patmega328p -carduino "-PCOM5" -b57600 -D "-Uflash:w:C:\Users\user\AppData\Local\Temp\arduino\sketches\36E8496A6D7C895362B27282416DF449/sketch_aug14a.ino.hex:i"

avrdude: Version 6.3, compiled on Dec 16 2016 at 13:33:19
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Users\user\AppData\Local\Arduino15\packages\arduino\tools\avrdude\include/etc/avrdude.conf"

         Using Port                    : COM5
         Using Programmer              : arduino
         Overriding Baud Rate          : 57600
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x58
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x58
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x58
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x58
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x58
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x58
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x58
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x58
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x58
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x58

avrdude done.  Thank you.

Failed uploading: uploading error: exit status 1

This is what I got

This error might be caused by having the wrong port selected from the Tools > Port menu in Arduino IDE.

Please perform this experiment to verify that the port you have selected is your Arduino board:

With some boards, the port will be labeled with the board name in the menu (e.g., "COM42 (Arduino Uno)"). In this case, you can be fairly confident that you have identified the port. But for other boards such as your Pro Mini the port will not be labeled. You can positively identify the port using this procedure:

  1. Disconnect the USB cable of the Arduino board from your computer.
  2. Select Tools > Port from the Arduino IDE menus.
  3. Take note of the ports, if any, listed in the menu.
  4. Close the Tools menu.
    :exclamation: The ports list is only updated when the Tools menu is re-opened, so this step is essential.
  5. Connect the Arduino board to your computer with a USB cable.
  6. Select Tools > Port from the Arduino IDE menus. - If a new port is listed in the menu, that is the port of your Arduino board.

Select that port from the menu and try uploading again.

If the upload still fails, or if no new port appeared after you plugged the Arduino board into your computer, add a reply here to let us know and we'll investigate the problem further.

Yeah I am pretty sure that I am using the correct port as I did this a couple of times before.

Please perform the procedure I provided above to be certain. It only takes a few seconds to do and might save a lot of time and frustration.

I Meant I did the procedure that you suggested a lot of times before as I suspected the same issue . The port COM5 disappears when I disconnect the Arduino and reappears when I reconnect it. I did it again and same results.

It is possible for a short or external circuitry connected to the Arduino board to interfere with the upload process, causing this type of upload error.

Make sure the board is not sitting on anything conductive that could short the contacts on the bottom of the board. Make sure there isn't any conductive debris (e.g., strands of wire or component leads) on the board or on the surface the board is sitting on.

If you have a shield or any external circuitry or components connected to your Arduino board, try this experiment:

  1. Disconnect the USB cable of the Arduino board from your computer.
  2. Disconnect any shields, modules, external circuitry, etc. from your board.
  3. Connect the Arduino board to your computer with a USB cable.

Now try uploading a sketch to the board again. Does the upload succeed?

This experiment will determine whether the upload error was caused by interference from your external circuitry. If so, you can then focus your attention on identifying the specific problem with the circuit and resolving it.

Guys its working now. I think it was a circuit problem.I re-soldered the headers on the pro mini and now it works!! Thank you everyone for their time.