LIS2MDL prevents nRF52833 from staying in SYSTEM OFF

I am using the common application framework of the nrf connect sdk. Specifically, I am testing the power manager module to put the board in OFF mode.

However, there is an issue whenever I include the node corresponding to the LIS2MDL magnetometer in my overlay file and I enable CONFIG_SENSOR and CONFIG_SPI.

Even if the board goes to sleep successfully, it will get awoken again within a second by what I can only assume is data coming in from the sensor which triggers a GPIO signal.

This behaviour simply does not happen when CONFIG_SENSOR is disabled, or when my overlay file does not include the LIS2MDL.

For reference, the board also has a LSM6DSO attached to the same SPI interface, which does not reset the board once in SYSTEM OFF.

Checking the LIS2MDL zephyr driver I noticed that it is supposed to handle suspension on its own, but clearly this is not happening.

Any help will be appreciated.

Kind regards,

feathers

Parents
  • Hi,

    Which GPIOs are you using for connecting the sensor? I'm not sure if the power management library will reconfigure any GPIOs used by the sensor when you go to System OFF. If any GPIOs are configured as an input with SENSE enabled, the pin will wake the chip from System OFF if it detects an edge in the correct direction. Have you tried 

    You can check if the wakeup from System OFF was caused by a GPIO or another source by reading out the NRF_POWER->RESETREAS register.

    Best regards,
    Jørgen

Reply
  • Hi,

    Which GPIOs are you using for connecting the sensor? I'm not sure if the power management library will reconfigure any GPIOs used by the sensor when you go to System OFF. If any GPIOs are configured as an input with SENSE enabled, the pin will wake the chip from System OFF if it detects an edge in the correct direction. Have you tried 

    You can check if the wakeup from System OFF was caused by a GPIO or another source by reading out the NRF_POWER->RESETREAS register.

    Best regards,
    Jørgen

Children
Related