Hi,
I'm currently using nRF Connect SDK v1.9.0 and developing on a nRF52832 onto a custom board. I'm using a BMI090L from Bosch connected over i2c.
I'm trying to suspend the i2c device after shutting down the gyro using the following code:
m_bmi090l.gyro_cfg.power = BMI090L_GYRO_PM_SUSPEND; if ( bmi090lg_set_power_mode(&m_bmi090l) != BMI090L_OK ){ LOG_ERR("Failed to shutdown gyroscope.\n"); } pm_device_action_run(i2c_dev, PM_DEVICE_ACTION_SUSPEND);
Then I resume it using this:
pm_device_action_run(i2c_dev, PM_DEVICE_ACTION_RESUME); m_bmi090l.accel_cfg.power = BMI090L_ACCEL_PM_SUSPEND; if (bmi090la_set_power_mode(&m_bmi090l) != BMI090L_OK){ LOG_ERR("Failed to shutdown acceleration.\n"); }
After the resume, I'm unable to interact with the gyroscope but only with the accelerometer. I think it may come from somewhere around the pm_device_action_run function since the problem disappear when commenting those lines. I didn't have this issue with 1.7.0 too.
Here's the device tree part where I configure the device:
&i2c0 {
compatible = "nordic,nrf-twi";
status = "okay";
clock-frequency = <I2C_BITRATE_STANDARD>;
sda-pin = <25>;
scl-pin = <27>;
};
Here's the I2C and PM part of my prj.conf file:
# I2C CONFIG_I2C=y CONFIG_I2C_NRFX=y CONFIG_NRFX_TWI=y CONFIG_NRFX_TWI0=y # Power management CONFIG_PM=y CONFIG_PM_DEVICE=y CONFIG_PM_DEVICE_RUNTIME=y
I know some changes have been done about power management between 1.7.0 and 1.9.0. Do you have any idea of what could cause this issue?
Thanks,
Alexandre