Shutting down BLE host stack using bt_disable()

Hi,

We are using nrf Connect SDK v2.0.2 with the hci_rpmsg app programmed into the network core.  We have a second radio test DTM application programmed into the network core coexisting with the hci_rpmsg app. On normal startup the hci_rpmsg app will execute however we want the ability to shutdown the BLE host and execute the radio DTM app.  Does the bt_disable() function properly disable the BLE host stack on the app core?

  • Hello,

    I don't see any immediate reason why the bt_disable() should not work. Though I personally would do this a bit different, I would have included a test pin (with internal pull-up) on the layoyut, and on power up the applicaiton would read this pin and enter DTM mode only if the test pin was low, else run normal application. It would then be rather straight forward to perform DTM in production this way (e.g. by grounding the test pin before/on power up/reset), and you would avoid having a state machine for the application that could be complex if you need to rely on bt_disable(). 

    All that said, if you do go for the bt_disable(), you shoudl be aware that the radio is power cycled by the BLE stack, and hence you would then also need to include a fix for this errata 158 in the DTM project: Errata 158

    Errata 158 workaround is not needed if you run DTM straight after a power on reset as suggested.

    As a side note: You should update to ncs v2.1.2 to include a fix for Errata 158: SDK nrfxlib v2.1.2 change log

    Hope that helps,
    Kenneth

  • Thank you Kenneth for your feedback!  The radio test mode is entered through a "backdoor" screen on our UI which is why the stack needs to be disabled.  It's normally enabled until the backdoor test screen is entered.

    I downloaded ncs v2.1.2 and the bt_disable() function still doesn't look like it attempts to disable the stack.  The bt_dev.drv.close function is not set in the HCI driver.   bt_disable() returns with -ENOTSUP. Is this something we are supposed to define?

    Thanks!

  • Sorry you are right, it's not possible to disable the bt stack. So you would need to execute a soft reset to enter DTM mode.

    Kenneth

Related