10 Replies Latest reply on Apr 6, 2015 10:23 PM by MarkHaysHarris777

    Is this normal for arduino IDE?


      Having recently solved a load of my issues with the Intel-Arduino IDE, I have finally got round to uploading a sketch to the edison.


      I am starting with blink to make sure it uploads fine, and it seems to be working as far as I can tell, except it appears stuck at a certain point.


      To set the scene, I'm using windows 8, I have the edison mounted on the sparkfun base block with mounting hardware (so it should be securely connected), both USB's are plugged in and the sparkfun block doesn't have the SW1 switch so that is irrelavant in this case (I hope anyway!).


      So far, in the error message screen, it says this:


      Sketch uses 76,207 bytes (0%) of program storage space. Maximum is 10,000,000 bytes.
      starting download script
      # clupload script to invoke lsz 
      Args to shell: C:\Intel\arduino-1.6.0+Intel\hardware\tools\x86\bin C:\Users\Invate\AppData\Local\Temp\build3120648002828882030.tmp/Blink.cpp.elf COM5
      # Copyright (C) 2014 Intel Corporation
      COM PORT 5
      Converted COM Port COM5 to tty port /dev/ttyS4
      # This library is free software; you can redistribute it and/or
      Sending Command String to move to download if not already in download mode
      # modify it under the terms of the GNU Lesser General Public
      # 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
      # 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 /
      #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
      echo "COM PORT" $com_port_id
      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


      I'm assuming this is normal so far, reading it through, this all sounds like the process of compiling and uploading the sketch. However, on several attempts at doing this, this is as far as it gets. It is currently there aswell, and has been for about 20 minutes.


      Thanks in advance for any insight.



        • 1. Re: Is this normal for arduino IDE?

          Hi Iron_Attorney,


          The log looks normal, sometimes it takes a few moments to upload the sketch. Just make sure you are selecting the right board and COM port. Another thing you can try, if the IDE cannot upload the sketch, is to manually delete the file /sketch/sketch.elf in the Linux side so the IDE does not have to rename and delete the old file. I hope this helps.



          1 of 1 people found this helpful
          • 2. Re: Is this normal for arduino IDE?

            Thank you, it does! My next question was also going to be about what the sketch will be called. I don't think it has a sketch on it yet. I think the board and COM port are correct, but I'll double check and try that again later.


            After posting my original message, i left it uploading a good 20 minutes longer, and it was still stuck at the same point.

            • 3. Re: Is this normal for arduino IDE?

              I at times ran into these issues as well.  Sometimes a reboot of the computer helped.  Other times unplugging USB and replugging back in helped.  Other times doing as JPMontero mentioned helped.  Also like he said make sure you have the right Comm port selected.  You should have at least two that show up, try the other one.


              I also found my LInux box (ubuntu 64 bit) usually had more luck.  Later I hacked up my Windows install to use Wifi instead of comm, which worked a lot nicer for me.  Some details about this are in the thread: Is there way to setup Arduino download to do it using wifi? 

              However warning, using the Wifi was still somewhat of a pain as you had to hack into the script with the Edison IP address (and password) and if the IP changed, you had to discover it again edit the script...  Likewise if you are like me and have more than one, you had to edit it each time you wanted to work on different board. 


              Note: this was done with the 1.5.3... Arduino build, I have not tried yet with the newer 1.6.0 Arduino build.  I might at some point soon.  So far the only thing I have done since I installed the newer version was to see if any of my proposed Arduino updates (Board define for Mini breakout, speedups for pinMode, ...) were adopted.  At first glance it looks like none of them were.  Have not decided yet what I will do next.  Current feeling is to punt and when doing stuff on Edison go native and/or Eclipse.

              • 4. Re: Is this normal for arduino IDE?

                well i'll be damned! It looks as if it was just the com port. I switched to the other com port (intel edison virtual com port) and it appears to have worked! As i'm using sparkfun blocks, i'll have to connect up an LED in a sec to check it, but the IDE seems to think it's transfered.


                The only thing that troubles me is that I can't see any evidence of the sketch in the edison drive. Should it show up there? If not, I pressume I have to use putty or something similar to look for it. In which case, how?


                Thanks again to you both, I'll report back once I've hooked up the LED and seen for sure that it's worked.

                • 5. Re: Is this normal for arduino IDE?

                  Ok yep! It uploaded just fine, that's both eclipse and arduino up and running.


                  Thank you all!

                  • 6. Re: Is this normal for arduino IDE?

                    hi... the 'sketch' is uploaded to a directory in the yocto linux filesystem called  /sketch/




                    I have several sketches in my directory:   blink.cpp.elf,  better-blinker.cpp.elf, etc


                    You can point to the one you want to run with a symbolic link (from an ssh terminal on the edison side):


                    ln -sf blink.cpp.elf  sketch.elf


                    Now all you need to to is to restart the clloader on the edison with:


                    as root:   systemctl restart clloader


                    You can also move your sketches to the edison with scp from your computer like this:


                    scp blinker.cpp.elf root@<ip-address>:/sketch/


                    You can also rename the file from remote with ssh, send the symbolic link, and restart clloader, all from remote if you want to.





                    • 7. Re: Is this normal for arduino IDE?

                      So how do I look in the yocto filesystem? It doesn't appear in the edison drive, so do I have to access that through serial via putty?


                      I'm not familiar with yocto commands yet. If somebody has any decent links to som resources that tell you basic commands like how to see what files are in a directory and how to change directory, that would be awesome!


                      Cheers marcus!



                      • 8. Re: Is this normal for arduino IDE?

                        There are a few logical partitions that are created on the edison.  Only one of them is typically visible as a drive that shows up under windows, when you plug the USB in.


                        There are a Variety of ways to see and manipulate what is on your Edison.  One is Putty.  You have a default Comm port setup when you are plugged in to the USB port (the other one than the one you use to program it).  Likewise I normally have my Edison set up with a wifi address, in which case I use a wifi setup with putty.  As for commands, google linux command line for dummies or the like and you will see lots of hits.  My network is not working (much) right now, so hard to get links.

                        Some of the common commands:

                        ls (lists files)

                        cd (change directory)

                        pwd (print working directory)

                        cp (copy file(s))

                        rm (Remove files)

                        mv (Move file - used also to rename)

                        man (manual - a way to see complete help about a command)

                        Most of these commands have a help to show you the syntax, sometimes it is simply -h  other times -help or --help  likewise man command which gives you complete documentation


                        I also use WinSCP to move files back and forth from my PC to Edison (and other linux boards)


                        Good Luck


                        1 of 1 people found this helpful
                        • 9. Re: Is this normal for arduino IDE?

                          Cheers very much! So the basic linux commands are the same whatever linux you are using then. I was searching "edison yocto commands" or something of that sort. I'll have a look at WinSCP aswell.



                          • 10. Re: Is this normal for arduino IDE?

                            hi Pete,  yes, yocto gnu/linux is a fully embedded linux system the size of a postage stamp... mine is an http server, a print server, and a development station;  that is, I log into it with a VT102 terminal over ssh (secure shell) and program on it... right there on the Edison!  It has all the development tools like the gcc compiler, python2, automake, libtool, ncurses5dev, and many others... 


                            In fact, tonight I downloaded the sources from github for  'htop'  a 'top' command on steroids.  htop is used to view and manage system resources like processes and threads for both users and root. Anyway, htop is WAY more useful than regular top... to make a longer story shorter, I built 'htop' from sources ON the Edison without so much as a 'warning' from the compiler, linker, nor tools... it just flew, and it just worked.  I'm impressed.


                            Once you get into your Edison you're going to discover an entire new world (new definition) of what it means to have an embedded gnu/linux system running whatever you decide to make!


                            Enjoy,   if you have questions don't hesitate to ask.





                            1 of 1 people found this helpful