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

BT832 BLE sample disconnect immediately

All standard SDK examples disconnect immediately once I try to connect to from Android device. But when I flash the same sketch to nRF52-DK, I can connect successfully.

I use BT832 as target device and flash it with nRF52-DK. Flash and sketch validation complete successfully (ble_app_template). I can see the device "Nordic_Template" in "nRF Connect" Android application. But once I try to connect it open clean tab with no information there. 

J-Link RTT Viewer shows me the following log details:

 0> <info> app: Template example started.
 0> <info> app: Fast advertising.
 0> <info> app: Connected.
 0> <info> app: Fast advertising.
 0> <info> app: Disconnected.

I assume that some error occurs, and probably fatal enough to skip logging... But don't understand how to troubleshoot it.

I thought that maybe there is an issue in SDK, but tried on 2 of them: 12.3.0 and 14.2.0. The result is the same. 

I thought that maybe there is issue with powering BT832 directly from nRF52-DK, but the issue is still there when I power BT832 from external source. 

I also tried different ble examples from SDK (ble_app_blinky, ble_app_template, ...)

Maybe this is hardware issue with BT832 module, but strange that advertising work fine, I see the device in "nRF Connect" and the issue happen only on connection attempt.

I would appreciate any help, thanks in advance. 

P.S.

Also I noted that in BT832 datasheet says that SoC is "nRF52832 QFAA" but all files inside my _build folder have name "nrf52832_xxaa" maybe this is the case? But how to switch it?

  • Hello

    BT832 doesn’t seem to have 32khz clock within the module. Nordic DK examples uses 32khz by default. Can’t say that this your issue, but you could check that.

    Best regards

    Søren

  • Hi,

    The disconnect reason should give us some more information about why the disconnect happened.

    Could you try to print the reason when you get the disconnect event ? i.e. add this code-line under the BLE_GAP_EVT_DISCONNECTED event in ble_evt_handler()

    NRF_LOG_INFO("Disconnect reason: %d",p_ble_evt->evt.gap_evt.params.disconnected.reason);

  • Hi Sigurd. 
    Here is what I get after applying extra logging:

     0> <info> app: Template example started.
     0> <info> app: Fast advertising.
     0> <info> app: Connected.
     0> <info> app: Fast advertising.
     0> <info> app: Disconnected.
     0> <info> app: Disconnect reason: 62

    I tried to dig 62 code, and looks like this is ble_hci.h:

    #define BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED          0x3E       /**< Connection Failed to be Established. */

    Am I correct? If so, still not clear what is wrong.

  • What type of Android device is this? It could be a timing issue. With SDK 14.2, could you try the following configuration in sdk_config.h

    // </h> 
    //==========================================================
    
    // <h> Clock - SoftDevice clock configuration
    
    //==========================================================
    // <o> NRF_SDH_CLOCK_LF_SRC  - SoftDevice clock source.
     
    // <0=> NRF_CLOCK_LF_SRC_RC 
    // <1=> NRF_CLOCK_LF_SRC_XTAL 
    // <2=> NRF_CLOCK_LF_SRC_SYNTH 
    
    #ifndef NRF_SDH_CLOCK_LF_SRC
    #define NRF_SDH_CLOCK_LF_SRC 0
    #endif
    
    // <o> NRF_SDH_CLOCK_LF_RC_CTIV - SoftDevice calibration timer interval. 
    #ifndef NRF_SDH_CLOCK_LF_RC_CTIV
    #define NRF_SDH_CLOCK_LF_RC_CTIV 16
    #endif
    
    // <o> NRF_SDH_CLOCK_LF_RC_TEMP_CTIV - SoftDevice calibration timer interval under constant temperature. 
    // <i> How often (in number of calibration intervals) the RC oscillator shall be calibrated
    // <i>  if the temperature has not changed.
    
    #ifndef NRF_SDH_CLOCK_LF_RC_TEMP_CTIV
    #define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 2
    #endif
    
    // <o> NRF_SDH_CLOCK_LF_XTAL_ACCURACY  - External crystal clock accuracy used in the LL to compute timing windows.
     
    // <0=> NRF_CLOCK_LF_XTAL_ACCURACY_250_PPM 
    // <1=> NRF_CLOCK_LF_XTAL_ACCURACY_500_PPM 
    // <2=> NRF_CLOCK_LF_XTAL_ACCURACY_150_PPM 
    // <3=> NRF_CLOCK_LF_XTAL_ACCURACY_100_PPM 
    // <4=> NRF_CLOCK_LF_XTAL_ACCURACY_75_PPM 
    // <5=> NRF_CLOCK_LF_XTAL_ACCURACY_50_PPM 
    // <6=> NRF_CLOCK_LF_XTAL_ACCURACY_30_PPM 
    // <7=> NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM 
    
    #ifndef NRF_SDH_CLOCK_LF_XTAL_ACCURACY
    #define NRF_SDH_CLOCK_LF_XTAL_ACCURACY 1
    #endif

  • Sigurd, thanks, this magic numbers helped me! Now it works fine. 
    Could you please advice if I can read about this magic numbers or overall about sdk_config.h configuration strategy somewhere?

Related