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

Not able to wake the board from deep sleep(System off)

I am very new to Nordic products so please excuse my ignorance.I have been trying to put my nrf52840 board to deep sleep. It seems to go to sleep but when I try to wake it up by pushing the buttons, it doesn't wake up.

This is how  I modified Ble_app_blinky_c, I added sleep_mode_enter(){}, buttons_leds_init(){}, and bsp_event_handler(bsp_event_t event){} from Ble app template . And then I am calling buttons_leds_init  and sleep_mode_enter in Main.c.Basically I want the board to be in deep sleep at all times and wake up only when I push the buttons.

I have included my project below.

What I am doing wrong?

Thank you in advanceble_app_blinky_c.zip

Parents
  • Hi David

    So you want it to go to deep sleep by itself after the application has scanned/received for some time? In that case, you should set the SCAN_DURATION to however long you want it to scan before the device goes to sleep, as well as setting the SUPERVISION_TIMEOUT to however long you'd like a connection to be inactive before the central disconnects and goes to sleep.

    Or is the issue that you're not able to get the device into deep sleep mode at all? Because on my end, after just a few tweaks to your code, the application now goes to sleep if I press button 1 on the DK, and wakes up by a press of any button.

    Best regards,

    Simon

  • Hi Simon

    Yes, I want it to go to sleep by itself but after it had sent the data to the connected peer device. That is why I tried to put sleep_mode_enter() in  button_event_handler after ble_lbs_led_status_send() (which didn't work).

    Correct me if I am wrong, my understanding is setting SCAN_DURATION to a certain time, if it gets connected before expiration time it will never go to sleep.

    In other words what I want is  the central to always be in deep sleep. When you push button 1 or button 2 the device should wake up, send data to the connected peer device and then go back to sleep.

Reply
  • Hi Simon

    Yes, I want it to go to sleep by itself but after it had sent the data to the connected peer device. That is why I tried to put sleep_mode_enter() in  button_event_handler after ble_lbs_led_status_send() (which didn't work).

    Correct me if I am wrong, my understanding is setting SCAN_DURATION to a certain time, if it gets connected before expiration time it will never go to sleep.

    In other words what I want is  the central to always be in deep sleep. When you push button 1 or button 2 the device should wake up, send data to the connected peer device and then go back to sleep.

Children
No Data
Related