regulator-powered sensor fails to acknowledge over i2c after replacing battery

I'm using a custom board that has nRF52810 and lis2dh12 sensor. The sensor's Vdd is powered from a GPIO (configured a regulator-fixed to supply power from the GPIO during boot time).  GPIO's for I2C communications are configured with internal pull-ups. The code is same as lis2dh sample code.

For a while, the I2C communications to the sensor was working fine (RTT logged good sensor data), until the battery level went below 1.5V.

Now, the sensor is not acknowledging during lis2dh driver initialization in kernel's init.c (as if no supply is provided to the sensor). The issue persists after replacing the battery (with another battery and external power supply.

Could this be a simple timing issue during initialization?

[00:00:03.345,031] <inf> regulator_fixed: imu-pwr-ctrl onoff: 0
[00:00:09.659,393] <err> i2c_nrfx_twim: Error on I2C line occurred for message 0
[00:00:09.659,515] <err> lis2dhx: Failed to read chip id.

BTW, I inadvertently had added DC/DC configuration enabled (although the board has no external inductor to support DC/DC).

Parents
  • If the DCDC components are in place, then this should not be the issue indeed, and the recovery command seems to be done correctly with "Recovering device. This operation might take 30s.
    Erasing user code and UICR flash areas."

    Regarding your setup, have you measured the voltage on the I2C sensor you have connected to see that it gets the necessary voltage it needs to run? Also, what operating voltages does this I2C sensor support exactly? It's also important to make sure that it doesn't go into some undefined state if the battery at some point goes below the required voltage. This should not be an issue with the nRF52, as the brown-out reset. From what I see in the logs you have provided it seems like the sensor isn't powered, so I would strongly recommend measuring with a multimeter or similar that it is indeed being provided the necessary power. If not, make sure that the GPIO providing it with power is enabled before the i2c_init() function is called.

    Best regards,

    Simon

  • Thank you for your response.

    The sensor Vdd (and IO) supply range is 1.71 V to 3.6 V.

    I tested the regulator by switching the GPIO0.n to power up an LED and is working fine. I need to figure out how directly measure the voltage at the sensor since it is a tiny sensor on a 3rd-party board.

    I agree that the " the sensor isn't powered" by the time the  sensor driver is attempting to verify sensor communications. The sensor is supposed to be powered by the regulator (which actually powers the LED in a separate test). The debug log shows that regulator's driver is invoked before the sensor driver.

    10. dev.name: "lis2dh-pwr-reg" (api: <api_onoff>) -- regulator driver
    11. dev.name: "lis2dh@19" (api: <lis2dh_driver_api>) sensor driver (error: seems sensor is not powered yet)

    Could you please help me better understand the kernel initialization messages "z_arm_usage_fault" and 'z_arm_reset" associated with "dev: 0x0 <i2c_dump_msgs>" (please see above debug log)?

    These messages occur very early in the driver initialization.

    dev: 0x0 <i2c_dump_msgs>" has the following associated attributes:
        config: 0x42e1 <z_arm_reset>
        api: 0xa3e1 <z_arm_nmi>
        state: 04299 <z_arm_usage_fault>
        data: 04299 <z_arm_usage_fault>

Reply
  • Thank you for your response.

    The sensor Vdd (and IO) supply range is 1.71 V to 3.6 V.

    I tested the regulator by switching the GPIO0.n to power up an LED and is working fine. I need to figure out how directly measure the voltage at the sensor since it is a tiny sensor on a 3rd-party board.

    I agree that the " the sensor isn't powered" by the time the  sensor driver is attempting to verify sensor communications. The sensor is supposed to be powered by the regulator (which actually powers the LED in a separate test). The debug log shows that regulator's driver is invoked before the sensor driver.

    10. dev.name: "lis2dh-pwr-reg" (api: <api_onoff>) -- regulator driver
    11. dev.name: "lis2dh@19" (api: <lis2dh_driver_api>) sensor driver (error: seems sensor is not powered yet)

    Could you please help me better understand the kernel initialization messages "z_arm_usage_fault" and 'z_arm_reset" associated with "dev: 0x0 <i2c_dump_msgs>" (please see above debug log)?

    These messages occur very early in the driver initialization.

    dev: 0x0 <i2c_dump_msgs>" has the following associated attributes:
        config: 0x42e1 <z_arm_reset>
        api: 0xa3e1 <z_arm_nmi>
        state: 04299 <z_arm_usage_fault>
        data: 04299 <z_arm_usage_fault>

Children
No Data
Related