1 2 Previous Next 25 Replies Latest reply on Aug 9, 2015 2:10 PM by AlexT_Intel

    Reconfiguring Linux kernel and adding drivers into Galileo’s Linux image

    Tor_on_Tour

      Hi everyone,

       

      Im trying to get a mini PCIe Telit HE 910 modem to work with my Galileo gen2.

       

      I've tried to connect the modem to the back of the Galileo (mini PCIe) without any satisfying result.

       

      My plan now is to add the cdc_ether.c driver to the kernel configuration using Yoctos BSP.

      I've checked and seen that the driver gets the modem to work on other systems.

       

      The driver can be found in later versions of the Linux kernel, but all the Galileo images available uses the Linux 3.8.7 kernel where the cdc_ether.c isn't included.

       

      I've chosen to try to add the driver into the Linux image by following AlexT_Intel guide Reconfiguring Linux kernel and adding drivers into Galileo's Linux image
      and Intels own guide

       

      Question: Adding the driver

      I think I've managed to compile everything once (with bitbake etc) without adding the driver.

      The guides are a bit overwhelming (for a newbie like me) and i can't figure out how to include my driver before i compile etc.

       

      Does anyone have any good guides or the energies to give me directions?

       

      Specs:

      Host computer - Ubuntu 12.04

      Modem - He910 Telit mini Pcie

      Board - Galileo gen2

       

      Sorry if i got anything wrong, I'm quite new on the subject but thank you so much in advance for the help

       

      / Tor

        • 1. Re: Reconfiguring Linux kernel and adding drivers into Galileo’s Linux image
          CMata_Intel

          Hi Tor_on_Tour

           

          If you want to add the header I suggest you to use the source for the kernel 3.8.7 Linux/drivers/net/usb/cdc_ether.c - Linux Cross Reference - Free Electrons

           

          Take a look at the Software Developer’s Manual for Linux (Section 7.4). You will see in there all the requirements for make the HE910 work, you will also find a little example of how to send an AT command with the card. Take a look at it and let me know if it helps.

           

           

          Regards,

          Charlie

          • 2. Re: Reconfiguring Linux kernel and adding drivers into Galileo’s Linux image
            Tor_on_Tour

            Hi CMata,

             

            I wasn't precise enough in my original post. Gonna try to be clearer now.

             

            I've already got PPP to work, the thing i wanna do now is get the ethernet driver working with my card.

             

            The 3.8.7 file you suggest doesn't include the telit-code i want.
            Looking into it i see that after kernel release 3.12 it does (3.12 file).

             

            Telits vendor id = 1bc7

             

            cdc_ether.c 3.12

            ----------------------------------------------------------------------------------------------------------------------------------------------

            697   /* Telit modules */

            698   USB_VENDOR_AND_INTERFACE_INFO(0x1bc7, USB_CLASS_COMM,

            699   USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),

            700  .driver_info = (kernel_ulong_t) &wwan_info,

            701 }, {

            702   USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ETHERNET,

            703   USB_CDC_PROTO_NONE),

            704  .driver_info = (unsigned long) &cdc_info,

            705 }, {

            706   USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_MDLM,

            707   USB_CDC_PROTO_NONE),

            708  .driver_info = (unsigned long)&wwan_info,

            ------------------------------------------------------------------------------------------------------------------------------------------------

             

            I realise it's more then just this cdc_ether.c 3.12 file that I need but i figured it could be a good place to start.

             

            So the question remains:

            Anyone have any guides/clues on how to include my driver files before i compile in Yocto?

             

            Thank You Charlie and everyone else for the help

             

            / Tor


             

             


            • 3. Re: Reconfiguring Linux kernel and adding drivers into Galileo’s Linux image
              AlexT_Intel

              Hello Tor,

               

              Looking at this document (first Google hit for "telit he910 linux driver") I see that you actually should be good with a cdc-acm driver and not the cdc-ether one as HE910 is treated as a serial USB device (mPCIe slot has USB in it as well and many cards like cellular modems use only the USB part).

               

              cdc-acm  driver is available in my repo and if you're using anuClibc-based image, you should be able to install it easily. If you use a DevKit image, check their repo (opkg update && opkg list |grep cdc). If they don't have it, it should be fairly easy to compile it (though it will take you some time for setting up a build environment) - there's an article on building the DevKit image, just search the forum.

              • 4. Re: Reconfiguring Linux kernel and adding drivers into Galileo’s Linux image
                xthunderheartx

                AlexT_Intel you mentioned

                AlexT_Intel wrote:


                ... there's an article on building the DevKit image, just search the forum.

                 

                If you are referring to Brendan's blog post here: https://software.intel.com/en-us/blogs/2015/03/04/creating-a-yocto-image-for-the-intel-galileo-board-using-split-layers I wouldn't suggest that.  It's broken as I've pointed out recently in dedicated thread.  The image will boot and mostly work but the user cannot debug from eclipse over gdb.  For some reason the process which scp's the image over breaks ugly and never executes the pre-run commands (chmod +777 /tmp/$file) or starts gdbserver or anything else.  Just hangs.  I've verified this on multiple host Operating Systems, multiple host hardware platforms. It sure would be nice if someone would fix it or at least confirm that I'm wrong. Recommending it's use without verification though is a bad thing in my opinion.

                 

                I could be totally wrong but I don't think so.

                • 5. Re: Reconfiguring Linux kernel and adding drivers into Galileo’s Linux image
                  AlexT_Intel

                  We're a bit off-topic for the thread here but I know Brendan (well, virtually) and I trust his knowledge in the DevKit area, that's why I recommend the article (and yes, I meant that one).

                   

                  Is the inability to connect from Eclipse over GDB protocol the only glitch you've faced after following those instructions? What's that thread you're referring to, I'd be interested in knowing more as I'm thinking about either moving my Galileo repo to DevKit image or adding it alongside the one for uClibc-based images and I was planning to run the build rather soon.

                   

                  arfoll, Brendan, do you think the article is still good enough for building the DevKit image past 1.5 release, or is there any better way you could recommend?

                  • 6. Re: Reconfiguring Linux kernel and adding drivers into Galileo’s Linux image
                    xthunderheartx

                    Image built from IOTDK source won't launch gdbserver properly

                     

                    Oh no, I absolutely trust Brendan too I'm just sayin'.  Brendan's blog post was very easy to follow and the image appears to work fine, but if I can't debug my app (in C/C++) it's a problem for me.  Again I could be totally wrong but I tried it multiple times on both Debian (Wheezy) and Ubuntu (12.04 AND 14,.04) as hosts with the same results.  The Wheezy and Ubuntu images were running in VM's while the (K)Ubuntu 14.04 was host OS on different hardware.  All behaved as detailed in the post referenced above.

                     

                    We want to release our product based on the IOTDK image.  I've been holding off trying to make a custom layer work until somebody answered the post.  Apparently Pablo got sidetracked.  We would like to update a couple things like connman, turn on the fast_cgi module in lighttpd, add our own cgi executable, stop the ttyS1 getty after boot, start syslog etc., all in our own custom layer.  Just waiting to get a good IOTDK build process that we can start with.  That is why I was lurking in the OP's thread hoping for clues.  Would it be more appropriate to take this discussion back to my thread?

                    • 7. Re: Reconfiguring Linux kernel and adding drivers into Galileo’s Linux image
                      AlexT_Intel

                      I see, well, yeah, if this is the only thing then for objectivity's sake I wouldn't call it "broken" Yes, let's continue in your thread, I'm curious if that's indeed something broken in the build process or just an unrelated bug. I'll setup a build environment for that and post back when I have something meaningful - that may take me a week or so due to other stuff, I have to admit right away.

                      • 8. Re: Reconfiguring Linux kernel and adding drivers into Galileo’s Linux image
                        xthunderheartx

                        Kool. I would appreciate someone at least verifying whether or not I'm in the weeds.  Thanks so much for any help you can provide.

                         

                        Dallas

                        • 9. Re: Reconfiguring Linux kernel and adding drivers into Galileo’s Linux image
                          arfoll

                          xthunderheartx unfortunately I don't really understand why you're having this issue. Those steps are exactly how we build the binary images we distribute on our autobuilder (we use the yocto autobuilder to build images). Are you having the same issue with the binary images or just the ones you're building?

                          • 10. Re: Reconfiguring Linux kernel and adding drivers into Galileo’s Linux image
                            xthunderheartx

                            Just the ones I build.  The stock binary image works fine.  And believe me I tried to follow your instructions to the letter. I though maybe their was some strange interaction with something I might have upgraded or installed or whatever so I even went back and tried with pristine host images.  Same result.  I kept the binaries I built laying around BTW if you are interested.

                             

                            If you've actually built an image where you could properly debug with eclipse, by hand, using your instructions, then I'm at fault obviously.  It's just that I really am a meticulous fellow and I don't get what I might be doing wrong. I thought *maybe* you might not have tested something as obscure (relatively) as debugging from eclipse on an image you would been expecting to work.  I've certainly release things that way in the past.

                             

                            Really just looking for someone to tell me if I'm in the weeds or not at this point.  I think Alex (or is it Kurt?) is going to give it a try when he gets a chance.

                             

                            Let me try it again and see if anything is different though I don't expect so. Are there any logs or other information that might be helpful? I know you guys are busy so if you can just give me some direction I'll try to figure it out myself or at least help do some of the drudgery.

                             

                            Thanx for all your help!

                            • 11. Re: Reconfiguring Linux kernel and adding drivers into Galileo’s Linux image
                              xthunderheartx

                              Simple enough to understand:

                               

                              AlexT_Intel you mentioned

                              AlexT_Intel wrote:


                              ... there's an article on building the DevKit image, just search the forum.

                               

                              If you are referring to Brendan's blog post here: https://software.intel.com/en-us/blogs/2015/03/04/creating-a-yocto-image-for-the-intel-galileo-board-using-split-layers I wouldn't suggest that.  It's broken as I've pointed out recently in dedicated thread.  The image will boot and mostly work but the user cannot debug from eclipse over gdb.  For some reason the process which scp's the image over breaks ugly and never executes the pre-run commands (chmod +777 /tmp/$file) or starts gdbserver or anything else.  Just hangs.  I've verified this on multiple host Operating Systems, multiple host hardware platforms. It sure would be nice if someone would fix it or at least confirm that I'm wrong. Recommending it's use without verification though is a bad thing in my opinion.

                               

                              I could be totally wrong but I don't think so.

                               

                              Alex suggested you use a method for building a kernel image I believe to be, at least in part, broken.  I pointed that out and the conversation proceeded from there.  But you're right, it is largely off-topic, which Alex noted, I agreed to and suggested a move.  However since Brendan responded here I followed up here because I need his help on a number of issues.  He's a busy man and I'm gonna answer him the instant he speaks as if it's from God's mouth to my ear, because I'm not blinkin' LEDs here.  Real revenue is at stake.  I'm not gonna miss a chance to get help from Intel at the expense of a little noise in "your" thread.

                               

                              And no disrespect to you, but as this a public forum, this thread belongs at least to the Community and at best to Intel, not any individual user.  The convention you protest is simply common forum etiquette.  As a result I apologize for offending you and respectfully request that further dialog continue here: Image built from IOTDK source won't launch gdbserver properly.

                              • 12. Re: Reconfiguring Linux kernel and adding drivers into Galileo’s Linux image
                                Tor_on_Tour

                                Hi, Alex and everyone else..thank you so much for your reply!

                                 

                                I really think i need the cdc-ether driver though.

                                 

                                As said, If i use a newer kernel (ubuntu 15, which has the cdc-ether file) i can make the modem appear as the following

                                 

                                [] usb 1-1: Product: 6 CDC-ACM + 1 CDC-ECM
                                [] usb 1-1: Manufacturer: Telit
                                [] usb 1-1: SerialNumber: 357164042207970
                                [] cdc_acm 1-1:1.0: ttyACM0: USB ACM device
                                [] cdc_acm 1-1:1.2: ttyACM1: USB ACM device
                                [] cdc_acm 1-1:1.4: ttyACM2: USB ACM device
                                [] cdc_acm 1-1:1.6: ttyACM3: USB ACM device
                                [] cdc_acm 1-1:1.8: ttyACM4: USB ACM device
                                [] cdc_acm 1-1:1.10: ttyACM5: USB ACM device
                                [] cdc_ether 1-1:1.12 wwan0: register 'cdc_ether' at usb-0000:00:14.0-1, Mobile Broadband Network Device, 00:00:11:12:13:14
                                [] usbcore: registered new interface driver cdc_ether
                                [] cdc_ether 1-1:1.12 wwx000011121314: renamed from wwan0


                                root@ubuntu75:~# dmesg

                                ....

                                [] usbcore: registered new interface driver cdc_ether
                                [] cdc_acm 1-1:1.0: ttyACM0: USB ACM device
                                [] cdc_acm 1-1:1.2: ttyACM1: USB ACM device
                                [] cdc_acm 1-1:1.4: ttyACM2: USB ACM device
                                [] cdc_acm 1-1:1.6: ttyACM3: USB ACM device
                                [] cdc_acm 1-1:1.8: ttyACM4: USB ACM device
                                [] cdc_acm 1-1:1.10: ttyACM5: USB ACM device

                                ....

                                 

                                root@ubuntu75:~# lsusb -t

                                 

                                /: Bus 03.Port 1: Dev 1, class="root_hub", Driver=ehci-pci/8p, 480M

                                     |__ Port 1: Dev 2, If 0, class="Hub", Driver=hub/8p, 480M

                                /: Bus 02.Port 1: Dev 1, class="root_hub", Driver=xhci_hcd/4p, 5000M

                                /: Bus 01.Port 1: Dev 1, class="root_hub", Driver=xhci_hcd/9p, 480M

                                     |__ Port 1: Dev 4, If 0, class="Communications", Driver=cdc_acm, 480M

                                     |__ Port 1: Dev 4, If 1, class="CDC" Data, Driver=cdc_acm, 480M

                                     |__ Port 1: Dev 4, If 2, class="Communications", Driver=cdc_acm, 480M

                                     |__ Port 1: Dev 4, If 3, class="CDC" Data, Driver=cdc_acm, 480M

                                     |__ Port 1: Dev 4, If 4, class="Communications", Driver=cdc_acm, 480M

                                     |__ Port 1: Dev 4, If 5, class="CDC" Data, Driver=cdc_acm, 480M

                                     |__ Port 1: Dev 4, If 6, class="Communications", Driver=cdc_acm, 480M

                                     |__ Port 1: Dev 4, If 7, class="CDC" Data, Driver=cdc_acm, 480M

                                     |__ Port 1: Dev 4, If 8, class="Communications", Driver=cdc_acm, 480M

                                     |__ Port 1: Dev 4, If 9, class="CDC" Data, Driver=cdc_acm, 480M

                                     |__ Port 1: Dev 4, If 10, class="Communications", Driver=cdc_acm, 480M    
                                     |__ Port 1: Dev 4, If 11, class="CDC" Data, Driver=cdc_acm, 480M

                                     |__ Port 1: Dev 4, If 12, class="Communications", Driver=cdc_ether, 480M
                                     |__ Port 1: Dev 4, If 13, class="CDC" Data, Driver=cdc_ether, 480M

                                 

                                that is compared to this, on a Galileo with the cdc-acm driver:

                                 

                                root@clanton:/#
                                [ .] cdc_acm 2-2:1.0: This device cannot do calls on its own. It is not a modem.

                                [ .] cdc_acm 2-2:1.0: ttyACM0: USB ACM device

                                [ .] cdc_acm 2-2:1.2: This device cannot do calls on its own. It is not a modem.

                                [ .] cdc_acm 2-2:1.2: ttyACM1: USB ACM device

                                [ .] cdc_acm 2-2:1.4: This device cannot do calls on its own. It is not a modem.

                                [ .] cdc_acm 2-2:1.4: ttyACM2: USB ACM device

                                [ .] cdc_acm 2-2:1.6: This device cannot do calls on its own. It is not a modem.

                                [ .] cdc_acm 2-2:1.6: ttyACM3: USB ACM device

                                [ .] cdc_acm 2-2:1.8: This device cannot do calls on its own. It is not a modem.

                                [ .] cdc_acm 2-2:1.8: ttyACM4: USB ACM device

                                [ .] cdc_acm 2-2:1.10: This device cannot do calls on its own. It is not a modem.

                                [ .] cdc_acm 2-2:1.10: ttyACM5: USB ACM device

                                [ .] cdc_acm 2-2:1.12: This device cannot do calls on its own. It is not a modem.

                                [ .] cdc_acm 2-2:1.12: ttyACM6: USB ACM device

                                [ .] usbcore: registered new interface driver cdc_acm

                                [ .] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters

                                 

                                That's what makes me think that the file is reliant.
                                You seem to have pretty good knowledge about the process AlexT_Intel, any ideas?

                                 

                                So the question still remains:

                                Anyone have any guides/clues on how to include my cdc_ether driver file before i compile in Yocto?

                                 

                                thank you

                                / Tor

                                • 13. Re: Reconfiguring Linux kernel and adding drivers into Galileo’s Linux image
                                  AlexT_Intel

                                  Okay, dmesg from Ubuntu indeed suggests you need cdc-ether in addition to cdc-acm. Actually this one is included into Galileo's 3.8 kernel, but AFAICS it doesn't have a section for Telit modems, it appears only in the 3.12 (EDIT: and now I see you actually mentioned this in your later post ). So you'd need to backport this piece. Unfortunately right now I'm a bit short on time to provide you with very detailed step-by-step instructions, but let me give you some steps and if that's not going to be helpful enough I'll try to carve out some time this weekend to make it more detailed.

                                   

                                  1) Generate the diff/patch file for cdc_ether.c between 3.8 and 3.12 kernels. Your link points to the version from 3.16, but unless you're absolutely sure you need namely that one I'd recommend you to stick to 3.12 first just because there were less changes between 3.8 and 3.12 than between 3.8 and 3.16, so the chance of incompatibility is lower.

                                   

                                  2) Provided you have setup a build environment for 1.0.4-based image, put the generated file (with .diff or .patch extension) into the meta-clanton_v1.0.4-1dt/meta-clanton-bsp/recipes-kernel/linux/files directory where meta-clanton_v1.0.4-1dt is my top-level dir of the build environment.

                                   

                                  3) Add a line below to the meta-clanton_v1.0.4-1dt/meta-clanton-bsp/recipes-kernel/linux/linux-yocto-clanton_3.8.bb, at the very end of the file (you'll see a bunch of similar lines there). Assuming the diff file is called my-cdc-ether.diff:

                                  SRC_URI += "file://my-cdc-ether.diff"

                                   

                                  4) You need to enable a kernel option for building cdc-ether module. Either (1) do "bitbake -c menuconfig virtual/kernel" then find the USB_NET_CDCETHER option and enable it as a module (m) or (2) prepare a .cfg file with this option similar to this one: meta-alext-galileo/ftdi_sio.cfg at master · alext-mkrs/meta-alext-galileo · GitHub, then add it to the files directory and SRC_URI just like the driver patch above. For ad-hoc build the direct config with menuconfig is faster and this is what I'm decribing in my blog post BTW.

                                  5) Rebuild the kernel with "bitbake -f virtual/kernel"

                                  6) Rebuild the image with "bitbake image-full-galileo". It should have the new kernel & module built in. Or use the approach shown in the blog.

                                  • 14. Re: Reconfiguring Linux kernel and adding drivers into Galileo’s Linux image
                                    Tor_on_Tour

                                    Hi AlexT_Intel, thank you so much for your fast reply's!

                                     

                                    I tried your mini-guide, couldn't get it to work though, gonna try more tomorrow.

                                    You say that the cdc-ether is included in the Galileo 3.8 kernel, are you sure? I can´t find it


                                    Don´t really know what to use to generate the .patch file. Copying the code from 3.8.7 file and (3.12 file) and generating a .patch file with those gave me an error while trying to compile. Didn't have much hope on that one.


                                    In the kernel config menu, I found something called "CDC Ethernet support (smart devices such as cable modems)"

                                     

                                    gonna try to put an M on it and compile it over the night and see if it's working with that.

                                     

                                    Anyway, thank you so much for your help Alex, true hero, an step-by-step instruction would be extremely appreciated!

                                     

                                    / Tor

                                    1 2 Previous Next