Using I2C-2 Via Pins 14 & 15 In Linux (no M4)

Discussion in 'UDOO NEO' started by ctassell, Jul 19, 2016.

Tags:
  1. ctassell

    ctassell UDOOer

    Joined:
    Apr 9, 2015
    Messages:
    19
    Likes Received:
    2
    Hi Everyone,

    I was wondering if it's possible to use the SDA/SDL pins for I2C-2 that are attached to the top 2 inner pins of J6 with Linux instead of the M4/Arduino? I know that the Device Tree Editor can't create a DTS file that will do this, but can it be done manually, or are those pins just M4 only?
     
  2. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    I am just following the documentation that it should be possible:
    The internal pinout is assigned to the M4 core (blue pins), the external one to the A9 core.
    Heads up! Disable the M4 core to give A9 control over the inner row (refer to this guide on how to do that).

    But don't ask me how to do that.... But search for pinmuxing and you can learn a lot!

    Edit: @Andrea Rovai There is an error in the documentation. The original this guide link goes to a 404
     
  3. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
  4. ctassell

    ctassell UDOOer

    Joined:
    Apr 9, 2015
    Messages:
    19
    Likes Received:
    2
    Hey Walter,

    Thanks, I tried disabling the M4 but that didn't seem to help. I agree that is probably a pinmuxing issue, I'm just not sure where to find docs on how to mux those internal pins to enable I2C mode. The dtweb package only seems to work on the outer pins so it's a matter of finding the right include file and hacking it so that the DTS/DTD file enables the pins.
     
  5. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
  6. ctassell

    ctassell UDOOer

    Joined:
    Apr 9, 2015
    Messages:
    19
    Likes Received:
    2
    Hi Andrea,

    Yup, I've read both of them. The problem is the pinmuxing docs only cover the outer pins. I need to enable 2 of the inner pins (14 & 15) in I2C SDA/SDL mode, which I believe requires updating the boot DTD file. My question is how do I do that? IE, "Edit /opt/dtweb/dtbkernel/arch/arm/boot/dts/imx6sx.dtsi change this block, run dtweb and save the config to recompile the dts-overlay files on /boot and reboot"

    I think I have to change the i2c2 block in that file (or one like it) from status = disabled to status=enabled, which I'll try in a bit and post back if it works. I'm just looking for clarification as to which file I need to edit.
     
    Andrea Rovai likes this.
  7. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    I understand your problem. The documentation as you say only covers the outer pins, as we've never thought about implementing the inner ones for other than the M4. But I think you are on the right path, and I'm curious to know what you will discover. It would be a nice addition to the documentation.
     
  8. ctassell

    ctassell UDOOer

    Joined:
    Apr 9, 2015
    Messages:
    19
    Likes Received:
    2
    It doesn't look like it worked, although I was able to break the I2C-4 bus so I'm obviously swinging the sledgehammer in the right area. :)
     
  9. jas-mx

    jas-mx Active Member

    Joined:
    Dec 31, 2013
    Messages:
    407
    Likes Received:
    118
    You need to set i2c2 to "okay" ie:

    Code:
    &i2c2 {
        status = "okay";
    };
    After reviewing the dts files, if i2c2 is enabled on the A9 side, then the pins should be mux'd for i2c2 and (theoretically) should appear on J6. The same pins are also available on the J10 connector.
     
    Last edited: Jul 20, 2016
  10. ctassell

    ctassell UDOOer

    Joined:
    Apr 9, 2015
    Messages:
    19
    Likes Received:
    2
    Yup, I tried that but still no luck. I'm not sure if the problem is with the shield we've built or the pins on J6, so we're going to try using I2C-4.

    Speaking of the J10 connector, is there a pinout explanation of that block connector? It might be easier for us to just plug our I2C device (a 6-pin NFC antenna from NTag) into that.
     
  11. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    Andrea Rovai likes this.

Share This Page