9 Replies Latest reply on Dec 4, 2014 4:58 AM by rgb

    DS2482 i2c not recognized

    Piet78

      Hello,

      I have a Galileo Gen1 board running Debian Linux (Linux galileo 3.8.7 #1 Mon Sep 8 03:49:36 UTC 2014 i586 GNU/Linux).

       

      After installing i2c-dev with apt-get, adding i2c-dev to /etc/modules and adding a DS2482 (onewire to i2c master), the DS2482 will not be reconized by i2cdetect:

       

      root@galileo:/dev# i2cdetect -y -r 0

           0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f

      00:          -- -- -- -- -- -- -- -- -- -- -- -- --

      10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

      20: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

      30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

      40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

      50: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

      60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

      70: -- -- -- -- -- -- -- --

       

      The DS2482 is expected to show up at address 18.

       

      I tested with and without external pullups (4k7).

       

      What can be wrong?

        • 1. Re: DS2482 i2c not recognized
          Intel_Peter

          Hello Piet78,

           

          Are you sure the i2c-dev is fully compatible with Galileo, your issue could be caused because of a lack of compatibility with Galileo from the i2c-dev developers, if this is the case, you may have to edit it yourself to make it work on your Galileo. However the only officially supported distribution of Linux is Yocto and you can find it here: https://communities.intel.com/docs/DOC-22226

          If you have any other doubts regarding the Galileo board, don't hesitate to ask.

           

          Regards,

                      Peter

          • 2. Re: DS2482 i2c not recognized
            Piet78

            I have used the Debian 1.2 Image from StuartAnderson and then got the i2c-dev package via apt-get.

            As i2cdetect shows some data at address 21+51 I think this is working.

             

            Dmesg shows, that the device is created, no errors on this. And i2cdetect -l shows some busses, including i2c-0.

             

            I connected sda/scl to the arduino shield sockets marked with sda/scl. Maybe an issue with the multiplexer?

            • 3. Re: DS2482 i2c not recognized
              Intel_Peter

              Hello Piet78,

               

              If you have issues with MUX configuration, you can check this blog, it has a ton of information about the Gen2, and in it there's a table that explains the GPIO configuration and what you need to do in order to use certain features like for example I2C.

               

              Regards,

                          Peter

              • 4. Re: DS2482 i2c not recognized
                Piet78

                The blog was not useful for me, sorry.

                 

                Here are the startup-messages from dmesg, maybe this gives someone a hint:

                 

                14.339955] intel_qrk_gip 0000:00:15.2: enabling device (0000 -> 0002)

                [   14.419109] intel_qrk_gpio_restrict_probe: i2c adapter not ready yet. Deferri

                ng..

                [   14.490492] sch_gpio_probe UIO port addr 0x1080 size 64 porttype 1

                [   14.583292] platform qrk-gpio-restrict-sc.0: Driver qrk-gpio-restrict-sc requ

                ests probe deferral

                [   14.815436] intel_qrk_gip 0000:00:15.2: i2c speed set to 100kHz

                [   14.883090] intel_qrk_gip 0000:00:15.2: enabling bus mastering

                [   14.883183] intel_qrk_gip 0000:00:15.2: setting latency timer to 64

                [   14.883619] intel_qrk_gip 0000:00:15.2: irq 42 for MSI/MSI-X

                [...]

                [   21.583714] i2c /dev entries driver


                And the busses:

                root@galileo:~# i2cdetect -l

                i2c-0   i2c             intel_qrk_gip_i2c                       I2C adapter

                 

                root@galileo:/sys/bus/i2c# find .

                .

                ./devices

                ./devices/i2c-0

                ./devices/0-0020

                ./devices/0-0050

                ./drivers

                ./drivers/at24

                ./drivers/at24/bind

                ./drivers/at24/module

                ./drivers/at24/uevent

                ./drivers/at24/unbind

                ./drivers/at24/0-0050

                ./drivers/dummy

                ./drivers/dummy/bind

                ./drivers/dummy/uevent

                ./drivers/dummy/unbind

                ./drivers/cy8c9540a

                ./drivers/cy8c9540a/bind

                ./drivers/cy8c9540a/module

                ./drivers/cy8c9540a/uevent

                ./drivers/cy8c9540a/unbind

                ./drivers/cy8c9540a/0-0020

                ./uevent

                ./drivers_probe

                ./drivers_autoprobe

                 

                root@galileo:/sys/bus/i2c/devices# ll

                total 0

                lrwxrwxrwx 1 root root 0 Jan  1 01:17 0-0020 -> ../../../devices/pci0000:00/0000:00:15.2/i2c-0/0-0020

                lrwxrwxrwx 1 root root 0 Jan  1 01:17 0-0050 -> ../../../devices/pci0000:00/0000:00:15.2/i2c-0/0-0050

                lrwxrwxrwx 1 root root 0 Jan  1 01:17 i2c-0 -> ../../../devices/pci0000:00/0000:00:15.2/i2c-0

                • 5. Re: DS2482 i2c not recognized
                  rgb

                  Hi

                  I don't know if this will help, but I had same problem with Yocto not seeing an LCD backpack and was told by AlexT to check mux,so looked at

                  Sergey's blog and created the following program in Python to create a link to GPIO 29, set it to output and write a 0 to it so it would set the MUX to i2c.

                  After running it, i2cdetect -r -y 0 would see the device.

                  #!/usr/bin/python

                  with open("/sys/class/gpio/export","w") as fh:

                       fh.write("29")

                  with open("/sys/class/gpio/gpio29/direction","w") as fh:

                       fh.write("out")

                  with open("/sys/class/gpio/gpio29/value","w") as fh:

                       fh.write("0")

                  You could also try to run the same using echo commands.

                  Regards

                  rgb

                  • 6. Re: DS2482 i2c not recognized
                    Piet78

                    Hello rgb,

                     

                    great thanks to your answer! That was it!

                     

                    Now the device is visible:

                     

                    root@galileo:~# i2cdetect -y -r 0

                         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f

                    00:          -- -- -- -- -- -- -- -- -- -- -- -- --

                    10: -- -- -- -- -- -- -- -- 18 -- -- -- -- -- -- --

                    20: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

                    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

                    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

                    50: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

                    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

                    70: -- -- -- -- -- -- -- --

                     

                    Regards,

                    Piet

                    • 7. Re: DS2482 i2c not recognized
                      rgb

                      Hi Piet

                      Glad I could help. When you get it working, please post the results as I am interested in seeing how multiple One-Wire devices could be used with the Galileo

                      Regards

                      rgb

                      • 8. Re: DS2482 i2c not recognized
                        Piet78

                        Hello rgb,

                         

                        installe the owfs things:

                             apt-get install owfs owserver

                         

                        then create filesystem and enjoy:

                          mkdir /owfs

                          chmod 777 /owfs

                          cat -T /owfs/bus.1/interface/settings/name && echo

                        DS2482-100

                          cat /owfs/10.DEE0ED000800/temperature && echo

                        26.3125 (this is a DS18S20 without pullups on the 1-wire bus)

                        • 9. Re: DS2482 i2c not recognized
                          rgb

                          Hi Piet

                          Thanks, I'll try it as soon as I can get my hands on a DS2482

                          regards

                          rgb