Can't use I2C on 4.11.0-rc2-upboard (32 bit)

Fernando
Fernando New Member Posts: 22
Hi!.

I'm running Lubuntu 16.04.2 LTS, 32 bit, with upboard kernel (4.11.0-rc2-upboard). I have not been able to use the I2C ports. I hooked a MPR121 based sensor to i2c-0 and i2c-1 with no luck. I have tested it in a couple of approaches:

1. Installed MRAA/UPM and and write a simple program (UPM based) to communicate to the sensor.
2. Installed i2c-tools, and run i2cdetect and i2cset. The former does find nothing, and the second, shows the message "Error: Write failed", as if was nothing connected to the port.

I made the same test with a Raspberry Pi successfuly, so I don't think there is something wrong with the wiring or the tests.

As I understand there have been not many tests of 32 bit Linux on Up!, I could confirm that I am able at least, of toggling and read pin values using MRAA, and driving peripherals attached to SPI port, so I think other features besides I2C are working ok.

So I would like to know if there is some kind of configuration in order to enable I2C I have left out, or someone could provide me some advice to overcome this issue.

Thanks!

Comments

  • Dan O'Donovan
    Dan O'Donovan Administrator, Moderator, Emutex Posts: 241 admin
    Did you communicate successfully with that sensor from UP when running 64-bit Linux? Just wondering if this is an issue that only occurs when switching to 32-bit Linux specifically, or possibly a more general issue when using that I2C sensor with UP.

    What method (i.e. what library/driver/commands) are you using to communicate with the sensor?

    There are a couple of subtle differences between the I2C controllers on UP vs RPi. Not sure if any of this is relevant, but I'll share this anyway. For example:
    - RPi defaults to the 100kHz I2C clock speed, as far as I remember, while UP defaults to 400kHz. Some devices don't support 400kHz but that's rare. This can be changed anyway via BIOS options.
    - RPi doesn't support I2C RESTART commands, so always issues STOP and START when switching between a write and a read access within a single transaction. UP does issue I2C RESTART commands in that case. Some devices don't support I2C RESTARTS but, again, that's rare in my experience. Software workarounds can be applied to split the transaction into individual writes and reads to circumvent that if necessary.
    - RPi's I2C kernel driver supports some additional SMBUS/I2C driver functions that aren't supported by the kernel driver on UP, which can affect the default behaviour of commands such as i2cdetect. Note the difference on each when running the command 'i2cdetect -F 1'. For this aspect, I find that using the '-r' option with 'i2cdetect' generally works well on UP for device discovery.
  • Fernando
    Fernando New Member Posts: 22
    Hi Dan.

    1. How cand I change I2C speed?. Besides the selection for ACPI, PCI and disable, I dont see more options for I2C in BIOS.

    2. I will perform some tests using the stock x64 image.

    3. With i2cdetect I used the "-r" options indeed. Otherwise "Error: Can't use SMBus Quick Write command on this bus" error is generated.

    Thanks.
  • Fernando
    Fernando New Member Posts: 22
    edited July 2017
    Hi!.

    I hope I can get some additional help with my issues with I2C on 4.11.0 (32 bit).

    How can I change the I2C speed in order to test if the problem is the lack of suport of 400kb of my device?.
    Could be GPIO bitbanging I2C enabled un Up?. What kind of speed can be expected?.
    Is this kernel configuration ok for using I2C?.



    Thanks!.
  • DCleri
    DCleri Administrator, AAEON Posts: 1,213 admin
    The I2C speed can be changed from the BIOS menu
  • mdostie
    mdostie New Member Posts: 4

    @DCleri I am not sure the BIOS can really do that. I have selected the 100kHz clock speed, and the I2C is still at 400kHz.