This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Error 195952641 on I2C, when power management is enabled.

Hello, when developing our application, we run into a problem. We are running Zephyr 2.4.0 on nRF52840 MCU. We use LSM303AGR sensor, which is supported by zephyr LIS2DH driver. The threshold exceeded interrupt from sensor are used, and after some time from booting, the device logs such error:
<err> i2c_nrfx_twi: Error 195952641 on I2C line occurred for message 0
<err> lis2dh: clearing interrupt 2 failed: -5
As I have find out, this is no ACK from slave, when sending address error.
As we have figured out, this is somehow connected with power management, which we use because it is battery powered device. When the following lines from config are deleted:
CONFIG_SYS_POWER_MANAGEMENT=y
CONFIG_SYS_POWER_SLEEP_STATES=y
CONFIG_DEVICE_POWER_MANAGEMENT=y
the problem doesn't occur.
Has someone faced such problem, and got any solution? If there are more information needed, let me know.
Parents Reply
  • I understand that its hard. Unfortunately I'm not able to connect logic analyzer to I2C lines, due to small size of components and the board itself. I was trying to do it, but with no luck.
    I haven't measured the current consumption, but will do this probably this week.
    When I use twim instead of twi, I can only communicate with one device (the LSM303 sensor shows as two devices on the bus), but when we used only accelerometer with twim, the problem didn't occur.

Children
  • Kacper said:
    I haven't measured the current consumption, but will do this probably this week.

    If you measure a low current with everything inside twi_nrfx_pm_control() commented out then you have a workaround for this issue.

    Kacper said:
    I understand that its hard. Unfortunately I'm not able to connect logic analyzer to I2C lines, due to small size of components and the board itself. I was trying to do it, but with no luck.

    A logic trace would be very useful. I will see if I can get a hold of a LSM303 sensor and try to reproduce the issue on my side.

    Kacper said:
    When I use twim instead of twi, I can only communicate with one device (the LSM303 sensor shows as two devices on the bus), but when we used only accelerometer with twim, the problem didn't occur.

    The TWIM should be able to communicate with multiple slaves connected to the same bus, so I'm not sure what's going on.

    I will wait for you current measurement results and look into the issue further if needed.

    Best regards,

    Simon

Related