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

BLE not starting in custom Board of NRF52832

Hi,

We made a custom PCB using the NRF52832 and followed the reference design. While everything else is working in our system, the BLE part is not working. We are using SDK 12.3 with Softdevice of S132. It seems like the radio is not getting turned ON. There is no hard fault in the code and we have even tried to flash examples provided by Nordic but even then advertising doesn't start and the board is not visible to other BLE devices. What can be the possible reasons for BLE not working? Would the Low-Frequency Clock be a reason for this? It seems like a hardware fault rather than a software fault.

  • The low frequency clock can be a problem. If your custom board does not have a low frequency crystal connected, the code will wait forever for it to start. This is not a hardfault, just a while loop with a condition that never changes.

    If you want to use a board without low frequency crystal, you should select another low frequency clock source. Try something like

    #define NRF_CLOCK_LFCLKSRC      {.source       = NRF_CLOCK_LF_SRC_SYNTH,            \
                                    .rc_ctiv       = 0,                                \
                                    .rc_temp_ctiv  = 0,                                \
                                    .xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM}
    
  • Note that LFCLK Synthesized from HFCLK draws alot of power. If the board does not have a LF crystal, the recommended config is:

    #define NRF_CLOCK_LFCLKSRC      {.source       = NRF_CLOCK_LF_SRC_RC,            \
                                    .rc_ctiv       = 32,                                \
                                    .rc_temp_ctiv  = 2,                                \
                                    .xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM}
    
  • We do have a low-frequency clock in the circuit. I have tried the approach which you have mentioned Andre. I will change the settings as recommended by Sigurd and try it out.

  • If the above changes does not help. Then you should check that the HF crystal is correctly mounted, i.e. not turned 90 degrees.

    You could also add this code at the start of main(), and check that you are not getting stuck in the while loop. If you get stuck in the while-loop, then you have some problem with the HF crystal.

      // Start HFCLK from crystal oscillator. The radio needs crystal to function correctly.
      NRF_CLOCK->TASKS_HFCLKSTART = 1;
      while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0);
    
  • Thanks Sigurd. We are actually using High Frequency clock in the code before doing any BLE activity and the timers are running fine which tells us that there is no problem with the HFCLK. Hence, I think Low Frequency clock could the reason. Let me know if there is something else to try.

Related