1 2 Previous Next 27 Replies Latest reply on May 10, 2014 6:55 AM by mhahn

    clloader in a Linux Base Image (clanton-full) build not working?

    Liam

      Hi there

       

      struggling to make the Arduino IDE on Linux play nice with a galileo running a rebuilt LSB image, "clanton-full" build.

       

      I have rebuilt the cross compiler tools, can build eglibc Arduino sketches on Linux, and these work fine, if you manually copy them to the /sketch directory on the SD card and reboot the board.

       

      I would like to get the IDE talking to the board, though.

       

      It seems like my problem is to do with clloader: this is running (it's built as part of clanton-full) but it does not appear to be working.

      Or else I don't know how to use it. Or, possibly, both.

       

      I have found the script which is used for downloading sketches to the Galileo in hardware/arduino/x86/tools/izmir so I can see the command being run.

       

      If I manually run a command using "lsz" on my Linux workstation after rebooting the Galileo, e.g

      $lsz --escape --zmodem --command "touch /sketch/fred.txt" --verbose < /dev/ttyACM0 > /dev/ttyACM0

      this will work. But just once.

       

      No subsequent command is accepted by the Galileo.

      /var/log/messages shows the first command will be accepted.

      The second or subsequent commands all fail (timeout on the sending side) and in  /var/log/messages on the Galileo I just get "no.name/ZMODEM: got error"

       

      If I manually go onto the Galileo and kill the clloader process and allow it to respawn, then the next command will work. This is not much use for the IDE, though, since the IDE runs several commands in the loader script, and only one of those will work ...

       

      Furthermore, just for my information: where does the clloader program want to put sketches which it accepts (before the attempt to rename these)? If I kill the clloader task so that it respawns, and try to send a sketch to it using lsz, I get an error  "Retry 0: timeout of pathname"

       

      So it seems to me like the clloader is just broken.

      Had anybody made this work from a clanton-full build, or have any idea what I am doing wrong?

       

      Thx

      Liam

        • 1. Re: clloader in a Linux Base Image (clanton-full) build not working?
          Liam

          BTW, this was all done based on the 0.7.5 version.

           

          Is there any reasonable probability that moving to 1.0.0 will fix anything?

          Is the Arduino IDE release compatible with the 1.0.0 version, assuming that I rebuild the cross compiler toolchain for it using yocto?

          • 2. Re: clloader in a Linux Base Image (clanton-full) build not working?
            Liam

            This is still not working, and it is very frustrating.

             

            I have uploaded to 1.0.0 (SPI) and rebuilt an eglibc version of the image-full-galileo target to fix opencv.

            The above problem remains ... however it is only a problem when using the Arduino IDE from a Linux host.

             

            From a Windows host, communication over serial/zmodem between the IDE and the Galileo work fine.

            The problem is that you have to use the rebuilt cross-compiler toolchain to make sketches for eglibc ...and I only know how to rebuild the cross compiler toolchain for Linux. It would be massively hacky to make the Windows IDE download sketches built by the Linus toolchain.

             

            I have spent many hours experimenting with this and the fact that the Arduino IDE for Linux just won't talk to the Galileo properly at all strikes me as very odd: surely I am not the first person to try to build Arduino sketches for eglibc Linux and try to download them from Linux??

            • 3. Re: clloader in a Linux Base Image (clanton-full) build not working?
              AlexT_Intel

              Actually, you aren't the first one, but generally it's a common consensus right now that on eglibc-based image the sketch functionality is broken :-) No one actually dug too deep into the actual reasons. Lack of the toolchain is one and clloader glitches is another one everyone faces right away. There were also reports of functionality related to i2c driver being glitchy too on eglibc image.

               

              So looks like this threads my question I asked you in another thread - so the problem you face is on the eglibc-based image, not the uclibc-based one, which is consistent with what I know.

               

              Was that OpenCV Python module the only reason for you to go to eglibc-based image? If so I guess it may be easier for you to just try to fix it, maybe using the uclibc-based image with devtools included (and sketch functionality preserved, because it's uclibc-based), than trying to recompile the whole toolchain for IDE, then fix those quirks with sketch uploading and other smaller ones reported so far. Unless playing with all that is your goal, of course.

               

              EDIT: Elaborated on specific glitches I know of.

              • 4. Re: clloader in a Linux Base Image (clanton-full) build not working?
                Liam

                Thanks Alex

                 

                yep, it was just the opencv issue that prompted me to rebuilt it with eglibc. I want to get some kids playing with some webcams, in python, but interfaces to some Arduino sketches. They are a bit familiar with python and arduino but not with writing code in C/C++, not yet.

                 

                perhaps I will have a go at rebuilding opencv that on the galileo/devtools version to see if it will fix it. However I have seen somewhere that uclibc is part of the problem there ...

                 

                Another idea I was toying with was just rewriting the clupload_linux script to use ssh, and use SIGHUP to see if it will make clloader pay attention to the sketch. I did have a brief look at the clloader code and that seems to be a possible route, need to look a bit harder. Not quite as convenient as using a serial port. But workable, sorta.

                 

                Thanks for the feedback. I will let you know how I get on.

                • 5. Re: clloader in a Linux Base Image (clanton-full) build not working?
                  AlexT_Intel

                  Thanks for clarifying.

                   

                  Yeah, that approach may work, please post your results/findings here, I'm pretty sure that will be interesting for the community.

                   

                  • 6. Re: clloader in a Linux Base Image (clanton-full) build not working?
                    Liam

                    I will do.

                     

                    Some interesting results this evening so far: I rebuilt a uclibc image based on 1.0.0 and including dev tools, so that (hopefully) I can build opencv on the galileo itself. Currently I am building cmake on the galileo as a prerequisite.

                     

                    While waiting for that to cook I did some experiments with the Arduino IDE on Linux vs Windows on the uclibc image.

                     

                    And who'd a thunk it: the Linux Arduino IDE doesn't work with the uclibc based image either.

                    lsz doesn't work the slightest bit. The first command works, the second/subsequent does not. I

                    So this is not an eglibc issue, at all. The Arduino IDE on Linux (64 bits version) just doesn't work. I guess nobody ever tried it. I guess I never did, since the Windows one is more convenient for my usecase.

                     

                    If the rebuild of opencv on the galileo itself either does not run to completion, or does not work, I will revert to the eglibc based 1.0.0 image, and rewrite the clloader_linux.sh script to use ssh. A test from the command line suggests that kicking clloader in various ways will either kill a running sketch, or cause cllloader to startup one you have pre-placed on /sketch. So there is a reasonable chance that will work.

                     

                    Building cmake is taking a very, very long time.

                     

                    There isn't a newer (even unofficial) release of the Arduino IDE as well, is there? I can only find the 1.5.3 one.

                    • 7. Re: clloader in a Linux Base Image (clanton-full) build not working?
                      AlexT_Intel

                      That's strange it doesn't work with uclibc one, I'm pretty sure if they list it as supported, it was tested. I haven't personally used it to confirm or disprove, but I saw posts in the community where people were using IDE on Linux.

                      • 8. Re: clloader in a Linux Base Image (clanton-full) build not working?
                        manoelramon

                        Please did you try to remove the modemmanager ?

                         

                        sudo apt-get remove modemmanager

                         

                         

                        • 9. Re: clloader in a Linux Base Image (clanton-full) build not working?
                          Liam

                          I did.

                          It doesn't make any difference: still does not work.

                           

                          However I don't care any more as I just worked around it using SSH for all communication.

                          That works fine.

                          • 10. Re: clloader in a Linux Base Image (clanton-full) build not working?
                            manoelramon

                            Liam

                             

                               After you remove the package restart the machine. I tested here using 64 bits ubuntu 12.04 that had the same issue and it is ok now.

                             

                            For all other users interested in solve this issue:

                             

                              If you remove the modemmanager package and still have issue please reply on this thread. But make sure you restart your machine after remove the package.

                             

                            Regards,

                            Manoel

                            • 11. Re: clloader in a Linux Base Image (clanton-full) build not working?
                              Liam

                              Running Ubuntu 12.04 LTS 64bits in a VM.

                              It mostly definitely does not have modemmanager installed, and it most definitely does not talk properly over USB to the Galileo.

                               

                              As I reported on my investigations earlier, the observed problem is that only the first LSZ command works. No subsequent LSZ commands work. But I temporarily gave up caring since I just use SSH and SCP now. That works fine.

                              • 12. Re: clloader in a Linux Base Image (clanton-full) build not working?
                                manoelramon

                                Hi Liam

                                 

                                   My configuration is ubuntu 12.04.04 amd 64 in a VM with Windows 7 as a host.

                                 

                                   My distro cames with modemmanager. I have another machine here with ubuntu and we were not able to reproduce the issue. However, we will run in other machines today and let's see if we can catch the bug.

                                 

                                Regards

                                Manoel

                                • 13. Re: clloader in a Linux Base Image (clanton-full) build not working?
                                  mhahn

                                  Hi Liam,

                                   

                                  I understand you are using ssh/scp now so you don't really care any longer. Still wanted to comment on Arduino IDE eglibc toolchain on Windows. Maybe still of interest for someone.

                                  Below steps scripples on howto build the toolchain for current Yocto 1.5 development version meta-intel-iot-devkit - Intel IoT Developer Kit metadata using eglibc. Haven't tested on clanton-full but I assume it should work similarly.

                                   

                                  In order to build the sysroot cross toolchain for Windows on Linux:

                                   

                                  • git clone git://git.yoctoproject.org/meta-mingw
                                  • add meta-mingw.bb in your bblayers.conf
                                  • set SDKMACHINE ?= "x86_64-mingw32" in your local.conf
                                  • ln -s meta-mingw/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers mingw-w64-headers
                                  • apply the patch below to meta-mingw
                                  • bitbake -c populate_sdk iot-devkit-prof-dev-image
                                  • you can now redirect the toolchain to your newly created one in Intel_Galileo_Arduino_SW_1.5.3_on_Windows_v0.7.5\arduino-1.5.3\hardware\arduino\x86\platform.win.txt

                                   

                                  So far works fine for me

                                  Regards,

                                  Matthias

                                   

                                   

                                  [PATCH] fix for meta-environment

                                   

                                   

                                  ---

                                  .../packagegroups/packagegroup-cross-canadian.bbappend      | 13 ++++++++++++-

                                  1 file changed, 12 insertions(+), 1 deletion(-)

                                   

                                   

                                  diff --git a/recipes-core/packagegroups/packagegroup-cross-canadian.bbappend b/recipes-core/packagegroups/packagegroup-cross-canadian.bbappend

                                  index 4f52762..99759fc 100644

                                  --- a/recipes-core/packagegroups/packagegroup-cross-canadian.bbappend

                                  +++ b/recipes-core/packagegroups/packagegroup-cross-canadian.bbappend

                                  @@ -1,5 +1,16 @@

                                  +addtask print

                                  +do_print() {

                                  +       bbnote "TRANSLATED_TARGET_ARCH: ${TRANSLATED_TARGET_ARCH}"

                                  +       bbnote "MACHINE: ${MACHINE}"

                                  +}

                                  +

                                  +

                                  RDEPENDS_${PN}_sdkmingw32 = "\

                                       binutils-cross-canadian-${TRANSLATED_TARGET_ARCH} \

                                       gcc-cross-canadian-${TRANSLATED_TARGET_ARCH} \

                                  -    meta-environment-${TRANSLATED_TARGET_ARCH} \

                                  +    meta-environment-${MACHINE} \

                                       "

                                  +EXPORT_FUNCTIONS do_print

                                  +

                                  +

                                  +

                                  --

                                  1.9.0

                                  1 of 1 people found this helpful
                                  • 14. Re: clloader in a Linux Base Image (clanton-full) build not working?
                                    Liam

                                    Oh that's very interesting

                                     

                                    I have a yocto build env on an Amazon EC2 instance, I will spin it up and try this out later on.

                                    It is based on the 1.0.0 release, but I would be very happy indeed if this would allow a Windows IDE to talk to the Galileo board: it would make it a lot easier for the kids to use as most of them have Windows-only systems.

                                     

                                    Thanks, and I will report back if it works for me.

                                    1 2 Previous Next