device_is_ready returns true even when device is actually not connectable

I'm pretty new to the nRF environnment. I started to go through the I2C tutorials (https://academy.nordicsemi.com/lessons/lesson-6-serial-com-i2c/). What's brothering me a lot is the device_is_ready(dev_i2c.bus) returns always true, no matter if I connect the I2C slave or not. On my logic analyzer the master send the correct command and ends up with a NAK. Which means the devive is not ready but device_is_ready returns true every time.

Does the device_is_ready only refers to the bus functionality? Or to the overlay file? For example I do not find other possible argument for the status. Does the device_is_ready function refer to the status in my overlay file?

&i2c0 {  
    mysensor: mysensor@4a{
        compatible = "i2c-device";
        status = "okay";
        reg = < 0x4a >;
    };
};

For example in the STM environment the Command ret = HAL_I2C_IsDeviceReady return only HAL_OK when the slave send a ACK command, as seen in my logic analyzer below. Is there some ssimilar functionality in the nRF environement?

Parents
  • Hello,

    Which exercise you are working on?

    TWI shares registers and other resources with other peripherals that have the same ID as the TWI (I2C). So, we must need to disable all peripherals that have the same ID as the TWI before the TWI can be configured and used. Have you had any overlapping pin setting between TWI and other peripheral?

    You can send me your project file and I can try to reproduce the sample and observe the behavior on logic analyzer.

    Thanks.

    BR

    kazi

Reply
  • Hello,

    Which exercise you are working on?

    TWI shares registers and other resources with other peripherals that have the same ID as the TWI (I2C). So, we must need to disable all peripherals that have the same ID as the TWI before the TWI can be configured and used. Have you had any overlapping pin setting between TWI and other peripheral?

    You can send me your project file and I can try to reproduce the sample and observe the behavior on logic analyzer.

    Thanks.

    BR

    kazi

Children
No Data
Related