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

nRF51 Custom board resets on button press.

Hi,

I am quite new to nRF51 development so please excuse me for my mistakes or not using right words if any. I have some code that fully works on the official nRF51 DK. I want to make it work on a custom board based on nRF51. Only IO pins are different. I got most of the functionality working except one of the button is working rather oddly on the custom board. On the official DK, pressing this button turns ON an on-board LED and a timer turns it off 5 seconds later. All works fine there. On the custom board however, pressing this button immediately puts the board into sleep mode after starting the 5 second timer. I confirmed that by debugging the code which hits a break-point in sleep_mode_enter() function which gets called on pressing this particular button. If I press the same button again, the board resets and calls main().

If this is not odd enough, here is the next part - when my custom board is connected to a custom mobile app, everything works as expected. Things don't work only when the custom board is looking for the mobile app or advertising.

This link was quite useful to understand what's happening but I couldn't resolve this issue.

Any help towards solving this issue will be great. Thank you.

Parents
  • I finally solved this mystery myself. The button I mentioned is the very first button (BUTTON_0) in the button list. I did not realise that at the time of writing my question above.

    BSP BLE Button Module link from Nordic documentation explains very clearly that it is the default behaviour of Buttons when using BSP. Pressing BUTTON_0 puts board to sleep. For time being I have moved the functionality to BUTTON_1 or to the second button in the list, but ultimately I would like to change the BUTTON_0 behaviour that puts the board to sleep. So for now my code works fine with this change.

    Hope this helps someone like me.

Reply
  • I finally solved this mystery myself. The button I mentioned is the very first button (BUTTON_0) in the button list. I did not realise that at the time of writing my question above.

    BSP BLE Button Module link from Nordic documentation explains very clearly that it is the default behaviour of Buttons when using BSP. Pressing BUTTON_0 puts board to sleep. For time being I have moved the functionality to BUTTON_1 or to the second button in the list, but ultimately I would like to change the BUTTON_0 behaviour that puts the board to sleep. So for now my code works fine with this change.

    Hope this helps someone like me.

Children
Related