How hold I2C turn on in idle state

Dear Nordic Engineers

I have a problem and would like to ask you about the I2C work state.

I read this link:https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/services/pm/api/index.html?highlight=pm_device_action_resume#c.pm_device_action.PM_DEVICE_ACTION_RESUME

It shows the PM_DEVICE has some states and in system idle, the I2C will enter SUSPEND state.

We use the I2C to communication between other device, the I2C transfer API has waiting logic,it will allow CPU enter idle state.

In this course, my I2C communication does not end, but the I2C enter SUSPEND state, so communication will fail.

1、I would like to know how to avoid this case happening.

2、I see the E:\NCS\v2.0.0\zephyr\drivers\i2c\i2c_nrfx_twi.c  twi_nrfx_pm_action() function, it does not have busy set and busy clear to set and clear the I2C working states. 

I would like to use pm_device_busy_set() and pm_device_busy_clear()  on I2C. What should I do?

Please give me some good suggestions.

Best regards.

Parents
  • Hello,

    I tried to look into it, but I could not reproduce your issue. I will ask the developers about those two functions though.

    Which I2C functions were you using for the transfer?
    How does the CPU enters the idle state?

    Would it be possible to upload the offending code (preferably a minimal working example if possible), so that I could take a better look into it?

    Best regards,

    Michal

Reply
  • Hello,

    I tried to look into it, but I could not reproduce your issue. I will ask the developers about those two functions though.

    Which I2C functions were you using for the transfer?
    How does the CPU enters the idle state?

    Would it be possible to upload the offending code (preferably a minimal working example if possible), so that I could take a better look into it?

    Best regards,

    Michal

Children
Related