Arduino Troubleshooting

(:*toc:)

Why I can't upload my programs to the Arduino board?

There are many pieces involved in getting a program onto your Arduino board, and if any of them aren't right, the upload can fail. They include: the drivers for the board, the board and serial port selections in the Arduino software, access to the serial port, the physical connection to the board, the firmware on the 8U2 (on the Uno and Mega 2560), the bootloader on the main microcontroller on the board, the microcontroller's fuse settings, and more. Here are some specific suggestions for troubleshooting each of the pieces.

Arduino Software

Drivers

Drivers provide a way for software on your computer (i.e. the Arduino software) to talk to hardware you connect to your computer (the Arduino board). In the case of Arduino, the drivers work by providing a virtual serial port (or virtual COM port). The Arduino Uno and Mega 2560 use standard drivers (USB CDC) provided by the operating system to communicate with the ATmega8U2 on the board. Other Arduino boards use FTDI drivers to communicate with the FTDI chip on the board (or in the USB-serial convertor).

The easiest way to check if the drivers for your board are installed correctly is by opening the Tools >> Serial Port menu in the Arduino software with the Arduino board connected to your computer. Additional menu items should appear relative to when you open the menu without the Arduino connected to your computer. Note that it shouldn't matter what name the Arduino board's serial port gets assigned as long as that's the one you pick from the menu.

Access to the Serial Port

Physical Connection

Access to the Serial Port

Physical Connection

an Ubuntu package (for 11.04) which includes support for these devices. If, however, you're using the RXTX package from your distribution, you may need to symlink from /devlab/ttyACM0 to /devlab/ttyUSB0 (for example) so that the serial port appears in the Arduino software.

Access to the Serial Port

Physical Connection

Bootloader

If it still doesn't work, you can ask for help in the forum. Please include the following information:

Why do I get "Build folder disappeared or could not be written" (Mac OS X)?>This might be caused by a conflict with the Logitech process 'LVPrcSrv.exe'. Open the Task Manager and see if this program is running, and if so, kill it before attempting the upload. more information

What if my board doesn't turn on (the green power LED doesn't light up)?

If you're using a Diecimila or older USB board (e.g. NG), make sure that the jumper (little plastic piece near the USB plug) is on the correct pins. If you're powering the board with an external power supply (plugged into the power plug), the jumper should be on the two pins closest to the power plug. If you're powering the board through the USB, the jumper should be on the two pins closest to the USB plug. This picture shows the arrangment for powering the board from the USB port.

Attach:jumper.jpg  Δ

(thanks to mrbbp for report and picture)

Why does my Diecimila take such a long time (6-8 seconds) to start my sketch?

Some of the Arduino Diecimila boards were accidently burned with the Arduino NG bootloader. It should work fine, but has a longer delay when the board is reset (because the NG doesn't have an automatic reset, so you have to time the uploads manually). You can recognize the NG bootloader because the LED on pin 13 will blink three times when you reset the board (as compared to once with the Diecimila bootloader). If your Diecimila has the NG bootloader on it, you may need to physically press the reset button on the board before uploading your sketch. You can burn the correct bootloader onto your Diecimila, see the

bootloader page for details.

What should I do if I get an error when launching arduino.exe on Windows?

If you get an error when double-clicking the arduino.exe executable on Windows, for example:

Arduino has encountered a problem and needs to close.

you'll need to launch Arduino using the run.bat file. Please be patient, the Arduino environment may take some time to open.

Why won't Arduino run on old versions of Mac OS X?

If you get an error like this:

Link (dyld) error: 

dyld: /Applications/arduino-0004/Arduino 04.app/Contents/MacOS/Arduino Undefined symbols: 
/Applications/arduino-0004/librxtxSerial.jnilib undefined reference to _printf$LDBL128 expected to be defined in /usr/lib/libSystem.B.dylib 

you probably need to upgrade to Max OS X 10.3.9 or later. Older versions have incompatible versions of some system libraries.

Thanks to Gabe462 for the report.

What do I do if I get an UnsatisfiedLinkError error (about native library librxtxSerial.jnilib) when launching Arduino?

If you get an error like this when launching Arduino:

Uncaught exception in main method: java.lang.UnsatisfiedLinkError: Native Library /Users/anu/Desktop/arduino-0002/librxtxSerial.jnilib already loaded in another classloader

you probably have an old version of the communications library lying around. Search for comm.jar or jcl.jar in /System/Library/Frameworks/JavaVM.framework/ or in directories in your CLASSPATH or PATH environment variables. (reported by Anurag Sehgal)

What about the error "Could not find the main class."?>

If you get this error when launching Arduino:

Java Virtual Machine Launcher: Could not find the main class. Program will exit.

make sure that you correctly extracted the contents of the Arduino .zip file - in particular that the lib directory is directly inside of the Arduino directory and contains the file pde.jar.

What can I do about cygwin conflicts on Windows?

If you already have cygwin installed on your machine, you might get an error like this when you try to compile a sketch in Arduino:

6 [main] ? (3512) C:\Dev\arduino-0006\tools\avr\bin\avr-gcc.exe: *** fatal error - C:\Dev\arduino-0006\tools\avr\bin\avr-gcc.exe: *** system shared memory version mismatch detected - 0x75BE0084/0x75BE009C.

This problem is probably due to using incompatible versions of the cygwin DLL.

Search for cygwin1.dll using the Windows Start->Find/Search facility and delete all but the most recent version. The most recent version *should* reside in x:\cygwin\bin, where 'x' is the drive on which you have installed the cygwin distribution. Rebooting is also suggested if you are unable to find another cygwin DLL.

If so, first make sure that you don't have cygwin running when you use Arduino. If that doesn't help, you can try deleting cygwin1.dll from the Arduino directory and replacing it with the cygwin1.dll from your existing cygwin install (probably in c:\cygwin\bin).

Thanks to karlcswanson for the suggestion.

Why does do the Arduino software and the Tools menu take a long time to open (on Windows)?

If the Arduino software takes a long time to start up and appears to freeze when you try to open the Tools menu, there by a conflict with another device on your system. The Arduino software, on startup and when you open the Tools menu, tries to get a list of all the COM ports on your computer. It's possible that a COM port created by one of the devices on your computer slows down this process. Take a look in the Device Manager. Try disabling the devices that provide COM ports (e.g. Bluetooth devices).

Why doesn't my board show in the Tools | Serial Port menu ?

bootloader page for details.

What should I do if I get an error when launching arduino.exe on Windows?

If you get an error when double-clicking the arduino.exe executable on Windows, for example:

Arduino has encountered a problem and needs to close.

you'll need to launch Arduino using the run.bat file. Please be patient, the Arduino environment may take some time to open.

Why won't Arduino run on old versions of Mac OS X?

If you get an error like this:

Link (dyld) error: dyld: /Applications/arduino-0004/Arduino 04.app/Contents/MacOS/Arduino Undefined symbols: Applications/arduino-0004/librxtxSerial.jnilib undefined reference to _printf$LDBL128 expected to be defined in /usr/lib/libSystem.B.dylib 

you probably need to upgrade to Max OS X 10.3.9 or later. Older versions have incompatible versions of some system libraries.

Thanks to Gabe462 for the report.

What do I do if I get an UnsatisfiedLinkError error (about native library librxtxSerial.jnilib) when launching Arduino?

If you get an error like this when launching Arduino:

Uncaught exception in main method: java.lang.UnsatisfiedLinkError: Native Library /Users/anu/Desktop/arduino-0002/librxtxSerial.jnilib already loaded in another classloader

you probably have an old version of the communications library lying around. Search for comm.jar or jcl.jar in /System/Library/Frameworks/JavaVM.framework/ or in directories in your CLASSPATH or PATH environment variables. (reported by Anurag Sehgal)

What about the error "Could not find the main class."?>If you're using a USB Arduino board, make sure you installed the FTDI drivers (see the Howto for directions). If you're using a USB-to-Serial adapter with a serial board, make sure you installed its drivers.

Make sure that the board is plugged in: the serial port menu refreshes whenever you open the Tools menu, so if you just unplugged the board, it won't be in the menu.

Check that you're not running any programs that scan all serial ports, like PDA sync applications, Bluetooth-USB drivers (e.g. BlueSoleil), virtual daemon tools, etc.

On Windows, the COM port assigned to the board may be too high. From zeveland:

"One little note if you aren't able to export and your USB board is trying use a high COM port number: try changing the FTDI chip's assignment lower one. >

"I had a bunch of virtual COM ports set up for Bluetooth so the board was set to use COM17. The IDE wasn't able to find the board so I deleted the other virtual ports in Control Panel (on XP) and moved the FTDI's assignment down to COM2. Make sure to set Arduino to use the new port and good luck."

Howto for directions). If you're using a USB-to-Serial adapter with a serial board, make sure you installed its drivers.

Make sure that the board is plugged in: the serial port menu refreshes whenever you open the Tools menu, so if you just unplugged the board, it won't be in the menu.

Check that you're not running any programs that scan all serial ports, like PDA sync applications, Bluetooth-USB drivers (e.g. BlueSoleil), virtual daemon tools, etc.

On Windows, the COM port assigned to the board may be too high. From zeveland:

"One little note if you aren't able to export and your USB board is trying use a high COM port number: try changing the FTDI chip's assignment lower one. >On the Mac, if you have an old version of the FTDI drivers, you may need to remove them and reinstall the latest version. See this forum thread for directions (thanks to gck).

What if I get a gnu.io.PortInUseException when uploading code or using the serial monitor (on the Mac)?

Error inside Serial.<init>() 
gnu.io.PortInUseException: Unknown Application 
     at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) 
     at processing.app.Serial.<init>(Serial.java:127) 
     at processing.app.Serial.<init>(Serial.java:72) 

This probably means that the port is actually in use by another application. Please make sure that you're not running other programs that access serial or USB ports, like PDA sync application, bluetooth device managers, certain firewalls, etc. Also, note that some programs (e.g. Max/MSP) keep the serial port open even when not using it - you may to need to close any patches that use the serial port or quit the application entirely.

If you get this error with Arduino 0004 or earlier, or with Processing, you'll need to run the macosx_setup.command, and then restart your computer. Arduino 0004 includes a modified version of this script that all users need to run (even those who ran the one that came with Arduino 0003). You may also need to delete the contents of the /var/spool/uucp directory.

I'm having trouble with the FTDI USB drivers.

Try installing the latest drivers from FTDI or contacting their support at

support1@ftdichip.com.

Why doesn't my sketch start when I power up or reset the Arduino board?

Most likely because you are sending serial data to the board when it firsts turns on. During the first few seconds, the bootloader (a program pre-burned onto the chip on the board) listens for the computer to send it a new sketch to be uploaded to the board. After a few seconds without communication, the bootloader will time out and start the sketch that's already on the board. If you continue to send data to the bootloader, it will never time out and your sketch will never start. You'll either need to find a way to stop serial data from arriving for the first few seconds when the board powers (e.g. by enabling the chip that sends the data from within your setup() function) or burn your sketch onto the board with an

"unsigned int()" the environment will not realize it's a function and create prototype for it. That means you need to provide your own, or place definition of above any calls >

Why do I get errors about an invalid device signature when trying to upload a sketch?

If you get an error like:

avrdude: Yikes!  Invalid device signature.
       Double check connections and try again, or use -F to override
       this check.

support1@ftdichip.com.

Why doesn't my sketch start when I power up or reset the Arduino board?

Most likely because you are sending serial data to the board when it firsts turns on. During the first few seconds, the bootloader (a program pre-burned onto the chip on the board) listens for the computer to send it a new sketch to be uploaded to the board. After a few seconds without communication, the bootloader will time out and start the sketch that's already on the board. If you continue to send data to the bootloader, it will never time out and your sketch will never start. You'll either need to find a way to stop serial data from arriving for the first few seconds when the board powers (e.g. by enabling the chip that sends the data from within your setup() function) or burn your sketch onto the board with an unsigned int() the environment will not realize it's a function and create prototype for it. That means you need to provide your own, or place definition of above any calls >it can mean one of two things. Either you have the wrong board selected from the Tools >> Board menu or you're not using the right version of avrdude. Arduino uses a slightly modified version of avrdude to upload sketches to the Arduino board. The standard version queries for the board's device signature in a way not understood by the bootloader, resulting in this error. Make sure you're using the version of avrdude that comes with Arduino ( source code).

Guide Home The text of the Arduino getting started guide is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the guide are released into the public domain.