i can't upload my sketches

Good day everybody

I have a problem with my arduino nano. i bought it yesterday and wantet to test it. i pluged it in my pc, but nothing happend I testeted diffrent usb ports and usb cabel, also diffrent boot loaders ( old bootloader ), also diffrent coms.

but everytime i ran into the same issu. ( error message that it coulden't upload the sketch)

after a certain time i unpluged all my usb devices ( but not the arduino nano) and now i have the error message

Arduino: 1.8.13 (Windows 10), Board: "Arduino Nano, ATmega328P (Old Bootloader)"

C:\Users\jbarr\AppData\Local\Temp\Temp1_RFID_RC522_MasterCard_MultipleAccess (1).zip\RFID_RC522_MasterCard_MultipleAccess\RFID_RC522_MasterCard_MultipleAccess.ino: In function 'updateState':

C:\Users\jbarr\AppData\Local\Temp\Temp1_RFID_RC522_MasterCard_MultipleAccess (1).zip\RFID_RC522_MasterCard_MultipleAccess\RFID_RC522_MasterCard_MultipleAccess.ino:95:31: warning: 'cardIndex' may be used uninitialized in this function [-Wmaybe-uninitialized]

     cardArr[cardIndex][index] = readCard[index];

                               ^

C:\Users\jbarr\AppData\Local\Temp\Temp1_RFID_RC522_MasterCard_MultipleAccess (1).zip\RFID_RC522_MasterCard_MultipleAccess\RFID_RC522_MasterCard_MultipleAccess.ino:83:7: note: 'cardIndex' was declared here

   int cardIndex;

       ^

Sketch uses 6530 bytes (21%) of program storage space. Maximum is 30720 bytes.

Global variables use 400 bytes (19%) of dynamic memory, leaving 1648 bytes for local variables. Maximum is 2048 bytes.

C:\Users\jbarr\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude -CC:\Users\jbarr\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf -v -patmega328p -carduinoisp -Uflash:w:C:\Users\jbarr\AppData\Local\Temp\arduino_build_289065/RFID_RC522_MasterCard_MultipleAccess.ino.hex:i 



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\jbarr\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"



         Using Port                    : usb

         Using Programmer              : arduinoisp

avrdude: Error: Could not find USBtiny device (0x2341/0x49)



avrdude done.  Thank you.



the selected serial port 

 does not exist or your board is not connected



This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

that there does no serial port exist or the board isn't connected.

i installed after this diffrent drivers but I had everytime the same issu

is it possible that i cannot connect to my pc in some reason ? do you maybe know why ?

I tried it also on a diferent pc but had the same issu

thank you for your help

From the output you posted, I can tell you're doing an "Upload Using Programmer" instead of the standard "Upload" you're supposed to be doing.

Make sure you're not holding the Shift key when you click the "Upload" button.

To make extra sure, you can use the Arduino IDE menu item Sketch > Upload to start the upload process rather than clicking the button or using the Ctrl + u keyboard shortcut.

Why does the error message say USBTINY ?

Did you select a programmer that you do not have ?
By default it should be "AVRISP mkii"

Yea i tested it with the normal uploader and it took extremly long to do

but now i tested it with the "AVRISP mmii" and I got this

Arduino: 1.8.13 (Windows 10), Board: "Arduino Nano, ATmega328P (Old Bootloader)"

C:\Users\jbarr\Documents\Arduino\libraries\MFRC522-1.4.7\src\MFRC522Extended.cpp: In member function 'MFRC522::StatusCode MFRC522Extended::TCL_Transceive(MFRC522Extended::TagInfo*, byte*, byte, byte*, byte*)':

C:\Users\jbarr\Documents\Arduino\libraries\MFRC522-1.4.7\src\MFRC522Extended.cpp:824:29: warning: ordered comparison of pointer with integer zero [-Wextra]

  if (backData && (backLen > 0)) {

                             ^

C:\Users\jbarr\Documents\Arduino\libraries\MFRC522-1.4.7\src\MFRC522Extended.cpp:847:30: warning: ordered comparison of pointer with integer zero [-Wextra]

   if (backData && (backLen > 0)) {

                              ^

C:\Users\jbarr\AppData\Local\Temp\Temp1_RFID_RC522_MasterCard_MultipleAccess (1).zip\RFID_RC522_MasterCard_MultipleAccess\RFID_RC522_MasterCard_MultipleAccess.ino: In function 'updateState':

C:\Users\jbarr\AppData\Local\Temp\Temp1_RFID_RC522_MasterCard_MultipleAccess (1).zip\RFID_RC522_MasterCard_MultipleAccess\RFID_RC522_MasterCard_MultipleAccess.ino:95:31: warning: 'cardIndex' may be used uninitialized in this function [-Wmaybe-uninitialized]

     cardArr[cardIndex][index] = readCard[index];

                               ^

C:\Users\jbarr\AppData\Local\Temp\Temp1_RFID_RC522_MasterCard_MultipleAccess (1).zip\RFID_RC522_MasterCard_MultipleAccess\RFID_RC522_MasterCard_MultipleAccess.ino:83:7: note: 'cardIndex' was declared here

   int cardIndex;

       ^

Sketch uses 6530 bytes (21%) of program storage space. Maximum is 30720 bytes.

Global variables use 400 bytes (19%) of dynamic memory, leaving 1648 bytes for local variables. Maximum is 2048 bytes.

C:\Users\jbarr\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude -CC:\Users\jbarr\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf -v -patmega328p -carduino -PCOM4 -b57600 -D -Uflash:w:C:\Users\jbarr\AppData\Local\Temp\arduino_build_777149/RFID_RC522_MasterCard_MultipleAccess.ino.hex:i 



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\jbarr\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"



         Using Port                    : COM4

         Using Programmer              : arduino

         Overriding Baud Rate          : 57600

avrdude: ser_open(): can't open device "\\.\COM4": Das Zeitlimit f�r die Semaphore wurde erreicht.






avrdude done.  Thank you.



Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.



This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

You seem to have narrowed it down to a library you are using that is either being called from your sketch incorrectly or that may be incompatible with your hardware.

Could you take a few moments to Learn How To Use The Forum.
It will help you get the best out of the forum in the future.
Other general help and troubleshooting advice can be found here.

Then you can post the sketch and a link to where you got the library.

jeremy-barrot:
Yea i tested it with the normal uploader

The only time you should ever use "Upload Using Programmer" is when you have an ISP programmer attached to your Arduino board. If you don't know what an ISP programmer is, that means you don't own one and should always use "Upload".

jeremy-barrot:

avrdude: ser_open(): can't open device "\\.\COM4": Das Zeitlimit f�r die Semaphore wurde erreicht.

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

Sometimes the port will be labeled with the board name in the menu. Other times it will not. If you don’t know which port is your Arduino board, you can find it like this:

  • Unplug your Arduino board from the computer.
  • Tools > Port
  • Note the ports, if any, listed in the menu.
  • Close the Tools menu. The ports list is only updated when the Tools menu is re-opened, so this step is essential.
  • Plug your Arduino board into the computer.
  • Tools > Port - The new port listed in the menu is your Arduino board.

ballscrewbob:
You seem to have narrowed it down to a library you are using that is either being called from your sketch incorrectly or that may be incompatible with your hardware.

This has nothing to do with a library. There are some compiler warnings from the library, but it's likely these can be safely ignored. The compilation is successful.

The problem is the failed upload, which is unrelated to those compiler warnings.

Okey I did it, how you said I should do it. i got the same ports with the board plug or unpluged

If you open Windows Device Manager and then plug in your Nano to your computer, do you see a new item appear under the "Ports (COM & LPT)" section of the tree?

No i don't see a new Item appear

You indicate you have a Nano, whose USB interface is apparently not talking:

avrdude: ser_open(): can't open device "\.\COM4"

If you open device Manager, do you see an FTDI under the Ports section?

When I do the same for an older Duemilanove, which has an FTDI chip also, I see this.
Clicking on Port Settings, then Advanced, I can see the Port Number (and can reassign it).
What do you see for yours?

On my device manger I see nothig appear when i plug it in or out. I don't see a FTDI under my port section.

What I see under section ports is serial port (Com 3-6)

i tried every port to upload a sketch but no one works

Make sure the USB cable is completely plugged into both the Arduino board and the PC.

You may have a damaged/defective or charge-only USB cable. Try a different cable.

Either of the above can result in the power connections being made (and thus LED lights on the board), but no data connections (and thus no port for the board).

Does your Nano actually have an FTDI chip (FT232RL usually) on the back side? Or something else?
If something else, you need to trackdown the correct driver.

Also, make sure you have a USB Data cable, not one that only has power/Gnd.

Yeah I have a FTDI (FT232RL) chip.

I tried several cabels but had the same problem.

is there a way to determind if its a data cabel or a pw/Gnd cabel ?

Yes, you can use a meter and buzz it out, making sure you have continuity from end to end on all 4 wires.

Maybe tape the cable ends down so you can probe both ends at once. Or get a helper to probe one end while you probe the other.

Yeah the problem is i don't have a multi meter. :slight_smile: :confused:

If you can use the cable for data on another device, then it's a data cable.

The question is whether you have another device that can be connected to a USB mini B cable.

Yeah same problem i don't have a device with mini usb

Can always fake a meter with an LED, resistor, and power supply (battery). Make a series circuit with cable, see if the LED lights up.
Battery+ to one cable end,
other cable end to resistor,
other resistor end to LED Anode,
LED cathode (usually the short lead, or the lead with the flattened bit on the LED body) to Battery-.

Try without the cable first to make sure the LED is working.

I tried it and i think that I have a data capable cable.

could it be that something other is wrong ?