7 Replies Latest reply on Jan 16, 2015 10:41 AM by CMata_Intel

    Device driver development on IoT

    Slavko

      Hello Forum,

       

      I like Eclipse with Galileo developer kit plugin. But I found only build for application, not for driver.

      Is there any starting guide for Yocto Device Driver Development?

       

      Thanks,

      Slavko

        • 1. Re: Device driver development on IoT
          CMata_Intel

          Hi Slavko

           

           

          I'm not sure if I understand your question so tell me if I'm wrong. You want to create a driver for a specific device. This is related to the device, maybe if you could tell us which kind of device you want to attach to your project.

          Take a look at the Intel Quark SoC Documents you will find useful information in there. Also take a look at the Yocto Project Linux Kernel Development Manual.

           

          I found this other link /Documentation/go to gpio->driver.txt This could give you an idea on how to start.

           

          Regards;

          CMata

          • 2. Re: Device driver development on IoT
            Slavko

            Hi CMata,

             

            I know how to build module by using Yocto bitbake BSP, but it's not that convenient comparing to IDE, such is Eclipse. The bitbake build takes some time, and it's gets build errors on Ubuntu 14. The IoT developer kit, which is based on Eclipse IDE provides some nice examples for different linux applications, no any example for driver thou.

            For instance, I want to start with HelloWorld driver:

            #include <linux/init.h>

            #include <linux/module.h>

            #include <linux/kernel.h>

             

            static int hello_init(void) {

              printk("<1> Hello world!\n");

              return 0;

            }

             

            static void hello_exit(void) {

              printk("<1> Bye, cruel world\n");

            }

             

            module_init(hello_init);

            module_exit(hello_exit);

            MODULE_LICENSE("GPL");

             

            Do you know how to build this driver by using IoT developer kit?

             

            Thanks,

            Slavko

            • 3. Re: Device driver development on IoT
              CMata_Intel

              Hi Slavko

               

              Unfortunately I haven't done something like this before, I still searching for something useful for you, in the meantime have you tried with their forums? Also, about the build errors on Ubuntu 14, a workaround for this is using Ubuntu12.

               

              Regards;

              CMata

              • 4. Re: Device driver development on IoT
                dferyance

                When I did driver work on Galileo, I also didn't have an easy process for compiling / updating the board. Running a whole bitbake and copying of the image takes forever. I ended up trying a few different things. None of them are great but they worked well enough for me:

                 

                • Compile the module on Galileo
                  • Of course this is a very slow board but this is possible. The nice thing is this allows for doing development just as if you were doing PC Linux drivers. I didn't do this much due to the very slow compilation time and dealing with drivers that involved initialization and static compilation.
                • Compile within the temporary files
                  • During the bitbake process, it generates entire directories of source code from the packages. I would add and modify these temporary files and compile just the parts I needed and copy them to the board. I don't know why, but I didn't find this to be very reliable. Sometimes I would make changes but they didn't make it into the compilation output. I don't know if I edited the wrong temporary file, the file got overwritten or something with make didn't notice the update.

                 

                I hope there are easier / better ways than this, but that is what I tried.

                • 5. Re: Device driver development on IoT
                  Slavko

                  Thank you for sharing this.
                  Could you explain how to set up the Galileo platform as a build environment, please?
                  Thanks again

                  • 6. Re: Device driver development on IoT
                    dferyance

                    It has been awhile since I did it, so I don't remember enough to give you much direction. The normal Galileo image doesn't include much but you can add plenty of other packages including GCC and other needed development tools. There are other threads about how to add different packages with yocto. Once you have the ones you need, SSH in like any other linux PC.

                    • 7. Re: Device driver development on IoT
                      CMata_Intel

                      Hi Slavko

                       

                      And thanks dferyance for the information. About the Development Tools, take a look at here: Updated Galileo "devtools" image is out . Hope it works.

                       

                      Regards;

                      CMata