Toradex verdin IMX8MP-Dhalia I2C-3 operation issue

Hi ,

I am trying to communicate between my verdin-dhalia to a battery using an I2C.Below are the configurations.

I am using dhalia secondary header pins 19(I²C_EXT_SDA) and 20(I²C_EXT_SCL). This is connected to I2C-3 port as per the reference manual.So below are the steps i am using to communicate.

file = open(“/dev/i2c-3”, O_RDWR); => file value is 19 after executing this line
rc = ioctl(file, I2C_SLAVE, addr); => rc value is 0 after execution, I2C_SLAVE is 0x0703 and addr is 0x16(battery address).
data = i2c_smbus_read_byte_data(file, reg); reg is 0x0e.This function call is below

args.read_write = 1;
args.command = reg;
args.size = 2;
args.data = data;
return ioctl(file,I2C_SMBUS,&args); //I2C_SMBUS is 0x0720.

this function returns an error.

need help in establishing the communication with the battery.

Regards
Vijay

Further update: Refer the below image.

I got these signals on the I2C data and clock lines. This is one set of command in the consequtive set of commands.below is the expected signal.

Comparing the actual and expected signals, the problem currently i am facing is that i am not able to send I2C message continiously. I am able to just send one set of data/command Any help would be great.

Hi @VijayRichard,

In order to help you better with this scenario, I have some questions:

  • Which error are you seeing? Can you share it with us?
  • Can you send me the output of ls -l /dev/verdin-i2c* please?
  • Which OS are you using? Torizon, BSP, custom Yocto image…

Also please check our guide about I²C and Linux here: I2C (Linux) | Toradex Developer Center

Best regards,
Hiago.