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

BLE Scanning not working with NRF52832

I am working on nrf52832 BLE. I have used soft device s132. Antenna device is as per the reference design of NRF52832 and have used 32MHZ crystal for HFXO oscillator. but BLE scanning is not happening with nrf-connect app. What could be the possible reasons for the problem. Do we need 32.768KHZ crystal for radio application or any other software modifications needed?. is there any methods to debug the problem? 

Thanks in advance

Parents
  • Hello,

    If you don't need the 32KHz crystal, but if you don't have it, you need to tell the application that you don't have it. Or more correctly, in all the example projects in the SDK, the softdevice is told that it has an external 32KHz crystal.

    This may look a bit different in the different versions of the SDK, but SDK14.2.0, there is a define called CLOCK_CONFIG_LF_SRC, that looks something like this:

    // <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 1
    #endif

    Change to NRF_SDH_CLOCK_LF_SRC 0, and it will use the internal RC oscillator.

    You should also be aware of the two defines below this one, if you use the RC oscillator. To see what they do, see how it is used in nrf_sdh_enable_request() in nrf_sdh.c, and the definition of nrf_clock_lf_cfg_t in nrf_sdm.h.

    Best regards,

    Edvin

Reply
  • Hello,

    If you don't need the 32KHz crystal, but if you don't have it, you need to tell the application that you don't have it. Or more correctly, in all the example projects in the SDK, the softdevice is told that it has an external 32KHz crystal.

    This may look a bit different in the different versions of the SDK, but SDK14.2.0, there is a define called CLOCK_CONFIG_LF_SRC, that looks something like this:

    // <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 1
    #endif

    Change to NRF_SDH_CLOCK_LF_SRC 0, and it will use the internal RC oscillator.

    You should also be aware of the two defines below this one, if you use the RC oscillator. To see what they do, see how it is used in nrf_sdh_enable_request() in nrf_sdh.c, and the definition of nrf_clock_lf_cfg_t in nrf_sdm.h.

    Best regards,

    Edvin

Children
  • Hi Edvin,

    Thanks for the reply.

    We have made the clock settings as per the above. But as BLE advertising was not happening in custom board we have checked the functioning of HFXO crystal(32MHZ) by calling sd_clock_hfclk_is_running(). It has returned '0' in custom board which means crystal is not working. In development board we have got flag '1' for the same function call. 

    All the peripherals except BLE are working. We have used 32mhz crystal with 22pF tuning capacitors(have checked with 12pF also) and the layout is as per the reference circuit. Please suggest do we need any further tuning of crystal and how to make BLE work in the available custom board?

    Thanks   

Related