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

When ble_app_uart_c example enters sleep mode?

Hello, In ble_app_uart_c example, I can see sleep_mode_enter() function. I would like to know when this function is called and what it does. I don't want my IC to get into sleep mode. So, removing this function will do my job?

Please help me in this regard.

  • It puts the device into deep sleep with the sd_power_system_off() function. This turns off all clocks and the device can only be woken from GPIO interrupt. On wake, the device will reset.

    You can see where it is called by searching for the function in the code. I believe it's normally called when you press one of the buttons (on the dev kits).

    If you don't want to go into power off mode, I suggest you comment out the places where the sleep_mode_enter function is called.

  • At least on nRF51, it's also called at the end of advertising after 3 minutes by default. Commenting that out will not put the chip in sleep mode but chip won't be visible over BLE anymore.

    Note, while a connection is established nRF51 never sleeps.

Related