nRF5 SDK is not maintained anymore
More Info: Consider nRF Connect SDK for new designs

Missing Advertising packets

Hi Team,

I am using the solar beacon code from Nordic playground github for some reason and I know this is not qualified. I observe that the receiver suddenly misses a train of consecutive advertising packets (eg:- like 1000 advertising packets ). I included a packet counter to make sure that the device is really sending the packets and I confirm that it is being sent but not received. This is observed on testing for a long time (like 24 hours). This happens intermittently and it is not observed when using the softdevice.

I see that the code starts the HFCLK and waits 1560 uS before starting the radio operation, as given below.

When I ported this code to my platform, I implemented it as given below:

if (!nrf_drv_clock_hfclk_is_running())
{
  nrf_drv_clock_hfclk_request(NULL);
  while(!nrf_drv_clock_hfclk_is_running())
  {
    idle_state_handle();
  }
}

  1. I am trying to debug and I am just wondering, if I need to wait for 1500 uS before starting radio operation. The above code is checking for the flag "HFCLKSTAT" and not "EVENTS_HFCLKSTARTED". The datasheet says, "EVENTS_HFCLKSTARTED" will make sure that the CLK is running and is stable. Does checking "HFCLKSTAT" do the same ?
  2. I notice that in the code __NOP() is being used to create delays between switching channels, as given below.

for ( i = 0; i < 9; i++ )
{
__NOP();
}

But I have read that, __NOP() is not a reliable way to add delays. Do you think, this could create issue ? Also, how much time should the data be kept on each channel as per BLE specification ?

Parents Reply Children
Related