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 Galileo and more. The first step to always try is a complete reboot of the Galileo board and your computer. When rebooting the Galileo 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.
Access to the Serial Port
If it still doesn't work, you can ask for help in the forum. Please include the following information:
Try logging into your board via SSH, or serial, and delete or rename /sketch/sketch.elf file, and then reboot, or at minimum kill the existing running sketch.elf process. Its particularly an issue with porting over a simple Arduino example, or running the AnalogReadSerial, or DigitalReadSerial examples from the IDE. The Intel IoT platforms share the USB connection with the Serial Monitor, unlike a standard Arduino.
This error is usually assosiated with a sketch that is running on your board interfering with uploading new sketches. To solve this problem follow these steps:
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
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.
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.
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).
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.
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.
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.
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)
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).
Make sure that you are powering your board correctly according to the "Tools > Getting Started" guide in the Arduino IDE menu.
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)
If you get this error when launching Arduino:
Java Virtual Machine Launcher: Could not find the main class. Program will exit.
Check for a noisy power supply. It's possible this could cause the chip to lose its sketch. If the power LED on the Galileo board is flashing or flickering the system is resetting and cannot run any sketches. If you are using a battery to power the Galileo 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 Galileo into the wall through the barrel jack and try loading the sketch again.
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.