4 Replies Latest reply on May 16, 2015 7:30 AM by technick1198

    Intel Edison - Arduino breakout I2C - Mixed Results

    technick1198

      I've been struggling with I2C using the Intel Edison + Arduino breakout board and the DFRobot 10 DOF sensor (Adxl345 accelerometer, ITG3200 gyro, HMC5883L Compass, BMP085 pressure sensor)

       

      The sensor board works fine with an Uno. All slaves 0x1E, 0x53, 0x68, 0x77 are detected and functioning using the sample code.
      Using the Edison + Arduino breakout only slaves 0x1E, and 0x53 are detected.

       

      The sensor board has an on-board 3.3V power regulator which enables powering the board with 3~8 VDC. The board also includes 4.7k pull-up resistors (SCL/SDA) tied to the on-board 3.3V source. The sensors are all 3.3V sensors. All of the sensors support I2C fast mode (400kHz).

       

      I've tried powering the 10DOF board using 3.3V or 5V sources with both Uno and Edison with the same results: UNO works (0x1E, 0x53, 0x68, 0x77), Edison fails (0x1E, 0x53 only).  (I've also changed the Edison/Arduino IOREF to 3.3V using J9). 

       

      Other things I've tried:

      • Edison (5V or 3.3V source) >> Arduino IDE >> I2C_scanner ==> detects (0x1E, 0x53)
        Uno (5V or 3.3V source) >> Arduino IDE >> I2C_scanner ==> detects (0x1E, 0x53, 0x68, 0x77)
      • Edison >> Connect to terminal (USB2) and execute i2cdetect -y -r 6 ==> detects (0x1E, 0x53)
      • Edison >> /sys/devices/pci0000:00/0000:00:09.1/i2c_dw_sysnode# echo std > mode ==> detects (0x1E, 0x53)
        Edison >> /sys/devices/pci0000:00/0000:00:09.1/i2c_dw_sysnode# echo fast > mode ==> detects (0x1E, 0x53)
        Edison >> /sys/devices/pci0000:00/0000:00:09.1/i2c_dw_sysnode# echo high > mode ==> detects (..nothing..)
      • Edison >> swap SDA/SCL ==> detects (..nothing..)
      • Edison >> use A4/A5 and SDA/SCL inputs ==> same result (detects (0x1E, 0x53))

       

      If I leave the I2C_scanner (Arduino sketch) running long enough (~30 minutes), I2C eventually crashes and the following trace is printed to the terminal:
      (Rebooting the Edison is not enough to clear the error; I have to disconnect the sensor board and wait a few seconds before reconnecting it.)

      [   20.647061] i2c-designware-pci 0000:00:09.1: ===== REGISTER DUMP (i2c) =====

      [   20.647161] i2c-designware-pci 0000:00:09.1: DW_IC_CON:               0x65

      [   20.647236] i2c-designware-pci 0000:00:09.1: DW_IC_TAR:               0x4

      [   20.647308] i2c-designware-pci 0000:00:09.1: DW_IC_SS_SCL_HCNT:       0x2f8

      [   20.647380] i2c-designware-pci 0000:00:09.1: DW_IC_SS_SCL_LCNT:       0x37b

      [   20.647453] i2c-designware-pci 0000:00:09.1: DW_IC_FS_SCL_HCNT:       0x87

      [   20.647524] i2c-designware-pci 0000:00:09.1: DW_IC_FS_SCL_LCNT:       0x10a

      [   20.647596] i2c-designware-pci 0000:00:09.1: DW_IC_INTR_STAT:         0x0

      [   20.647667] i2c-designware-pci 0000:00:09.1: DW_IC_INTR_MASK:         0x246

      [   20.647739] i2c-designware-pci 0000:00:09.1: DW_IC_RAW_INTR_STAT:     0x10

      [   20.647811] i2c-designware-pci 0000:00:09.1: DW_IC_RX_TL:             0x20

      [   20.647882] i2c-designware-pci 0000:00:09.1: DW_IC_TX_TL:             0x20

      [   20.647954] i2c-designware-pci 0000:00:09.1: DW_IC_ENABLE:            0x1

      [   20.648025] i2c-designware-pci 0000:00:09.1: DW_IC_STATUS:            0x2

      [   20.648095] i2c-designware-pci 0000:00:09.1: DW_IC_TXFLR:             0x1

      [   20.648166] i2c-designware-pci 0000:00:09.1: DW_IC_RXFLR:             0x0

      [   20.648237] i2c-designware-pci 0000:00:09.1: DW_IC_TX_ABRT_SOURCE:    0x0

      [   20.648308] i2c-designware-pci 0000:00:09.1: DW_IC_DATA_CMD:          0x0

      [   20.648378] i2c-designware-pci 0000:00:09.1: ===============================

      [   20.648481] CPU: 1 PID: 193 Comm: sketch.elf Tainted: G        W  O 3.10.17-poky-edison+ #1

      [   20.648486] Hardware name: Intel Corporation Merrifield/BODEGA BAY, BIOS 466 2014.06.23:19.20.05

      [   20.648493] task: f5041bd0 ti: f5080000 task.ti: f5080000

      [   20.648555] Stack:

      [   20.648623] Call Trace:

      [   20.649086] Code: b3 ff ff 89 f8 09 d0 80 ce 04 83 ff 02 0f 44 c2 8b 15 54 4b b9 c1 89 82 00 b3 ff ff f7 c6 00 02 00 00 74 14 e8 e7 f8 0a 00 56 9d <83> c4 04 5b 5e 5f 5d c3 90 8d 74 26 00 56 9d e8 d1 f4 0a 00 83

      [   20.649111] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G        W  O 3.10.17-poky-edison+ #1

      [   20.649116] Hardware name: Intel Corporation Merrifield/BODEGA BAY, BIOS 466 2014.06.23:19.20.05

      [   20.649124] task: c1b8c120 ti: c1b86000 task.ti: c1b86000

      [   20.649185] Stack:

      [   20.649254] Call Trace:

      [   20.649506] Code: 8b 42 08 a8 08 75 24 31 c9 8d 42 08 89 ca 0f 01 c8 0f ae f0 89 f6 89 e0 25 00 e0 ff ff 8b 40 08 a8 08 75 07 b1 01 89 f0 0f 01 c9 <85> 1d 58 a6 bc c1 75 0d 8d 55 f0 b8 05 00 00 00 e8 bd 31 d9 ff

      [   20.650096] i2c-6: recovery ignore

       

      ref: Re: Changing the I2C Frequency

      ref: How to get I2C commo using Edison Arduino breakout board?

      ref: http://download.intel.com/support/edison/sb/edisonarduino_hg_331191007.pdf

      ref: Arduino Playground - I2cScanner

      ref: 10 DOF Mems IMU Sensor

       

      Can you think of anything else to try?

        • 1. Re: Intel Edison - Arduino breakout I2C - Mixed Results
          Intel_Peter

          Hello technick1198,

           

          How are you powering the DFRobot 10 DOF? Is it powered directly from the Edison?

          Also, as you may know, some libraries that were originally written for the Arduino are not fully compatible with the Edison. Some dependencies or calls may refer to the the Arduino's AVR architecture, or simply not compatible with Edison's architecture. Why don't you check your library to see if this is the case.

           

          Peter.

          • 2. Re: Intel Edison - Arduino breakout I2C - Mixed Results
            technick1198

            Hi Peter,

             

            I've tried all power options: (in all cases I also have an external power supply connected in addition to USB power)

            Uno 3.3V ==> I2C scanner detects (0x1E, 0x53, 0x68, 0x77)

            Uno 5V ==> I2C scanner detects (0x1E, 0x53, 0x68, 0x77)

            Edison 3.3V ==> I2C scanner detects (0x1E, 0x53)

            Edison 5V ==> I2C scanner detects (0x1E, 0x53)

            Edison (Uno 3.3V power) ==> I2C scanner detects (0x1E, 0x53)

            Edison (Uno 5V power) ==> I2C scanner detects (0x1E, 0x53)

             

            I'm not using any 3rd party libraries right now. I'm only using the I2cscanner sketch (linked in original post), and the i2cdetect -y -r 6 command in the Edison terminal.

             

            The crux of the problem is that devices 0x68, 0x77 (ITG3200, BMP085) don't responding when connected to the Edison I2C-6 bus.

             

            Arduino UnoIntel Edison + Arduino breakout

            Scanning...

            I2C device found at address 0x1E  !

            I2C device found at address 0x53  !

            I2C device found at address 0x68  !

            I2C device found at address 0x77  !

            done

            Scanning...

            I2C device found at address 0x1E  !

            I2C device found at address 0x53  !

            done

             

            i2cdetect -y -r 6

             

            10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- 1e --

            20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

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

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

            50: -- -- -- 53 -- -- -- -- -- -- -- -- -- -- -- --

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

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

            • 3. Re: Intel Edison - Arduino breakout I2C - Mixed Results
              philtkp

              I'm not familiar with the DFRobot 10 DOF sensor. But I was having the same issues with the GY80 which has the same sensors.

              after removing all the libraries for the sensors I had install it started working

               

              Using i2c_scanner I get

              Scanning...

              I2C device found at address 0x1E  !

              I2C device found at address 0x53  !

              I2C device found at address 0x69  !

              I2C device found at address 0x77  !

              done

              using i2cdetect -y -r 6

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

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

              10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- 1e --

              20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

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

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

              50: -- -- -- 53 -- -- -- -- -- -- -- -- -- -- -- --

              60: -- -- -- -- -- -- -- -- -- 69 -- -- -- -- -- --

              70: -- -- -- -- -- -- -- 77

               

              This was the only combination that worked for me.

              I'm powering the Edison Arduino through USB J9 is set for 3.3V

              Edison     GY80

              3.3V         VCC_3.3V

              GND        GND

              A4            SDA

              A5            SCL

              I can see it working somewhat using Processing. But its not working as good as it does with the UNO or teensy

              • 4. Re: Intel Edison - Arduino breakout I2C - Mixed Results
                technick1198

                The mystery deepens.

                 

                I'm trying another sensor now (SI7021).  This sensor is also 3.3V and I'm connecting the sensor to the Edison-Arduino board more-or-less like the diagram in the previous link shows. I have the Edison board configured for 3.3V logic.  (The sensor works fine with UNO).

                 

                I created a simple sketch to setup I2C correctly.

                However, I2C dies whenever the sensor is polled.


                # empty sketch to setup Edison-Arduino I2C

                #include <Wire.h>

                void setup() {

                  Wire.begin();

                }

                 

                void loop() {

                  delay(100);

                }

                 

                Then, from the terminal:

                 

                root@edison:~# i2cdetect -r 6

                WARNING! This program can confuse your I2C bus, cause data loss and worse!

                I will probe file /dev/i2c-6 using read byte commands.

                I will probe address range 0x03-0x77.

                Continue? [Y/n] y

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

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

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

                20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

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

                40: -- [  379.017710] i2c-designware-pci 0000:00:09.1: ===== REGISTER DUMP (i2c) =====

                [  379.017812] i2c-designware-pci 0000:00:09.1: DW_IC_CON:               0x65

                [  379.017900] i2c-designware-pci 0000:00:09.1: DW_IC_TAR:               0x41

                [  379.017985] i2c-designware-pci 0000:00:09.1: DW_IC_SS_SCL_HCNT:       0x2f8

                [  379.018071] i2c-designware-pci 0000:00:09.1: DW_IC_SS_SCL_LCNT:       0x37b

                [  379.018156] i2c-designware-pci 0000:00:09.1: DW_IC_FS_SCL_HCNT:       0x87

                [  379.018241] i2c-designware-pci 0000:00:09.1: DW_IC_FS_SCL_LCNT:       0x10a

                [  379.018326] i2c-designware-pci 0000:00:09.1: DW_IC_INTR_STAT:         0x0

                [  379.018409] i2c-designware-pci 0000:00:09.1: DW_IC_INTR_MASK:         0x246

                [  379.018494] i2c-designware-pci 0000:00:09.1: DW_IC_RAW_INTR_STAT:     0x10

                [  379.018578] i2c-designware-pci 0000:00:09.1: DW_IC_RX_TL:             0x20

                [  379.018662] i2c-designware-pci 0000:00:09.1: DW_IC_TX_TL:             0x20

                [  379.018746] i2c-designware-pci 0000:00:09.1: DW_IC_ENABLE:            0x1

                [  379.018829] i2c-designware-pci 0000:00:09.1: DW_IC_STATUS:            0x2

                [  379.018913] i2c-designware-pci 0000:00:09.1: DW_IC_TXFLR:             0x1

                [  379.018996] i2c-designware-pci 0000:00:09.1: DW_IC_RXFLR:             0x0

                [  379.019079] i2c-designware-pci 0000:00:09.1: DW_IC_TX_ABRT_SOURCE:    0x0

                [  379.019162] i2c-designware-pci 0000:00:09.1: DW_IC_DATA_CMD:          0x0

                [  379.019244] i2c-designware-pci 0000:00:09.1: ===============================

                [  379.019360] CPU: 0 PID: 351 Comm: i2cdetect Tainted: G        W  O 3.10.17-poky-edison+ #1

                [  379.019365] Hardware name: Intel Corporation Merrifield/BODEGA BAY, BIOS 466 2014.06.23:19.20.05

                [  379.019372] task: f5191bd0 ti: f5f0c000 task.ti: f5f0c000

                [  379.019432] Stack:

                [  379.019501] Call Trace:

                [  379.019945] Code: b3 ff ff 89 f8 09 d0 80 ce 04 83 ff 02 0f 44 c2 8b 15 54 4b b9 c1 89 82 00 b3 ff ff f7 c6 00 02 00 00 74 14 e8 e7 f8 0a 00 56 9d <83> c4 04 5b 5e 5f 5d c3 90 8d 74 26 00 56 9d e8 d1 f4 0a 00 83

                [  379.019969] CPU: 1 PID: 0 Comm: swapper/1 Tainted: G        W  O 3.10.17-poky-edison+ #1

                [  379.019974] Hardware name: Intel Corporation Merrifield/BODEGA BAY, BIOS 466 2014.06.23:19.20.05

                [  379.019982] task: f6c83d30 ti: f6e1e000 task.ti: f6e1e000

                [  379.020044] Stack:

                [  379.020112] Call Trace:

                [  379.020320] Code: 8b 42 08 a8 08 75 24 31 c9 8d 42 08 89 ca 0f 01 c8 0f ae f0 89 f6 89 e0 25 00 e0 ff ff 8b 40 08 a8 08 75 07 b1 01 89 f0 0f 01 c9 <85> 1d 58 a6 bc c1 75 0d 8d 55 f0 b8 05 00 00 00 e8 bd 31 d9 ff

                [  379.072574] i2c-6: recovery ignore

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

                50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

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

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

                 

                Any ideas on how I can debug this issue and find the root cause?

                Is my Edison board defective? How would I determine that for sure?