Arduino IDE not uploading code to Arduino Nano

I'm new to Arduinos and Arduino ide, I have my Arduino connected with USB to my PC, one of the LEDs on the Arduino flashes red and the other is stationary green.
The Arduino Nano gets recognized by the pc and the settings I use, are as suggested:
Board: Arduino Nano
Processor: ATmega328P (Old Bootloader)
Port: COM3

The port is the right one, because it's the only one that appears when the Arduino is connected.
As for the other settings these are the one I've seen as suggested on the internet, but I've tried several combinations and none of them works.

This is the error I get after trying to upload any code to the board with the settings I reported here above:

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x21
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x21
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x21
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x21
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x21
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x21
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x21
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x21
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x21
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x21
Problem uploading to board. See https://support.arduino.cc/hc/en-us/sections/360003198300 for suggestions.

Select Tools > Processor > ATmega328P from the Arduino IDE's menus and then try uploading again.

2 Likes

By selecting ATmega328P it gives me this error:

An error occurred while uploading the sketch
avrdude: ser_open(): can't open device "\.\COM3": Accesso negato.

The "Access is denied" error happens when the port is open in another application.

Make sure you have selected the port of your Arduino board from the Tools > Port menu.

You can find it like this:

  1. Unplug your Arduino board from the computer.
  2. Select Tools > Port from the Arduino IDE's menus.
  3. Note the ports, if any, listed in the menu.
  4. Close the Tools menu. The ports list is only updated when the Tools menu is re-opened, so this step is essential.
  5. Plug your Arduino board into the computer.
  6. Select Tools > Port from the Arduino IDE's menus. The new port listed in the menu is your Arduino board.

Make sure you don't have any other applications running that might have the port open. Only one application can have a serial port open at a time.

Try restarting your computer. Sometimes a glitch causes the port to get stuck open and restarting fixes that.

The Port is COM3, It's the only one that appears when I plug the Arduino.
The error is the same, tried restarting the pc several times but nothing changes.

The Error:

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x9a
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x9a
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x9a
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x9a
avrdude: stk500_recv(): programmer is not responding
Problem uploading to board. See https://support.arduino.cc/hc/en-us/sections/360003198300 for suggestions.
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x9a
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x9a
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x9a
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x9a
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x9a
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x9a

I'm not sure how any other application could be using the COM3 port, I tried closing every tab and background software apart from Arduino IDE.

You have reported two different classes of error in this thread:

This one is not caused by not being able to access the port.

This one is caused by not being able to access the port.

So you only need to be concerned with another application using the port when you get the second class of error message. Since you are no longer getting that error message, you should stop thinking about another application using the port because it will never cause the class of error message you're getting now. So you need to focus on the things that could possibly cause the error message you're getting right now, not the one you got before that has gone away.

The last time I replied, you were getting the second class of error message, so my instructions were targeted to the things that could cause that error message. Now that the error message has been resolved, the instructions in my last reply are no longer relevant.

This is something that can be very confusing for beginners. Sometimes you have multiple problems stacked on top of each other. When you fix one problem, you only move forward to the next problem, so it can seem like there is no progress. But actually that is an essential progression of working through each of the problems in turn until finally you achieve success.


Now, to focus on the error message you are getting now.

Remove any connections to pins 0 and 1 on your Arduino board. These pins are used for communication with your computer, including uploads. Connecting anything to these pins can interfere with uploads.

Make sure you have the correct board selected from the Arduino IDE's Tools > Board menu. Note that some boards have similar names, but are not interchangeable. Examples include "Arduino Nano" vs. "Arduino Nano Every" vs. "Arduino Nano IoT" vs "Arduino Nano 33 BLE" vs. "Arduino Nano RP2040 Connect".

Be sure to try both the "old bootloader" and "new bootloader" options; when I buy new boards they come with one or the other (could be either); doesn't seem to matter which - BUT - you need to use the right option for it to work.

1 Like

This is the only reason it matters (the old Nano bootloader is the same as the Pro Mini bootloader):

If you aren't doing watchdog resets then either bootloader will work fine.

How is your Arduino Nano looks like? What type of USB-UART bridge does it have?
Give please photo of both sides.
What your Device manager says when the board is connected?

It’s all a wee bit over my head, but I find that with some Nano clones that I get from AliExpress, I can’t upload a sketch unless it’s set to “old boot loader” - but at other times it has to be the newer one or it doesn’t upload.

I’ve just got in the habit of trying the other if the first one doesn’t work - not sure if that’s the way it’s supposed to work, but that’s how it seems to need to be at my end.

1 Like

You don't answer questions that might clarify the situation.
First you need to know exactly what kind of Arduino board you have.

That is the way it's supposed to work. In order to be able to upload, you must select the appropriate Tools > Processor selection for the bootloader you have on your board.

However, we have already talked about this at the very start of the topic. You can see from @lucazerbi's first post that they were initially using the ATmega328P (Old Bootloader) selection and not able to upload. This indicates to me that selecting Tools > Processor > ATmega328P (Old Bootloader) has no hope of solving their problem.

I then instructed them to try the Tools > Processor > ATmega328P option. So this indicates to me that we have already tried both bootloader selections without luck and that it's best to look for other possible solutions to the problem.

2 Likes

I had a similar problem when I installed a new IDE version (I think it was 1.8.9).
This was the way I solved the problem:
Under Tools in the IDE:
Select Boards/Arduino Nano
Then Under Tools select Processor
Select Processor:ATmega328P (Old Bootloader)

Good luck

1 Like

I have nothing connected to the board apart from the USB cable that is plugged into my pc.
In the Tools-Board menu I have only Arduino Nano and nothing else with the words Arduino and nano in it like you mentioned.

As for bootloaders I have 3 options and tried all of them and non worked.

Also tried using the Arduino pro mini with no change

Here are pictures of the board:

After you press and release the "RESET" button, do you see the "L" LED blink quickly a few times?

It only blinks once

The Nano's new bootloader does three blinks, so this indicates that the original Tools > Processor > ATmega328P (Old Bootloader) selection you had was the right one.

But I don't suppose it will start working when you do that, since it wasn't working for you at the start of the thread when you had that selected.

The next step in trying to fix this issue is burning the bootloader. That will require an ISP programmer. If you don't own a dedicated ISP programmer, you can use a spare Arduino board as an "Arduino as ISP" programmer, as shown in this tutorial:

However, I should warn you that this is not guaranteed to fix the problem. Often an inability to upload indicates a physical problem with the board, which would never be solved by burning the bootloader. It's a fairly complex process that many people find very difficult to accomplish. But it is very interesting and something that will likely be valuable to learn for anyone who is going to get deeply involved in the world of Arduino. So the choice is yours whether you choose to jump down that particular rabbit hole.

Your board has a CH340G USB-UART bridge. Have you installed the drivers for the CH340G?
What does your Device Manager show?
In Ports (COM and LPT) category must be USB-SERIAL CH340 (COM3) or other COM number when your board is connected.
For drivers see here How to Install CH340 Drivers
I have several of these boards and they all work well.

1 Like

Yes the drivers have been installed, I even tried to uninstall and reinstall but no changes.
The Arduino when plugged in is shown as "USB-SERIAL CH340 (COM3)"

Then everything should be simple.
Tools> Board:> Arduino Nano
then
Tools> Processor:> ATmega328P (Old bootloader)
Tools> Port> COM3
Tools> Get Board Info
GetBoardInfo-Nano

If that doesn't work, all that remains is

  1. Reinstall the driver - you've already tried it.
  2. Reinstall Arduino IDE - find and delete all folders of Arduino IDE completely before a new installation.
  3. Rewrite the bootloader with a different board.
  4. Throw away the Nano board.