This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf52832 sleep mode from android app

I am currently looking at how to put the nrf52 development board to sleep (and wake up) by sending a command from an android application (with SDK v15.2).

I have been experimenting with the nrfBlinky app and wanted to know if anyone has some advice on how one would go about doing this.

I have searched the forums but couldn't find a similar question although there are posts about calling __WFE() to put the board in low power mode from the firmware (or calling an event like sd_app_evt_wait()). I did read there are two sleep mode for this board a SYSTEM ON and SYSTEM OFF mode. I am not certain which mode suits the use case best, although I assume we would want the SYSTEM ON mode as the app would need to send an event to wake it up. Although I wouldn't be against a SYSTEM OFF mode where the reset button would need to be pressed to wake it up (so just sending a "put to sleep" command from the app). 

Any advice would be much appreciated.

Parents
  • Hey,

    First, I would advise you to try the ble_uart example in the peripheral folder. With that you can set up a simple uart link between your nrf52 board and android device and send messages either way.

    To put the board into low power, with the softdevice enabled, you should use the sd_app_evt_wait function. You can put this in your main loop so that the device goes to sleep when it has nothing else to do. This will be SYSTEM ON mode. So you can send a message from the android device and it will wake up the nrf.

    You can also use SYSTEM OFF mode, as you said. When you put the device in SYSTEM OFF mode, the BLE link will be closed, the device will be disconnected. You can wake up the device using a GPIO interrupt ,NFC or LPCOMP interrupt. This will provide you with lowest power consumption but the nrf when wakes up, will be like it has been reset.

    Also, do check the documentation if you have any further question.

Reply
  • Hey,

    First, I would advise you to try the ble_uart example in the peripheral folder. With that you can set up a simple uart link between your nrf52 board and android device and send messages either way.

    To put the board into low power, with the softdevice enabled, you should use the sd_app_evt_wait function. You can put this in your main loop so that the device goes to sleep when it has nothing else to do. This will be SYSTEM ON mode. So you can send a message from the android device and it will wake up the nrf.

    You can also use SYSTEM OFF mode, as you said. When you put the device in SYSTEM OFF mode, the BLE link will be closed, the device will be disconnected. You can wake up the device using a GPIO interrupt ,NFC or LPCOMP interrupt. This will provide you with lowest power consumption but the nrf when wakes up, will be like it has been reset.

    Also, do check the documentation if you have any further question.

Children
No Data
Related