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

How to disable BSP in ble_app_template

Hi folks,

I'm using the ble_app_template on a custom board. The BSP has a bunch of stuff I don't need, so I would prefer to not use it and handle my I/O directly instead. The problem is, when I try to remove the BPS code, the app_template will no longer shut down on timeout via sd_power_system_off(). I have an app_timer blinking an LED in my main.c file, and that's it. When the BLE_GAP_EVT_TIMEOUT event fires, the nRF51822 just resets instead of shutting down. Can anyone explain why this is happening?

Parents
  • Hi Doug

    I am not sure why the board is resetting in your case. However, when waking up from System Off the chip will reset. So my best guess what might be happening is that your chip is entering System Off and immediately waking up again. What is your wakeup source for waking up from System Off? Do you perhaps have a wakeup pin that is configured without pull, so that the wakeup pin is floating and therefore waking up the chip immediately?

    I also found the need previously to exclude the BSP library and modified the ble_app_template example to use the app_gpiote library directly to configure a pin to wakeup the chip and toggle a led. In this example the chip is going to sleep after advertising timeout and wakes up again by pressing button 1 on the nRF51 DK board.

    ble_app_template_with_gpiote_setup.zip

    It is made for SDK 8.0.0 and softdevice 8.0.0. The device will start advertising and time out after 5 seconds, where LED 1 will turn off. Pressing button 1 will wake up the device from System Off and make it start advertising again. Pressing button 1 will also toggle led 2.

Reply
  • Hi Doug

    I am not sure why the board is resetting in your case. However, when waking up from System Off the chip will reset. So my best guess what might be happening is that your chip is entering System Off and immediately waking up again. What is your wakeup source for waking up from System Off? Do you perhaps have a wakeup pin that is configured without pull, so that the wakeup pin is floating and therefore waking up the chip immediately?

    I also found the need previously to exclude the BSP library and modified the ble_app_template example to use the app_gpiote library directly to configure a pin to wakeup the chip and toggle a led. In this example the chip is going to sleep after advertising timeout and wakes up again by pressing button 1 on the nRF51 DK board.

    ble_app_template_with_gpiote_setup.zip

    It is made for SDK 8.0.0 and softdevice 8.0.0. The device will start advertising and time out after 5 seconds, where LED 1 will turn off. Pressing button 1 will wake up the device from System Off and make it start advertising again. Pressing button 1 will also toggle led 2.

Children
Related