12 Replies Latest reply on May 28, 2015 5:36 PM by mbox

    Can not upload arduino sketch

    mbox

      Hi everybody, I'm new to intel edison but very excited to learn from it.  Does anyone have bought edison blocks from Sparkfun? I have the following blocks from them.

      1. base block

      2. Uart block

      3. arduino block

      With the base block I was able to flash the latest image to the edison and configure the wifi connection to my router.

      Now my question is how do I program the arduino (using the arduino block) with the edison? BTW I download the Arduino IDE for edison and do the steps..

      1. Select Intel Edison virtual com port

      2. Select board the Edison

      but when uploading I have the following errors

      //------------------------------------------------------------------------------------------------------

      starting download script

      #!/bin/sh

       

      # clupload script to invoke lsz

      # Copyright (C) 2014 Intel Corporation

      #

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

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

      Args to shell: C:\Intel\arduino-1.6.0+Intel\hardware\tools\x86\bin C:\Users\Microbox\AppData\Local\Temp\build8447918566788810079.tmp/Blink.cpp.elf COM235

      # License as published by the Free Software Foundation; either

      COM PORT 235

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

      #

      Converted COM Port COM235 to tty port /dev/ttyS234

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

      #

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

      # 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

      Deleting existing sketch on target

      # 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

      C:\Intel\arduino-1.6.0+Intel/hardware/intel/i686/tools/izmir/clupload_win.sh: line 42: /dev/ttyS234: Read-only file system

       

       

      #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:\Intel\arduino-1.6.0+Intel/hardware/intel/i686/tools/izmir/clupload_win.sh: line 46: /dev/ttyS234: Read-only file system

      # 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:\Intel\arduino-1.6.0+Intel/hardware/intel/i686/tools/izmir/clupload_win.sh: line 51: /dev/ttyS234: Read-only file system

       

       

      #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 "mv $target_download_name /sketch/sketch.elf; chmod +x /sketch/sketch.elf" <> $tty_port_id 1>&0

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

      C:\Intel\arduino-1.6.0+Intel/hardware/intel/i686/tools/izmir/clupload_win.sh: line 56: /dev/ttyS234: Read-only file system

       

      And can anyone share light on how the programming the Arduino works with the edison, I'm used to do it without it just directly to arduino board.

       

      Thanks in advance

      joe

        • 1. Re: Can not upload arduino sketch
          CMata_Intel

          Hi mbox

           

          Are you able to see the Port COM in the Device Manager? With the Arduino IDE, you must use the "Intel Edison Virtual Com Port" and not the one called "USB Serial Port". Are you using the Virtual port and not the Serial one?

          If you are using the correct port and board in the IDE. One thing we could try is, deleting the files in sketch. (If you have files in that folder)

           

          For doing this you need to open a new session and go to /sketch and then delete the files in there.

          root@edison:~# cd /sketch
          root@edison:/sketch# ls
          
          

           

          If you have something in here, delete them. You may have the files sketch.elf and sketch.elf.old, if you do delete them with:

          root@edison:/sketch# rm sketch.elf sketch.elf.old

           

          Let's check the port and if you still have the same results try deleting the files I suggested.

          Also, try with different cables and different ports in your PC.

           

          Regards;

          CMata

          • 2. Re: Can not upload arduino sketch
            mbox

            Hi CMata_Intel, Thank you for the reply I do appreciate it very much. I tried what you suggested.

            1. I made sure that I'm using the Virtual Com port number in the serial port of the arduino IDE.

            2. Looked in to the sketch folder but found empty files.

            3. I moved my usb cables but they seem not change the port assignment.

            I included images to check if I missing the obvious.

            ToForum.png

            20150526_081557.jpg

            On Top is the Intel edison module, Sparkfun's base block, Uart block and at bottom is the arduino block.

             

            Thanks again for any input,

            mbox

            • 3. Re: Can not upload arduino sketch
              CMata_Intel

              Hi mbox

               

              Are you able to see the Edison board as Device (Unit [D:]) in your PC? If you are not it could be a problem with the image.

              Have you flashed the board before?

              Which image are you using rirght now? If you don't know you can run this line:

              root@edison:~# configure_edison --version
              

               

              Regards

              -CMata

              • 4. Re: Can not upload arduino sketch
                mbox

                Hi Cmata, Edison drive is on  F and the image I have is 146. I tried also to follow tutorials from sparkfun but no luck yet(Edison Getting Started Guide - learn.sparkfun.com).

                As I understand the arduino block should be program with OTG port of the arduino block and using the virtual port to upload the sketch to the edison.

                And can you share the command how to install pyserial into edison?

                 

                Kind regards,

                mbox

                • 5. Re: Can not upload arduino sketch
                  CMata_Intel

                  Hi mbox

                   

                  We can try to change the port number of the Virtual COM, for this you need to:

                  1. Go to the Device Manager

                  2. Right click on the Virtual COM and click on Properties

                  3. Go to Port Settings > Advanced

                  4. Here, you will see the option for changing the COM port number. Try with another one. [Make sure you are selecting one you are not using]

                  5. Click on OK and OK again.

                   

                  Let me know if you get better results with this.

                   

                  Regards;

                  CMata

                  • 6. Re: Can not upload arduino sketch
                    grauwl

                    All the suggestions still look like they're just for loading a sketch onto the Edison SoC... From the looks of Sparkfun's tutorial for the arduino block (https://learn.sparkfun.com/tutorials/sparkfun-blocks-for-intel-edison---arduino-block), it looks like to program the board's arduino you need to use the 6-pin FTDI programming header on the board.

                    • 7. Re: Can not upload arduino sketch
                      mbox

                      Success! ..but unfortunately no blinking after transfer complete no 3.3v detection on pin 13 on the arduino block. I guess that's another story to solve. I'll find out more and post the result.

                      ToForum2.png

                       

                      Kind regards,

                      mbox

                      • 8. Re: Can not upload arduino sketch
                        mbox

                        Hi grauwl,

                        I will try to find a FTDI board to load a program directly and see if the arduino board is good and post later.

                         

                        Thank you and kind regards,

                        mbox

                        • 9. Re: Can not upload arduino sketch
                          grauwl

                          If you loaded the sketch to the Edison via the base block, then you won't see activity on the arduino board LED or it's pin 13. Those pins are connected to the board's arduino, which needs to be programmed via it's own programming header as I mentioned before. You programmed the Edison SoC, so it's blinking it's own "pin 13" (GP40).

                          • 10. Re: Can not upload arduino sketch
                            mbox

                            Hmm I think it's clear for me now...I'm using the wrong Dev board. I should have bought the Intel Edison  Dev board instead of this to follow the online tutorials easier.

                            anyways..I will post later if I have updates.

                             

                            Regards,

                            mbox

                            • 11. Re: Can not upload arduino sketch
                              mbox

                              Thank you grauwl for pointing me out regarding the pins. I have the blinking running .