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

    Seeing as you want the application to go to sleep after a transfer is complete, you should make the central disconnect from the peripheral when the data transfer between them is complete. So after that operation is complete/successful, you should call sd_ble_gap_disconnect in the BLE_GAP_EVT_CONNECTED case in ble_evt_handler(). Then, after you have disconnected successfully, you should go to sleep using the sleep_mode_enter() function, as this function prepares wake-up buttons for you so that the device will wake up if you press any buttons.

    I also suggest that you put in a logger message or similar in order to see that the connection, data transfer, and disconnection events are successful, using a terminal and NRF_LOG_INFO or something similar.

    Best regards,

    Simon

  • Hi Simon

    My understanding is BLE_GAP_EVT_CONNECTED case will be only executed the first time when the board is connected to the peer device.After I push the button to send the data, the BLE_GAP_EVT_CONNECTED event won't be triggered again. Correct me if I am wrong or maybe I misunderstood you.In short, that didn't work for me.

Reply Children
No Data
Related