9 Replies Latest reply on Sep 30, 2015 5:13 PM by CMata_Intel

    Unable to upload sketch to edison

    misperry

      Hey there, I have not played with my intel edison for a while and I see that there is updated arduino software as well as a new image for the device.  I have flashed the latest YOCTO image on the edison, that was a whole bunch of problems getting that to work, and now I cannot upload a sketch to the edison anymore.

       

      I am running windows 10, however, I have tried this on windows 7, which was my original operating system, and it still does not work.  I am getting the message as follows in the arduino upload out put:

       

       

       

      Sketch uses 76,327 bytes (0%) of program storage space. Maximum is 10,000,000 bytes.

      #!/bin/sh

      starting download script

       

       

      # clupload script to invoke lsz

      # Copyright (C) 2014 Intel Corporation

      Args to shell: C:\Users\Mitch\AppData\Roaming\Arduino15\packages\Intel\tools\sketchUploader\1.6.2+1.0/x86/bin C:\Users\Mitch\AppData\Local\Temp\build9174222103761648071.tmp/Blink.cpp.elf COM7

      #

      COM PORT 7

      # This library is free software; you can redistribute it and/or

      Converted COM Port COM7 to tty port /dev/ttyS6

      # modify it under the terms of the GNU Lesser General Public

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

      # License as published by the Free Software Foundation; either

      # version 2.1 of the License, or (at your option) any later version.

      #

      # This library is distributed in the hope that it will be useful,

      # but WITHOUT ANY WARRANTY; without even the implied warranty of

      # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU

      # Lesser General Public License for more details.

      #

      # You should have received a copy of the GNU Lesser General Public

      # License along with this library; if not, write to the Free Software

      # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

      #

       

       

      echo "starting download script"

      echo "Args to shell:" $*

       

       

      # 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"

      echo "~sketch downloadEdison" > $tty_port_id

       

       

      Deleting existing sketch on target

      #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

       

      It gets to this point and just hangs.  I have looked at the "/sketch" directory and I don't see anything.  Also I can get to the edison via taraterm via the com port it is connected to and everything is fine communication wise.  However, the sketch does not upload.

       

      Any help would be great thanks,

       

      misperry

        • 1. Re: Unable to upload sketch to edison
          ParkerSnook

          Try plugging in both cables and make sure that arduino ide knows you are using the edison. You might also want to try to go back to a previous version and see if that works. I hope this helps!

          • 2. Re: Unable to upload sketch to edison
            misperry

            Hey there, thanks for they reply.  I have tried these two things previously.  I tired plugging in both cables also I noticed that I did not have a powered USB port so I have also connected an external power supply to the board as well.  I also have tired it on arduino version 1.5.3-Intel.1.0.4, which was the original one I used, and this did not work.

             

            I am starting to think I may revert the image of the edison back to the first image available, if it even exists.  Also even when I connect both cables to the device the Phone Flash Tool does not see the edison even though the com port works and I can use taraterm and get into the edison as well as I can open it up like a flash drive on windows as well.  So everything is seeing it but that tool does not.  Also I have checked and ensured the switch is in the proper position for what I am doing and that is not it either.

             

            Any other suggestions are greatly appreciated,

             

            thanks for your time.

             

            misperry

            • 3. Re: Unable to upload sketch to edison
              ParkerSnook

              I had trouble with the new image to. I reverted back to the old image. I think I had to manually do it then reflash the same image with the flash tool. I have a copy of the older image that I can give to you!

              • 4. Re: Unable to upload sketch to edison
                misperry

                Hey there thanks for the info.  I reverted to image 2.0 and still the same it hangs after the $tty_port_id 1>&0 statement

                • 5. Re: Unable to upload sketch to edison
                  misperry

                  bump

                   

                  I need this resolved soon.  I have tried everything.  Could it be somthing to do with java?  Does arduino use java?  I thought that was only an eclipse thing?

                  • 6. Re: Unable to upload sketch to edison
                    Lohith

                    Hi misperry,

                    Yes I think you are missing the java updates. I use a linux machine, but I needed to run a sudo apt-get install default.jre in order to successfully upload the code.

                    Can you run a Java update and retry.

                    regards

                    Lohith

                    • 7. Re: Unable to upload sketch to edison
                      CMata_Intel

                      Hi misperry,

                       

                      Do you have updates in this? Have you been able to use the Arduino IDE with your board?

                       

                      Regards,

                      Charlie

                      • 8. Re: Unable to upload sketch to edison
                        misperry

                        Yes I apologize but what I ended up doing is that I had to create a linux box.  I used the latest version of ubuntu linux.  Then I had to connect the USB to the USB connector closest to the selector switch.  Then choose the ttyACM0 connection.

                         

                        I never was able to get it to work on windows.

                         

                        Now there is a small issue but I am working around it.  When you flash some code to it from the arduino it does not reset properly.  Thus, right before I switch I have to ssh to the edison and issue the following command:  "rm /sketch/* ; systemctl stop clloader ; systemctl start clloader"  Then I upload the code and it will work.

                         

                        Also the sketch does not start when the edison is powered up from no power.  I have heard that it is the new image that is the problem with the startup.  However, I don't need to mess with that right now.  I am just happy I can code it and it will work.

                        • 9. Re: Unable to upload sketch to edison
                          CMata_Intel

                          Hi misperry,

                           

                          I'm glad to know that you are able to use the board.

                          In Windows there could be an issue between the Arduino IDE's you have installed you can also try o change the COM port number you are using with the Device Manager.

                          In Linux, you shouldn't have to be running "rm /sketch/* ; systemctl stop clloader ; systemctl start clloader" everytime, which Arduino IDE version?

                          And yes, there is a known issue related with the sketches after every boot, if you want you can try with this workaround: Run Arduino sketch on boot Workaround

                           

                          Regards,

                          Charlie