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

BSP_EVENT_SYSOFF vs BSP_EVENT_SLEEP

Hi,

This is about BSP button events to manage system sleep/wakeup. In the power management example in the SDK what is the difference between BSP_EVENT_SYSOFF and BSP_EVENT_SLEEP? Doesn't system off mean shutdown as per the comment in bsp.h?

Parents
  • Hi,

    The BSP provides standardized ways to SDK examples for taking commands from buttons and signalling states via LED's. However, some examples handles the signals a bit differently. Therefor, you should consider the BSP documentation the normal/default intention of each event, but you should refer to example documentation (or code itself) to see the specific exact meaning in that example/context.

    In this case, the Power Management Example use the signals in a special way, as indicated by the documentation:

    Go to System OFF

    1. Shortly press Button 2 to immediately switch to System OFF state (if the application is ready), without waiting for timeout.
    2. Pressing Button 1 will toggle the ready status.
    3. Wake up the application from System OFF by pressing Button 2.
    4. Alternatively, you can touch the NFC antenna (if present) with a smartphone or a tablet to wake up the application.

    Go and stay in System OFF

    1. Press and hold Button 2 to immediately switch to System OFF state (if the application is ready) and stay in it.
    2. Pressing Button 1 will toggle the ready status.
    3. From this point, the application requires an external reset to restart because the wakeup mechanism is not set up.
  • Thanks for the reply. So, in the second scenario the system never wakes up because the m_stay_in_sysoff is true not because there is no wakeup button config?

    Also, I am observing that my system wakes up on button press even though button isn't configured to do so. Could this be due to some settings in GPIOTE for the button?

Reply Children
Related