14 Replies Latest reply on Jul 26, 2016 10:00 AM by vivekhs

    Getting a Weird Error Whenever I Try to Upload

    KatieB

      Hey you guys!

       

      So, my Galileo was working fine until I tried to use the WiFi library. I uploaded one of the example sketches from arduino.cc

      (http://arduino.cc/en/Guide/ArduinoWiFiShield#toc6), and it couldn't get a WiFi connection. After that, I tried to upload another sketch, but it keeps giving me this:

       

      -------

       

      Binary sketch size: 45,145 bytes (of a 262,144 byte maximum) - 17% used

      #!/bin/sh

      starting download script

       

       

      Args to shell: C:\Users\Owner\Downloads\arduino-1.5.3/hardware/tools/x86/bin C:\Users\Owner\AppData\Local\Temp\build2555323333484619238.tmp/sketch_oct16a.cpp.elf COM13

      echo "starting download script"

      COM PORT 13

      echo "Args to shell:" $*

      Converted COM Port COM13 to tty port /dev/ttyS12

       

       

      Sending Command String to move to download if not already in download mode

      # ARG 1: Path to lsz executable.

      # ARG 2: Elf File to download

      # ARG 3: COM port to use.

       

       

      #path contains \ need to change all to /

      path_to_exe=$1

      fixed_path=${path_to_exe//\\/\/}

       

       

      #COM ports are not always setup to be addressed via COM for redirect.

      #/dev/ttySx are present. Howwever, COMy -> /dev/ttySx where x = y - 1

       

       

      com_port_arg=$3

      com_port_id=${com_port_arg/COM/}

      echo "COM PORT" $com_port_id

      tty_port_id=/dev/ttyS$((com_port_id-1))

      echo "Converted COM Port" $com_port_arg "to tty port" $tty_port_id

       

       

      echo "Sending Command String to move to download if not already in download mode"

      Deleting existing sketch on target

      echo "~sketch download" > $tty_port_id

      C:\Users\Owner\Downloads\arduino-1.5.3/hardware/arduino/x86/tools/izmir/clupload_win.sh: line 24: /dev/ttyS12: Permission denied

       

       

      #Move the existing sketch on target.

      echo "Deleting existing sketch on target"

      $fixed_path/lsz.exe --escape -c "mv -f /sketch/sketch.elf /sketch/sketch.elf.old" <> $tty_port_id 1>&0

      C:\Users\Owner\Downloads\arduino-1.5.3/hardware/arduino/x86/tools/izmir/clupload_win.sh: line 28: /dev/ttyS12: Permission denied

       

       

      # Execute the target download command

       

       

      #Download the file.

      host_file_name=$2

      $fixed_path/lsz.exe --escape --binary --overwrite $host_file_name <> $tty_port_id 1>&0

      C:\Users\Owner\Downloads\arduino-1.5.3/hardware/arduino/x86/tools/izmir/clupload_win.sh: line 34: /dev/ttyS12: Permission denied

       

       

      Moving downloaded file to /sketch/sketch.elf on target

      #mv the downloaded file to /sketch/sketch.elf

      target_download_name="${host_file_name##*/}"

      echo "Moving downloaded file to /sketch/sketch.elf on target"

      #$fixed_path/lsz.exe --escape -c "cp sketch /sketch/sketch.elf" <> $tty_port_id 1>&0

      $fixed_path/lsz.exe --escape -c "mv $target_download_name /sketch/sketch.elf; chmod +x /sketch/sketch.elf" <> $tty_port_id 1>&0

      C:\Users\Owner\Downloads\arduino-1.5.3/hardware/arduino/x86/tools/izmir/clupload_win.sh: line 40: /dev/ttyS12: Permission denied

       

      -------

       

      galileoerror.PNG

       

      I've tried rebooting the board and using different usb ports, but I'm kind of at a loss here. I keep getting the same error message -- "Permission denied". Any ideas? One time, I got the IDE to say that it was uploading, but it took over an hour and nothing seemed to be happening so I unplugged the board (hoping I didn't do any more damage here). Please help! I'm pretty new here in the land of Arduino, and I'm kind of freaked out.

       

      Thanks!

        • 1. Re: Getting a Weird Error Whenever I Try to Upload
          ado

          hi Katie,

          I believe some issues exist regarding COM ports when using the Windows OS.

          You could try switching the COM port number to a fresh one:

          Device Manager->Right click on COM port->Properties->Port Settings->Advanced

          and then change the COM port number in the drop down menu and then just ensure you select the new one in the Arduino IDE.

          can you try this and see if it works?

           

          Otherwise just log off windows or reboot your system and see if the issue is gone?

          -a

          • 2. Re: Getting a Weird Error Whenever I Try to Upload
            Trush

            Was this resolved? I am seeing this as well and tried switching COM ports and it doesn't seem to help. Restarting windows or the board doesn't help either. It was working fine till I tried uploading a RF receive sketch. 

            • 3. Re: Getting a Weird Error Whenever I Try to Upload
              Alessio

              Hello, I'm having the same issue.

               

              I ve tried to change port but it doesn't help...

               

              Any useful suggestion?

               

              Thank you!

              • 4. Re: Getting a Weird Error Whenever I Try to Upload
                Trush

                I tried a combination of things which I did before as well and this time it worked for me. My laptop went through a couple of unrelated reboots so that might have helped. When I tried to connect to it initially, it gave me a permission denied  error which was resolved once I manually changed the COM port using the windows device manager. In my case I noticed Bluetooth was using COM7 which for some reason, was also assigned to Galileo. I changed Galileo  to COM8 and it worked.

                1 of 1 people found this helpful
                • 5. Re: Getting a Weird Error Whenever I Try to Upload
                  MinimalMonk

                  Anyone getting any answers here? Exactly same issue as KatieB, made the same way.

                  • 6. Re: Getting a Weird Error Whenever I Try to Upload
                    JMR

                    I faced the same issue, I think that it happens while you try to download a sketch and the board is already running a sketch.

                    What I do is the following :

                     

                    - Disconnect the USB cable from the PC (when you connect an USB device, a sound is played, let's call it "ding-don g" and when you disconnect the device, another sound is played, let call it "don g-ding"). Make sure that the sound "don g-ding" is played so you know that Windows see the device as disconnected. It can take several seconds, be patient!

                     

                    - Disconnect the power supply (never disconnect the power supply if the USB cable is still connected!)

                     

                    - Reconnect the power supply

                     

                    - Reconnect the USB cable, your PC should play the sound "ding-don g)

                     

                    - Then you can upload the sketch

                     

                    It is obvious that something like "stop execution" to re-take the control of the board is missing... Intel support, do you have any plan to improve this point with Arduino team?

                     

                    Thanks!

                     

                    J-M

                    • 7. Re: Getting a Weird Error Whenever I Try to Upload
                      MinimalMonk

                      JMR I figured it out myself, those things didn't work for this problem, I had to reformat the SD card and then put a clean image back on,

                      • 8. Re: Getting a Weird Error Whenever I Try to Upload
                        JMR

                        MinimalMonk, I think that this way, you stop the execution of any sketch and it enables you to reload a new one. I did not mention that I am not using a SD Card so far.

                         

                        Thanks!

                         

                        J-M

                        • 9. Re: Getting a Weird Error Whenever I Try to Upload
                          Nandasahu

                          Hello,

                          I am using Intel Galileo GEN 2 board.

                          I use Eclipse Juno with Arduino 1.5.3-Intel1.0.4 and plugin 2.2.

                          Everytime I give a upload sketch compilations gets sucessfuls but  I receive the below message when trying to upload.

                           

                          Starting upload

                          using arduino loader

                           

                           

                          Launching

                          Output:

                          upload failed

                           

                          I want to run the blink program on to the Gen 2 board.  I have checked the IDE path and the board and port selected to be proper.

                          Can anyone suggest on troubleshooting this.?

                          • 10. Re: Getting a Weird Error Whenever I Try to Upload
                            AlbertEdison

                            I also have the same problem with my Intel Edison. I have tried all the things you have posted above and it still does not work.

                            It would be amazing to solve this issue soon...

                             

                            Thank you very much.

                            • 11. Re: Getting a Weird Error Whenever I Try to Upload
                              EthanHunt

                              Hello guys,

                              I am also facing same problem with Edison to upload a code from Arduino platform. So Do anyone have exact solution? I have tried above described all the ways, but can't get success.

                              • 12. Re: Getting a Weird Error Whenever I Try to Upload
                                JasonZ

                                You must use the wrong port. In Windows, you need to use the Intel Edison Virtual Com Port instead of the the USB Serial Port.

                                2 of 2 people found this helpful
                                • 13. Re: Getting a Weird Error Whenever I Try to Upload
                                  abeckman

                                  I've been getting this message on and off and generally needed to disconnect the USB cables, power down the PC, restart the PC and then plug the cables back in. After that I could download sketches again. Way too much effort since wifi networking is working pretty well. I am able to ssh into the Edison (if you can't, search on enabling ssh for Edison) as root. Probably should create a non-root user to avoid security risks, but this is a proto-board. Found this script on another thread:

                                  #!/bin/sh

                                   

                                  set -e

                                   

                                  HOST=192.168.42.1

                                  SKETCH=/sketch/sketch.elf

                                  OLD_SKETCH=/sketch/sketch.elf.old

                                   

                                  ssh root@$HOST "mv -f $SKETCH $OLD_SKETCH"

                                  scp $2 root@$HOST:$SKETCH

                                  ssh root@$HOST "chmod +x $SKETCH"

                                  ssh root@$HOST "systemctl restart clloader"

                                   

                                  echo "Success"

                                   

                                  Since I have a Windows system, I use WinSCP to copy over the sketch file into /sketch on the Edison and then manually execute the appropriate commands to put the sketch file in the right spot and then restart clloader. The sketch file isn't in an obvious spot, I had to scroll through the compiler output to find it in a temp directory.

                                   

                                  Someone suggested that stopping the running sketch might avoid the original "permission denied" problem in the first place. systemctl stop clloader should do this, but I haven't tested to see if it makes any difference.

                                  • 14. Re: Getting a Weird Error Whenever I Try to Upload
                                    vivekhs

                                    This worked for me.