1 2 3 Previous Next 73 Replies Latest reply on Nov 7, 2014 12:26 PM by AlexT_Intel

    Collaborating to develop a "devtools" version of Linux which is Arduino IDE compatable

    Seth Hunter

      Hi Everyone,

       

      I work at Intel Labs in a group called Open Design which has been developing tools for new creators and makers on the Galileo. As a person familiar with tools like NodeJS, Python, and Arduino -- but not familiar with the embedded Linux development process, I spent some time surfing around the forum and chatting with Sergey (who got the ball rolling for a full version of the LSB) and Alex (developers who use Galileo on their own time and have a deeper understanding of Embedded Linux) on the phone about getting an unofficial full build of Linux that we could use in our group for educational purposes.

       

      It turns out understanding how to develop a useful build for people who are not Linux experts (like me) is not a trivial task and the efforts to create a Linux build that responds to the needs of this community and new developer communities have not been unified. To help explain this for people new to Galileo Dimitri Diakopoloulos has written a blog post called Navigating Linux on Galileo that outlines all the Linux versions that this community has been working on, the official full build, the Yocto, Poky, BSP build process, and some of the builds people have been posting on their blogs. So far this is the most comprehensive explanation I've seen out there.

       

      Alex has been kind enough to collaborate with us over the last two weeks to incorporate the recipes he posted on his github site, increase the size of the SD card build to 2GB, and begin to add tools from my wish list (which I will include in a reply to this post later).

       

      Here is the build Alex has posted on a VM I maintain with plenty of bandwidth: Download and Unzip it to your SD card.

       

      In Alex's words the build includes:

      - development tools (gcc, autotools set, and so on - everything Yocto's "tools-sdk" image feature implies, which is theoretically everything one should need to compile stuff);

      - avahi-daemon;

      - working sketch support (something other images don't have together with having dev tools enabled. I haven't yet tested that in full, but the daemons are there and behave normally, so it should work);

      - git (which is not included into "tools-sdk");

      - filesystem image size increased to 2GB;

       

      in addition to the previously included

      - NTP;

      - USB sound kernel config;

      - GSPCA PAC207 webcam support;

      - motion;

      - node.js 0.10.25;

       

      I haven't yet found the exact reason "pkgs-dev" image feature breaks the i2c and port expander, but let's see how your and my testing goes - it may be the case we don't really need all the *-dev packages at once for real life usages. Basic ones like uclibc-dev are installed already and other packages for specific needs (like opencv-dev) may be installed from the package repo - as simple as that.

          

       

      Our hope is that people here can help us test and can post their wish list of tools that would be useful and features from the unofficial build might make their way into the official build as they find utility in the community - and that in doing so the build won't break the Arduino compatibility that is so useful to people familiar with the Arduino platform. (such as myself).

       

      We have invited folks from design schools, electronics companies, hacker spaces, and creative technologists to download the build and provide feedback and our email threads are getting way to long - so I thought it would be useful to move the discussion to this forum and see if we can all collaborate and discuss. Right now Alex_T is the primary developer but if other folks here who are familiar with the build process can contribute their thoughts I'm excited to see what we can come up with.

        • 1. Re: Collaborating to develop a fully loaded version of Linux which is Arduino IDE Compatable
          rmm200

          You are sort of approaching this from the wrong end...

          Give us a modified Arduino 1.54 that incorporates all the fixes submitted to the 1.54 tree LAST YEAR and produces object code using eglibc. That will be compatible with all the full linuxes floating around.

          And while Alex gets full credit for packaging a generally useful version - don't ever forget to give credit to Sergey for getting the ball rolling. It was his modified recipes that brought in a full tool chain.

          • 2. Re: Collaborating to develop a fully loaded version of Linux which is Arduino IDE Compatable
            shadowrecon

            I just wish they had some better tools pre-compiled, not much to ask. How many people on here had to learn how to compile a Linux image just to use make and other tools that traditionally come in a Linux package. Or atleast provide another method of installing packages.

             

            I would like to see the ability to compile "C" and run it. Ive seen everyone talk about it but have not seen it done. the GCC package would be nice.

            • 3. Re: Collaborating to develop a fully loaded version of Linux which is Arduino IDE Compatable
              rmm200

              That is where Alex's images come in.  His downloadable image for 1.0.0 should have everything you want, even before sethismyfriends's enhancements.

               

              I may have spoken too soon. I reviewed Alex's 1.0.0 announcement, and it looks like a vanilla image-full distribution, without tools.

              If that is correct - you will need to build your own following Sergey's blog, or wait for sethismyfriends.

              • 4. Re: Collaborating to develop a fully loaded version of Linux which is Arduino IDE Compatable
                Seth Hunter

                When I spoke to Alex about a version of the IDE that is gcc compatible he mentioned that the reason that uClibc was used in the original Arduino IDE was because they were optimizing it for the built in memory on the board. I agree that a gcc version of the IDE for people using the SD card really important - and would prefer that solution long term.

                 

                My hope is that by having this discussion on the forum, we can help guide the group that is developing the IDE and the next version of Linux for Galileo to be loaded with drivers and well tested for tinkerers and hobbyists. I have a background in design/programming and am new to embedded linux development and so bring that perspective to this build.

                • 5. Re: Collaborating to develop a fully loaded version of Linux which is Arduino IDE Compatable
                  AlexT_Intel

                  > It was his modified recipes that brought in a full tool chain.

                  Sergey gets a full credit for that, but in this image I haven't been following his path and implemented that differently, one of the main end-user differences being preservation of uclibc and therefore sketches working. So now you can have the normal gcc-based toolchain + sketches, not one or the other.

                   

                  Let me call the image Seth has announced a "devtools" one, to make it easier to distinguish it from the "vanilla" ones, I'm posting on http://alextgalileo.altervista.org. Vanilla ones are just that, the same as the 0.7.5 SD card image distributed initially - default set of everything you get by compiling a BSP.

                   

                  The devtools image is currently based on BSP 0.7.5 (to make it easier to use, for 1.0.0 you'd need to update the firmware first and there's no official 1.0.0 firmware package for IDE-based update) + it has the standard Linux toolchain of gcc, autotools and so on + a set of additional packages and enhancements, as listed by Seth in the initial post.

                   

                  As soon as there's a 1.0.0 firmware update package for IDE (so that anyone can easily update their board not resorting to serial cable), we'll be able to easily rebase the image to 1.0.0.

                   

                  The idea is to have an image, which could be used both for "Linux-like" as well as "Arduino-like" development, which allows you to compile additional software directly on Galileo without resorting to cross toolchain and which contains additional packages making board usage and tinkering with easier and more user-friendly. That's why we're interested in your feedback as to the tools and features you want to see in the image.

                   

                  EDIT: Oh, and for those who want to build such an image by yourself - the recipes are in the "devtools_and_packages" branch in the http://github.com/alext-mkrs/meta-alext-galileo repo. Unlike the "master" branch where you need to enable specific recipes you're interested in, that one has all the recipes I've included into the devtools image enabled right away. Don't forget to add the meta-oe/meta-networking layer into your bblayers.conf, otherwise NTP won't build.

                  • 6. Re: Collaborating to develop a fully loaded version of Linux which is Arduino IDE Compatable
                    Seth Hunter

                    Thanks Alex - I update the title of the post to reflect that it is a "devtools" image. I updated my wishlist to reflect all the work you have already done on the devtools build, and provide more context. Anyone else been thinking about their ideal build?

                     

                    Wishlist (for myself but also thinking of others)
                    Opkg  (I think the package manager might already be included, need to check & test)
                    updated version of npm for nodejs package magament

                    Hostapd: for creating an access point - http://w1.fi/hostapd/

                    Udhcpd: lightweight DHCP Server
                    Libwebsockets: http://libwebsockets.org/

                    USB wifi support (realtek) http://www.adafruit.com/products/814

                     

                    Longshots: (maybe someday when I get the hang of this)
                    Fix openCV python bindings (have no idea how to do this but have ready about it in the forum)
                    Chuck:  official site which lists all the dependencies forum post on raspberry pi install and another where a guy built from source for rasberri pi  --
                    (this is my favorite sound programming environment)

                    • 8. Re: Collaborating to develop a fully loaded version of Linux which is Arduino IDE Compatable
                      rmm200

                      Seth I would phrase it a little differently. Ulibc is used in the firmware version of Linux because Linux using eglibc would not fit.

                      The Arduino IDE uses ulibc for compatibility with the firmware, space constrained version of Linux.

                       

                      Now it gets contentious - the lack of persistent sketches alone makes the firmware version most useful as a way to get to an SD version. Anyone really using sketches wants persistence. And the most useful SD Linux versions will be built on eglibc.

                       

                      We need an Arduino IDE that has compatibility with eglibc Linux. Fine with me if it also has an option to pump out ulibc code, based on an IDE option. But the IDE really needs to support a full Linux.

                      • 9. Re: Collaborating to develop a fully loaded version of Linux which is Arduino IDE Compatable
                        Seth Hunter

                        Thanks for explaining this in more detail. I think this is a critical change that should be addressed as well - I'm going to ask around at Intel to see what I can learn about future plans.

                        • 10. Re: Collaborating to develop a "devtools" version of Linux which is Arduino IDE compatable
                          Seth Hunter

                          Also here is the link to the current build (in case it wasn't obvious earlier): http://telekinect.media.mit.edu/galileo/image-0.7.5-2.tar.bz2  - hoping to get feedback on this thread.

                          • 11. Re: Collaborating to develop a fully loaded version of Linux which is Arduino IDE Compatable
                            AlexT_Intel

                            rmm200

                            And the most useful SD Linux versions will be built on eglibc

                            Could you please elaborate on why do you think so? I'm asking to understand you better. Uclibc project aims to be source-compatible with [e]glibc and theoretically there's no difference whether you use one or the other. In practice, there of course is, but these should be relatively specific cases to call this a general rule.

                            • 12. Re: Collaborating to develop a fully loaded version of Linux which is Arduino IDE Compatable
                              rmm200

                              You are asking me to justify my unreasoning personal prejudices with facts...

                               

                              Actually, my complaint is about eglibc too, since it is now obsolete and replaced with mainstream glibc. Not sure about how to go about incorporating that though.

                               

                              Best web comparison I have found of ulibc and eglibc is:

                              Comparison of C/POSIX standard library implementations for Linux

                               

                              We have already had one gentleman report precision problems, which I think are due to ulibc.

                               

                              Using eglibc on Galileo, this program:

                               

                              #include <iostream>

                              #include <stdlib.h>

                              #include <limits>

                               

                              using namespace std;

                               

                              int main(int argc, char * argv[])

                              {

                              float a = 1.23456789012345;

                              double b = 1.23456789012345;

                              long double c = 1.23456789012345L;

                               

                              cout << "Float: " << std::numeric_limits<float>::digits10 << endl;

                              cout << "Double: " << std::numeric_limits<double>::digits10 << endl;

                              cout << "Long Double: " << std::numeric_limits<long double>::digits10 << endl;

                               

                              cout.precision(19);

                              cout << "A = " << a << ", B = " << b << ", c = " << c << endl;

                              }

                               

                              produces output when run::

                               

                              Float: 6

                              Double: 15

                              Long Double: 18

                               

                              A = 1.234567880630493164, B = 1.234567890123450029, c = 1.23456789012345

                               

                              I don't think that will happen on a ulibc image, and I am concerned that 80287 support will not work

                              with ulibc.

                               

                              I may be all wet - it would not be the first time.

                               

                              Added:

                               

                              I am getting somewhat sick of looking at generated  assembler code - but I did verify:

                              g++ -mfpmath=387 -ffast-math precision.cpp pumps out 80387 code. That is a win - and not easy to determine.

                              • 13. Re: Collaborating to develop a "devtools" version of Linux which is Arduino IDE compatable
                                tinkerer8473

                                Hi, I am new here and want to use the Galileo if possible. I am glad Intel is interested in the user experience.

                                 

                                I would like to use a real Linux distribution on the Galileo. I don't want an embedded Linux like those used in routers and small appliances. I would actually like to have Debian like some more people on this forum and would think the Galileo should really support any distribution built to run on a Pentium which for Debian is the standard 32 bit port. I would like to be able to use the most recent kernels with all of the drivers available. This could maybe fit into a 3GB file except why not allow a full 32GB linux file system on my 32GB sdcard? That should also be faster than running inside a loop mounted file system.

                                 

                                What I want to do is run an Xserver inside the Galileo. I would probably use XTerm most of the time. I have done this on many computers and there are Xservers or VPN clients available for Windows, Macs and of course Linux. I don't really need the Arduino IDE for my wanted projects and would be happy using the sysfs to control relays and motors and read sensors. I would just need a 'makefile' if I did choose to someday run 'sketches'. I would do all of my development on the Galileo with this plan. This is not for everybody.

                                 

                                I understand Intel would like to have a more polished product and with more Arduino IDE style. So maybe Intel would consider developing a Galileo IDE program that would run on the Galileo and would appear in a window like an Xserver client on the programmer's Windows, Mac or Linux machine. This Galileo IDE could be included with an Intel authorized sdcard distribution or custorm built from source for any other distribution the user wants to use on the Galileo. I think this would be attractive for Intel because the Galileo IDE would only need to work directly on the Galileo instead of whatever machine a programmer has connected to a Galileo.

                                 

                                This concept would depend on whether the standard Linux kernel can run on the Galileo without custom Intel patches and still control all of the Arduino hardware. There is already GPIO, I2C, SPI and lots more built into the Linux kernel so if that isn't enough then maybe the needed patches could be submitted to Linus. This is the part I am unclear about.

                                 

                                There is my tuppence. Good luck with the final improvements.

                                • 14. Re: Collaborating to develop a "devtools" version of Linux which is Arduino IDE compatable
                                  NicoV_Intel

                                  Hi all,

                                   

                                  It is a really good thing to improve the quality of the Linux image.

                                   

                                  I'm working with universities in Europe and the issue that is always raised, is the non compatibility of Arduino sketches using AVR assembly language (which is quite expected ). By now, our advice to them is to use Linux fs and mmap.

                                  However, they have to port their code. Do you think adding an AVR emulator to the Linux image would be interesting?

                                  I was thinking about simavr: https://gitorious.org/simavr

                                   

                                  Btw, if you need Java SE (Embedded), it works well on Galileo (our partners asked us if it was possible, and it is).

                                  1 2 3 Previous Next