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

    If you go to system OFF mode after disconnecting, you will have to connect to the peripheral device again upon wake up, which should trigger the BLE_GAP_EVT_CONNECTED event. Was it not the intention that you wanted to go to system OFF between data transfers?

    Best regards,

    Simon

  • Hi Simon

    Yes, I want it to go to sleep after data transfer.But the issue is disconnecting within BLE_GAP_EVT_CONNECTED case. Here is the flow......Assuming we have a logic to check if data has been sent to the peripheral in BLE_GAP_EVT_CONNECTED case(Which I have to yet figure out how i am going to do that). The central board connects to the peripheral for the first time,it checks if data has been sent in BLE_GAP_EVT_CONNECTED case, if True then we  disconnect and put it to sleep, but in this case, since it is the first time, it is false so it will stay connected,and even if I push the button again,data will be sent but BLE_GAP_EVT_CONNECTED case won't be triggered again, because the connection is still active. Unless I misunderstood something from your previous post.

Reply
  • Hi Simon

    Yes, I want it to go to sleep after data transfer.But the issue is disconnecting within BLE_GAP_EVT_CONNECTED case. Here is the flow......Assuming we have a logic to check if data has been sent to the peripheral in BLE_GAP_EVT_CONNECTED case(Which I have to yet figure out how i am going to do that). The central board connects to the peripheral for the first time,it checks if data has been sent in BLE_GAP_EVT_CONNECTED case, if True then we  disconnect and put it to sleep, but in this case, since it is the first time, it is false so it will stay connected,and even if I push the button again,data will be sent but BLE_GAP_EVT_CONNECTED case won't be triggered again, because the connection is still active. Unless I misunderstood something from your previous post.

Children
No Data
Related