i2c_write_read abnormal

The SDK version I used was Zephyr v1.4.2/1.9.1, and nrf52833 chip was used as the main control. 20% of the products had i2c_write_read anomaly. In the capture sequence, SCL and SDA of the i2c_write_read driver are normal before the restart sequence. After the restart, SCL is normal. However, the chip cannot output the data in the ADDR, resulting in a communication failure. The same software is normal 80% of the products, but there are 20% of the occurrence of this phenomenon.

The following is the timing of the normal product output using i2c_write_read.

The following is the timing of the exception product output using i2c_write_read.

However, the abnormal product is the normal output timing with a stop signal. As shown in the picture below.

  • Hi,

     

    It looks like the data somehow gets corrupted.

    Q1: Are you able to reproduce this with a simplified firmware?

    Q2: Have you checked the voltage levels with an analog oscilloscope to see if there is any toggling at all when this specific problem happens?

    Q3: What is the i2c slave device you're communicating with?

     

    Kind regards,

    Håkon

  • Hi,

    Q1:I have tried a program with only I2C code, but it still doesn't work.

    Q2:I used an oscilloscope to capture the timing. The phenomenon is the same as that of the Logic analyzer. SCL output high level is 3.32V, low level is 0V. The high level output of SDA is 3.3V, and the low level is 320mV., as shown in the figure.


    Q3:i2c slave:LSM303AGR

    Even more strangely, I sent the same timing to another i2c device on the abnormal board, and the data was normal.The data sent is different, and the timing is shown in the following figure.


    I also used software to simulate the i2c method, and the phenomenon is the same as in the previous timing chart, where there is no data in the timing at a certain period of time.

Related