Arduino IDE Troubleshooting

(:*toc:)

Errors running a sketch

Windows* Related

Mac OS X* Related

Miscellaneous

 

Errors Running a Sketch

Why I can't upload my programs to the Intel® Edison 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 Edison and more. The first step to always try is a complete reboot of the Edison board and your computer. When rebooting the Edison it is advised to unplug the power instead of using the "reboot" button on the board. If a full reboot does not solve your issues here are some specific suggestions for troubleshooting each of the pieces.

 

Arduino Software

 

 

 

Drivers

 

 

 

Access to the Serial Port

 

 

 

 

 

 

Physical Connection

 

 

 

 

 

Firmware

 

 


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

Error: Retry 0: Got TIMEOUT when trying to connect?

 

Getting Permission Denied when trying to upload a sketch?

Windows* Related

Why does the Arduino software freeze when I try to upload a program? (on Windows)?

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 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.

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).  

Mac OS X* Related

Why do I get "Build folder disappeared or could not be written" (on Mac OS X)?

Did you drag the Arduino.app out of the disk image (and into, say, your Applications folder)? If not, you won't be able to upload the examples.

Why doesn't the Arduino software run after I updated the Java (on Mac OS X)?

The latest Java update from Apple attempts to use 64-bit version of native libraries, but the Arduino application comes with a 32 bit version of the RXTX library. If you launch Arduino, you'll get an error like:

Uncaught exception in main method: java.lang.UnsatisfiedLinkError: /Applications/arduino-0016/Arduino 16.app/Contents/Resources/Java/librxtxSerial.jnilib: no suitable image found. Did find: /Applications/arduino-0016/Arduino 16.app/Contents/Resources/Java/librxtxSerial.jnilib: no matching architecture in universal wrapper

To fix this, click on the Arduino application (e.g. Arduino 16.app) in the Finder, and select Get Info from the File menu. In the info panel, click the Open in 32 Bit Mode checkbox. You should then be able to launch Arduino normally.

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 if I get a gnu.io.PortInUseException when uploading code or using the serial monitor (on Mac OS X)?

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.  

Miscellaneous

Why do I get a java.lang.StackOverflowError when I try to compile my program?

The Arduino environment does some preliminary processing on your sketch by manipulating the code using regular expressions. This sometimes gets confused by certain strings of text. If you see an error like:

java.lang.StackOverflowError
at java.util.Vector.addElement(Unknown Source)
at java.util.Stack.push(Unknown Source)
at com.oroinc.text.regex.Perl5Matcher._pushState(Perl5Matcher.java) 

or:

	at com.oroinc.text.regex.Perl5Matcher._match(Perl5Matcher.java)
	at com.oroinc.text.regex.Perl5Matcher._match(Perl5Matcher.java)
	at com.oroinc.text.regex.Perl5Matcher._match(Perl5Matcher.java)
	at com.oroinc.text.regex.Perl5Matcher._match(Perl5Matcher.java)
	at com.oroinc.text.regex.Perl5Matcher._match(Perl5Matcher.java)
	at com.oroinc.text.regex.Perl5Matcher._match(Perl5Matcher.java)
	at com.oroinc.text.regex.Perl5Matcher._match(Perl5Matcher.java) 

this is what's happening. Look for unusual sequences involving "double-quotes", "single-quotes", \backslashes, comments, etc. For example, missing quotes can cause problems and so can the sequence '\"' (use '"' instead).

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

Make sure that you are powering your board correctly according to this guide: https://software.intel.com/en-us/articles/intel-edison-arduino-expansion-board-assembly. The most common issues are that the switch near the USB ports is flipped in the wrong direction or your computer isn't supplying enough power through the USB port.  In the case of the latter, power your board with a 7-15V DC power supply.

 

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.

Why does my sketch appear to upload successfully but not do anything? 

Check for a noisy power supply. It's possible this could cause the chip to lose its sketch. If the power LED on the Edison board is flashing or flickering the system is resetting and cannot run any sketches. If you are using a battery to power the Edison make sure it is above 7 volts. If you are running off of USB power and have multiple sensors/servos plugged into your board there might not be enough power to run the logic. Unplug the sensors or servos or plug your Edison into the wall through the barrel jack and try loading the sketch again. 

Why don't I get a PWM (an analog output) when I call analogWrite() on pins  6, 9, 10, or 11?

The Edison is only capable of outputting a PWM on four pins at a time. By default the swizzler jumpers (J11 and J12) are set so that pins 3,5,6, and 9 are capable of PWM output. you can switch this to pins 3,5,10, and 11 by moving the swizzler. However you will not be able to output more than 4 PWMs at a time. For more information about the pins and adjusting the swizzler please see: http://www.emutexlabs.com/project/215-intel-edison-gpio-pin-multiplexing-guide 

Why do I get errors about undeclared functions or undeclared types?

The Arduino environment attempts to automatically generate prototypes for your functions, so that you can order them as you like in your sketch. This process, however, isn't perfect, and sometimes leads to obscure error messages.

If you declare a custom type in your code and create a function that accepts or returns a value of that type, you'll get an error when you try to compile the sketch. This is because the automatically-generated prototype for that function will appear above the type definition.

If you declare a function with a two-word return type (e.g. "unsigned int") the environment will not realize it's a function and will not create a prototype for it. That means you need to provide your own, or place the definition of the function above any calls to it.