I2C not working in L4T 32.5.1 in TX2-4GB device

Hello,

I have a MIPI driver fully developed in the L4T 32.3.1 but I want to use the VPI 1.0 libraries in the application so I decided to upgrade to L4T 32.5.1 which is the latest version. To do so I just flashed a TX2-4GB jetson with the nvidia SDK manager without my driver, then I have this python script to test the i2c communications with the FPGA connected via MIPI.

import smbus

bus = smbus.SMBus(2)
address = 0x3e
BMG_LDR_FW_VERSION_MINOR = 0x00

print("device id")
bytes = bus.read_byte_data(address, BMG_LDR_FW_VERSION_MINOR)
print(bytes)

When the script runs in the 32.3.1 version I have the result ‘4’ which is the right value to read from the 0x00 address, but when I execute the script in the 32.5.1 version I have ‘-121’, this value appears always, and it is what i2c returns when nothing is attached to the port.

I have also tried with the L4T 32.5 and the script works fine.

All the test that I have done are without the driver code in the kernel, the L4T versions are the ones that SDK Manager downloads and installs.

Is there any kind of configuration I can change in the 32.5.1 version to make it work fine?

Thank you

Do you mean 32.5 working without problem but 32.5.1 didn’t work?
Could you try others i2c bus to confirm it?

Hi ShaneCCC, yes, as you said 32.5 is working but 32.5.1 is not working.

I have the TX2 developer kit, and do the test with the 32.5 in the J21 pin nº3 and with an oscilloscope I can see the request, and when I do the same but for the camera I2C clock signal I can see in the oscilloscope the clock of the request.

Then the same test with the 32.5.1, in the J21 pin nº3 I can see the request signal, but in the camera I2C clock signal there is no activity with the oscilloscope.

To test the signal in the camera connector, I am using this piece connecting the oscilloscope to the pin 2 in the J4 connector.

Thank you

Could you help to check if bus 0 have the same issue with 32.5.1 to clarify the problem.(pin3/pin5)

Hello ShaneCCC,

In bus 0, J21 pin 3 with 32.5.1 I am able to see data activity with the oscilloscope, so the bus 0 is working

Thank you,

Did you confirm the bus number in the code for bus 0?

bus = smbus.SMBus(2)

Hello ShaneCCC

To make things easier, I have created this python script

import smbus
import sys

SUBADDRESS_READ = 0x00
address = 0x3e

def readData(bus):
    print("Read id")
    bytes = bus.read_byte_data(address, SUBADDRESS_READ)
    print("Data read " + str(bytes))

def main(argv):
    port = -1

    if(len(sys.argv) < 3):
        print("i2c_gpio.py -p <port_n>")
        sys.exit(2)

    for i in range(len(sys.argv)-1):
        if(argv[i] == "-p"):
            port = argv[i+1]

    if(port == -1):
        print("i2c_gpio.py -p <port_n>")
        sys.exit(2)

    print("starting in port ", port)

    bus = smbus.SMBus(int(port))

    command = ""

    while (1):
        command = input("task : ")

        if(command != ""):

            if(command == "q"):
                break 

            elif(command == "r"):
                try:
                    readData(bus)
                except:
                    print("Error reading data")

            else:
                print("unrecognized task try 'r'")

main(sys.argv[1:])

So I can test any I2C port in the jetson.

To test the I2C bus 0

Connect the oscilloscope to PIN 27 in J21 TX2 development kit.
run the script python3 i2c_gpio.py -p 0
press key ‘r’
in the oscilloscope I see activity, the read request part of the communications

TEK00000

To test the I2C bus 1

Connect the oscilloscope to PIN 3 in J21 TX2 development kit.
run the script python3 i2c_gpio.py -p 1
press key ‘r’
in the oscilloscope I see activity, the read request part of the communications

i2c_bus_1

As you can see bus 1 has 2.2 V and not 3.3 V I dont know why this happens, but even the voltage is not 3.3 you can see the request signal

To test the I2C bus 2

The bus 2 is the one that sends the data over the MIPI port.

Connect this piece to the camera port of the TX2 developer kit. As you can see in page 17, the J4 connector PIN4 has I2C data.

using the L4T 32.5.1
run the script python3 i2c_gpio.py -p 2
press key ‘r’
in the oscilloscope does nothing, there is no I2C signal in the I2C bus 2.

using the L4T 32.5
run the script python3 i2c_gpio.py -p 2
press key ‘r’
I see activity in the oscilloscope.

i2c_bus2

Here is a picture of the setup.

So the problem is on bus 2 with 32.5.1?

Yes, I2C bus 2, that is the same that MIPI uses

Could you help to clarify the i2cdetect -y 2 on 32.5 and 32.5.1 to check if any different on your device.

Thanks

@eduardo.bernal
This bus was disable if there’s no any camera connected. You can try to modify the device tree to enable it.

/proc/device-tree/ i2c@3180000 /status

Hello @ShaneCCC

Sorry for answering late.

I have done the i2cdetect test and check the value of /proc/device-tree/ i2c@3180000 /status

This is the result with the 32.5.1

i2c_detect_32.5.1_status

and this is the result with 32.5

i2c_detect_32.5

Does that means working without problem?

@ShaneCCC as you can see in the images, the 32.5 version works, beacuse there is a 3e address detected, but in the 32.5.1 there is nothing, so its not working, aslo the status of the i2c@3180000 is “okay” so if I understand it, it means that you can send data over the bus with the python script

@eduardo.bernal
Could you replace the dtb file from 32.5 to 32.5.1 to confirm it.

Thanks

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.