Hello, I use nrf51422 for my project. I have to collect data via BLE nus from phone, but after that i don't need SD anymore. Can i use blocked hardware, like RTC0, after disable sd? I try to do that, but i get Hard Fault.
Regards Michał,
Yes, you can use blocked hardware after disabling the SoftDevice. Using blocked hardware while SoftDevice is enabled will lead to hardfault.
You are sure you are not calling any SoftDevice functions? A common mistake is to call power_manage()
, which will call sd_app_evt_wait()
. This have to be changed to this if the SoftDevice is disabled:
__SEV();
__WFE();
__WFE();
Thank you for answer. But its still not work. After collect my data i use function sd_ble_gap_disconnect and softdevice_handler_sd_disable. When i want to take another step in debug after this function, its going to hardfault. its look like this:
test=sd_ble_gap_disconnect(m_conn_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION );
test=softdevice_handler_sd_disable();
ppi_init();
rtc_config();
timer1_init();
Do i need call other function before sd disable?
Regrads Michal,
You should wait for BLE_GAP_EVT_DISCONNECT
after calling disconnect before disabling the SoftDevice, and not go into advertising which is the default behaviour of the SDK examples, see ble_advertising_on_ble_evt(...)
in ble_advertising.c.
I did like you said, I wait for BLE_GAP_EVT_DISCONNECT, but still after sd_disable next step in debugger is going to hardfault. What i need to do before i use softdevice_handler_sd_disable()?