RZv2L M33 i2c clk error

I have interfaced a IR sensor (mlx 90632) with RZV2L I2C interface using PMOD connector.

1. I have validated the sensor using ESP32 I am able to retrieve the Sensor values.

I2C address: 0X3A Nau7802 I2c Address: 0x2A 

Sample Output:

Object temperature: 15.27 CNau7802 Reading: 437123

Object temperature: 15.37 CNau7802 Reading: 437300

Object temperature: 15.30 CNau7802 Reading: 437141

Object temperature: 15.32 CNau7802 Reading: 437218

Object temperature: 15.35 CNau7802 Reading: 437339

Bellow is my fsp config.

But while doing a sensor read it goes into Error state 


uint32_t iic_clk = p0_clk / (1U << p_ctrl->p_reg->ICMR1_b.CKS);

Looking at fsp docs it says i2c clk is derived from P0

I am using i2c 0 channel.

I checked the value uint32_t iic_clk = p0_clk / (1U << p_ctrl->p_reg->ICMR1_b.CKS)

p_ctrl->p_reg->ICMR1_b.CKS is Null/ not defined.

  • This problem is resolved...  by calling 

    p_driver_instance->p_api->open(p_driver_instance->p_ctrl, p_driver_instance->p_cfg);


    err = RM_COMMS_I2C_Open(&g_comms_i2c_device0_ctrl, &g_comms_i2c_device0_cfg);

    in mlx90632_init() ir sensor driver init function earlier I was only calling

    err = RM_COMMS_I2C_Open(&g_comms_i2c_device0_ctrl, &g_comms_i2c_device0_cfg);