Can't disable softdevice

Hello everyone,

I'm using nRF52832 with SDK v17 (S132 Softdevice).

I don't know why, but I can't disable softdevice. I can enable it normally, but when i make use of nrf_sdh_disable_request(), the process just never ends (i debugged the code and the function never returns).

I think there is some problem with the buttonless_dfu_sdh_state_observer, as the code returns correctly with other observers, but don't understand why would this be a problem or how to solve it.

More exactly, the code enters this function:

static void buttonless_dfu_sdh_state_observer(nrf_sdh_state_evt_t state, void * p_context)
{
    if (state == NRF_SDH_EVT_STATE_DISABLED)
    {
        // Softdevice was disabled before going into reset. Inform bootloader to skip CRC on next boot.
        nrf_power_gpregret2_set(BOOTLOADER_DFU_SKIP_CRC);

        //Go to system off.
        nrf_pwr_mgmt_shutdown(NRF_PWR_MGMT_SHUTDOWN_GOTO_SYSOFF);
    }
}

And there, inside, it goes to system off, so i can't do anyuthing after disabling the softdevice. I don't know if this is supposed to happen this way, or if i'm doing something wrong.

Thanks for reading.

Parents Reply
  • Hello,

    Oh, you're right, that was quite a silly mistake by me, I didn't notice due to brain burnout haha.

    That observer is from the example buttonless DFU, would it be OK if i just deleted that line? So that my DK doesn't go into System OFF mode. Or how can you wake it up from deep sleep?

    I was trying to disable softdevice because it was no longer necessary in that part of the code. I also thought it raised power consumption a little bit.

    Thanks for your help, Vidar.

Children
  • Hello,

    Yes, it is fine to remove this. This part of the example was made to demonstrate how you can skip boot validation of the app after waking up from System OFF sleep. That said, the softdevice does not affect the sleep current simply by being enabled, so you can achieve the same low power consumption by stopping the advertiser or disconnecting from any active connections. 

Related