nRF52840 sleep mode with RFM95W LoRa is not working?

We are using nrf52840 to integrate with LoRa(RFM95W) and when we are trying to keep the board into sleep mode(SYSTEM ON MODE) but, it is not going to sleep. Here ,we are using the power management library to keep the board into sleep mode and timers to wake microcontroller up from sleep mode.

nrf_pwr_mgmt_init(); nrf_pwr_mgmt_run(); and we are also tried using this functions

__WFE();

__SEV();

__WFE();

But, nothing is keeping microcontroller into system on sleep mode.

Those three lines are in a while loop and inbuilt timer which is called in nrf_pwr_mgmt_init() was configured and used .

Without LoRa,  the sleep was working but from the moment we integrate LoRa with the sleep mode, nrf52840 doesn't go to sleep.

We want to LoRa goto sleep for every 30 seconds and then wakeup transfer data.

Regards,

Nagari Gopal.

  • Hello,

    I recommend using power_management_init() and idle_state_handle(), the idle_state_handle() is a wrapper around nrf_pwr_mgmt_run() but also ensure that any possible log is emptied and that the app scheduler is handled (if used).

    When you say it doesn't go to sleep, how do you observe this? Are you measuring current consumption or do you see that the it's always immediatly is returning from idle_state_handle()?

    Looks like Lora is using an SPI interface, I don't see any reason why an SPI interface should keep waking up the chip. So I guess you will just try to debug this further. Maybe the Lora module have a wakeup/interrupt pin that is waking up the nRF chip?

    Kenneth

  • Hi ,

    As you mentioned, we are using power_management_init() and idle_state_handle() functions and it is returning from the idle_state_handle() function immediately.

    LoRa is using SPI interface to nrf52840 and I am in a daze why it is not going to sleep like that . We have not connected any interrupt pins from the LoRa to nrf52840 also.

    Regards,

    Gopal

Related