3 Replies Latest reply on May 9, 2014 3:00 PM by Liam

    Partial solution for Arduino w/eglibc-based Galileo image

    Liam

      Hi

       

      A while ago I built an eglibc-based SD card image (image-full) based on the 1.0.0 BSP release in an attempt to have both opencv and Arduino sketches working at the same time. This proved to be an exercise in frustration since:

       

      - opencv does not work in uclibc based images, only in eglibc images

      - you need to rebuild the cross-compiler toolchain so the Arduino IDE will build sketches to run on an eglibc board

      - currently we (well I) only know how to rebuild the cross-compiler toolchain for Linux, but ...

      ... and Linux Arduino IDE will not talk over the serial port to the clloader process on the board

       

      I spent a long time trying to get around this in various ways. I failed totally to fix the opencv-on-uclibc issue. Nothing I tried worked.

      I also failed more or less totally in getting Linux to talk over serial to the board reliably.

       

      There is some excellent information on these forums on how to get the basic toolchain up and running for eglibc, like:

      [Tutorial] Setting up Arduino IDE for linux images based on eglibc

       

      and

       

      Intel Galileo - Building Linux Image - Malinov Family Web Presence

       

      however once you get this far, you run into the "Linux IDE won't download" issue. This is a pain in the ****, and not very novice-friendly, which is what I want to set this up for.

       

      So instead I decided to go for Plan B: get the IDE to download the compiled sketch using SSH, and run it.

       

      This works fine, up to a point. The script to do it is attached.

      This replaces the standard Linux IDE downloader script which you can find in <yourinstalldir>/hardware/arduino/x86/tools/izmir

       

      Just move the existing clupload_linus.sh aside and drop this one in instead.

       

      You just need to define the environment variable GALILEO_IP before launching the IDE, so that it knows where the Galileo is.

      The script works by killing the Galileo uploader framework, killing any running sketch, deleting any existing sketch from the SD card, copying over the new one, and starting galileo infrastructure up again.

       

      Tested with BSP 1.0.0 and an "image-full-galileo" build from the yocto cross-compiler setup.

       

      It works fine, except for one problem: there is no reliable serial output from the sketch.

      I know that /dev/ttyGS0 works fine, because if I kill the sketch and dump stuff out the serial port, I can receive it fine.

      However with clloader and a sketch running, nothing is printed to the Serial device by a running sketch.

       

      This is annoying, but I expect I will just hack that too to use network comms too eventually, since there is some chance that will work.

       

      So far I have to say that these Galileos have been quite fun, although undoubtedly not in the way that their creators intended.

      They are advertised as being a combination Linux/Arduino system,but they are most assuredly not for beginners. Far too many things don't work.

      However as a platform for learning how to hack yocto builds, or get around various non-working stuff, they're a pretty endless source of entertainment.

       

      Liam