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

For nRF52832 SDK 17.0.2 ,How to enter Sleep Mode (Power Off Mode) (Suspend Mode) then press the Button1 for wake up ??

For nRF52832 SDK 17.0.2 ,How to enter Sleep Mode (Power Off Mode) (Suspend Mode) then press the Button1 for wake up ??

Parents
  • Hi,

    Both nrf_gpio_cfg_sense_input and bsp_btn_ble_sleep_mode_prepare should work if configured correctly.

    What have you defined BTN_ID_WAKEUP and BTN_ID_WAKEUP_BOND_DELETE to? Are these pins connected to buttons, and are the pins in the correct state? If any of the pins configured as wakeup pins are pulled in the wrong state or left floating, an immediate reset would be expected.

    uint32_t bsp_btn_ble_sleep_mode_prepare(void)
    {
        uint32_t err_code;
    
        err_code = bsp_wakeup_button_enable(BTN_ID_WAKEUP);
        RETURN_ON_ERROR_NOT_NOT_SUPPORTED(err_code);
    
        err_code = bsp_wakeup_button_enable(BTN_ID_WAKEUP_BOND_DELETE);
        RETURN_ON_ERROR_NOT_NOT_SUPPORTED(err_code);
    
        return NRF_SUCCESS;
    }

    By default, these are defined to 0 and 1, and will use the BUTTON_0/BUTTON_1 configs from your board header file (pca10040.h, etc.).

    Best regards,
    Jørgen

Reply
  • Hi,

    Both nrf_gpio_cfg_sense_input and bsp_btn_ble_sleep_mode_prepare should work if configured correctly.

    What have you defined BTN_ID_WAKEUP and BTN_ID_WAKEUP_BOND_DELETE to? Are these pins connected to buttons, and are the pins in the correct state? If any of the pins configured as wakeup pins are pulled in the wrong state or left floating, an immediate reset would be expected.

    uint32_t bsp_btn_ble_sleep_mode_prepare(void)
    {
        uint32_t err_code;
    
        err_code = bsp_wakeup_button_enable(BTN_ID_WAKEUP);
        RETURN_ON_ERROR_NOT_NOT_SUPPORTED(err_code);
    
        err_code = bsp_wakeup_button_enable(BTN_ID_WAKEUP_BOND_DELETE);
        RETURN_ON_ERROR_NOT_NOT_SUPPORTED(err_code);
    
        return NRF_SUCCESS;
    }

    By default, these are defined to 0 and 1, and will use the BUTTON_0/BUTTON_1 configs from your board header file (pca10040.h, etc.).

    Best regards,
    Jørgen

Children
No Data
Related