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.

Parents
  • 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);
    
Reply
  • 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);
    
Children
  • Hey sigurd, we realized that the orientation of the High-Frequency clock was not correct which you pointed out as well. We fixed that and BLE is now working fine. We are very confused on how the timers are running fine but the radio is not. If we start the clock using NRF_CLOCK->TASKS_HFCLKSTART = 1; then it is mentioned in the datasheet that HFXO will get started instead of HFINT. This means even the timers are running on the external oscillator. Isn't that correct?

  • Great to hear that the issue is now resolved.

    The HFCLK is either running on internal oscillator (HFINT) or crystal oscillator (HFXO). The TIMERS can be using HFINT or HFXO, but the RADIO need to use HFXO.

    Q: If we start the clock using NRF_CLOCK->TASKS_HFCLKSTART = 1; then it is mentioned in the datasheet that HFXO will get started instead of HFINT. This means even the timers are running on the external oscillator. Isn't that correct?

    A: Yes, that is correct. You can check if the HFCLK is using HFINT or HFXO by calling the function nrf_drv_clock_hfclk_is_running(). The function will return true if you are using the HFXO.

Related