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
  • It's a little hard to debug since I don't have access to that sensor right now. Would you be able to attach a logic analyzer to the output to see what's going on?

    By the way, if you comment out everything inside twi_nrfx_pm_control(), what current consumption do you see while in idle? I think the twi should release the HF clock after use automatically, so it shouldn't use too much power then I think.

    Have you tried to use twim instead of twi? Do you see this issue then?

    By the way, I'm going on vacation the next week, so I won't be able to provide you any answers next week.

Children
No Data
Related